Shell
A machine of your own: run commands, keep files, build things
Calling it
This is your own data, so a call has to say who you are. Make a token at /token and send it as a header.
curl -H "Authorization: Bearer $MU_TOKEN" \ https://micro.mu/api/v1/shell/list
Methods
GET /api/v1/shell/listList a directory on your machine
| Argument | Type | Description |
|---|---|---|
dir | string | The directory to list, under /work. Defaults to /work |
curl \ -H "Authorization: Bearer $MU_TOKEN" \ "https://micro.mu/api/v1/shell/list"
GET /api/v1/shell/readRead a file from your machine
| Argument | Type | Description |
|---|---|---|
path * | string | The file to read, under /work |
curl \ -H "Authorization: Bearer $MU_TOKEN" \ "https://micro.mu/api/v1/shell/read?path=path"
POST /api/v1/shell/runRun a shell command on your own machine and get back what it wrote. A real shell in a container: pipes, redirection and && all work, the working directory is /work and files there persist between calls. Use it to build, test, run scripts and move files about. A non-zero exit code comes back in the response rather than as an error, so read the output — a failing build is an answer
| Argument | Type | Description |
|---|---|---|
command * | string | A shell command to run, e.g. 'go test ./... 2>&1 | tail -40' |
dir | string | Directory to run it in, under /work. Defaults to /work |
timeout | number | Seconds to allow, up to the instance's maximum. Defaults to 120 |
curl -X POST \
-H "Authorization: Bearer $MU_TOKEN" \
-H "Content-Type: application/json" \
-d '{"command":"command"}' \
https://micro.mu/api/v1/shell/runPOST /api/v1/shell/writePut a file on your machine, creating any missing directories. Use this rather than shell redirection for anything with quotes or backticks in it, which is most source code
| Argument | Type | Description |
|---|---|---|
path * | string | Where to put it, under /work. Missing directories are created |
content * | string | The whole file. This replaces what was there |
curl -X POST \
-H "Authorization: Bearer $MU_TOKEN" \
-H "Content-Type: application/json" \
-d '{"content":"content","path":"path"}' \
https://micro.mu/api/v1/shell/writeThe same methods are tools over MCP, and every service on this instance is in one reference. Same method, same answer, same price.


