pydo.microvms.run_command()
Generated on 13 Nov 2026
from pydo version
v0.46.0
Usage
client.microvms.run_command(
microvm_id="01a0ef1a-d873-793d-ae6a-5dd6239be62a",
body={
"argv": [...],
"cwd": "/usr/share/nginx/html",
"output_encoding": "utf-8",
},
)Description
To run a command in a MicroVM’s workload container, send a POST request to
/v2/microvms/{microvm_id}/exec.
argv runs directly, not through a shell, with standard input closed. If the MicroVM is
paused and auto-resume is on, the request resumes it and waits until it is running.
A command has 60 seconds to finish. Your team can run 32 commands at once and 60 commands per minute. Rejected requests count toward the per-minute limit.
Parameters
microvm_idstring requiredThe unique ID of the MicroVM.
argvarray of strings requiredExample:
['nginx', '-v']The command and its arguments.
cwdstring optionalExample:
/usr/share/nginx/htmlThe working directory to run the command in.
output_encodingstring optionalHow
stdoutandstderrare returned.utf-8(the default) is a JSON string; bytes that are not valid UTF-8 become U+FFFD.base64returns the exact bytes. Usebase64when the command may emit binary output.
Request Sample
Response Example
More Information
See /v2/microvms/{microvm_id}/exec in the API reference for additional detail on responses, headers, parameters, and more.