Shell

Open Shell →

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/run

The same method over MCP, which is what an agent speaks: shell_run. The answer is identical.

How every call behaves →

Methods

3 creditsPOST /api/v1/shell/run

Run a shell command in your account's container sandbox 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

Needs an account. Changes something, so POST only. Draws 3 credits per call, or accepts payment.

ArgumentTypeDescription
command *stringA shell command to run, e.g. 'go test ./... 2>&1 | tail -40'
dirstringDirectory to run it in, under /work. Defaults to /work
timeoutnumberSeconds 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/run
Costs 3 credits
POST /api/v1/shell/write

Put a file in your account's container sandbox, creating any missing directories. The only file operation that is not a shell command, because it is the one a shell is bad at: source is full of quotes and backticks and a heredoc will mangle it. The content arrives as a string and reaches the file without a shell seeing it. To read, list, search or change a file, use the shell — cat, ls, grep and sed are right there

Needs an account. Changes something, so POST only.

ArgumentTypeDescription
path *stringWhere to put it, relative to /work — not to the directory your last command left you in. Missing directories are created
content *stringThe 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/write

The same methods are tools over MCP, and every service on this instance is in one reference.