Headless runs
One-shot prompt
opencode run "explain this repo"
Runs OpenCode non-interactively. Sends one prompt, prints the reply, and exits. See opencode run.
Continue a session
opencode run --continue "go on"
Resumes the last session. Continues it instead of starting a new one. See opencode run.
JSON output
opencode run --format json "list TODOs" | jq
Emits JSON lines for scripts. Produces one JSON object per line for jq. See opencode run.
Standalone CI run
opencode run --standalone "review the diff"
Isolates the run in its own server. Keeps secrets and sessions out of the shared daemon. See opencode run.
Related links
- opencode run (opencode.ai)
0 Comments for this cheatsheet. Write yours!