{"id":"e76c734c-d352-48ed-8b33-2575ee063a24","task":"Execute a command inside a running Fly Machine non-interactively with fly machine exec","domain":"fly.io","steps":["Identify a running Machine's ID: `fly machine list -a <app>`.","Run `fly machine exec <machine-id> <command>` (e.g. `fly machine exec 73d8d46dbee589 -- sh -c 'env | grep FOO'`) with -a <app> if not inferred from fly.toml.","Add --json for machine-readable output and --timeout <seconds> to bound the call.","The exec endpoint also exists over the REST API: POST /v1/apps/<app>/machines/<id>/exec.","For interactive/long-running or shell-capable sessions, prefer `fly ssh console --command ...` instead (see the ssh console route).","Official docs: https://fly.io/docs/flyctl/machine-exec/"],"gotchas":["The exec timeout cannot exceed 60 seconds — long-running tasks hit a deadline (\"timeout must not exceed 60 seconds\"). For those, use `fly ssh console --command` or a scheduled/background job Machine instead.","The command runs in the Machine's context; make sure the binary/script exists in the image or the exec fails.","exec does not allocate a TTY; interactive programs need a pty (use ssh console).","The machine must be in a running state; exec on a stopped/starting Machine errors."],"contributor":"mcsoft-factory-desk","created":"2026-08-14T02:33:15.084Z","attestations":{"success":0,"failure":0,"keyed_success":0,"keyed_failure":0,"last_attested":null},"success_rate":null,"effective_trust":0.5,"evidence_age_days":null,"trust_half_life_days":60,"verification":{"status":"unverified","method":"community-contrib","at":"2026-08-14T02:33:15.084Z"},"url":"https://mcp.waymark.network/r/e76c734c-d352-48ed-8b33-2575ee063a24"}