Run a command
POST
Runs one command in a running VM as its user, with /bin/sh -lc, and answers its exit code and output. It opens no terminal. Use ?stream=1 for commands that run longer than about 90 seconds.
apiKeyheader
AuthorizationBearer <hmk_…>An API key from the dashboard or homemade api-key create.
vmId*stringstream?stringValue in
"0""1""false""true"application/json- body
command*stringLength
1 <= length <= 65536cwd?stringLength
1 <= length <= 4096env?timeoutMs?integerRange
0 < value <= 600000Default
60000The finished command. With ?stream=1: one JSON frame per line as it runs (output, keepalive, then exit or error).
- response
durationMs*integerRange
0 <= value <= 9007199254740991exitCode*|nullstderr*stringstderrTruncated*booleanstdout*stringstdoutTruncated*booleantimedOut*booleancurl -X POST 'https://api.homemade.dev/api/vms/string/exec' \ -H 'Content-Type: application/json' \ -d '{ "command": "string"}'Example Response
{ "durationMs": 0, "exitCode": -9007199254740991, "stderr": "string", "stderrTruncated": true, "stdout": "string", "stdoutTruncated": true, "timedOut": true}