opencode-cli
Skill2 starsChanged 8 months agoMITView on GitHub
Expert control of opencode via the command line. Use when running opencode TUI, headless server, web UI, or the `run` non-interactive mode; managing sessions, providers, agents, MCP servers, models, stats, import/export, GitHub integration, debugging, database tools, upgrades, or shell completions.
5 other projects use a version of this.
Adopted by
Most recently taken up by
- samirpatil2000/skillstheir own version, first seen Nov 1, 2026
- wentorai/Research-Clawtheir own version, first seen Oct 8, 2026
- spenserhale/skillstheir own version, first seen Sep 24, 2026
- Arcadi4/skillstheir own version, first seen Jul 6, 2026
- julweber/ai_agent_skillsword for word, first seen Mar 20, 2026
Other versions5 projects use a version of this.
Word for word · 1
- julweber/ai_agent_skills★ 2100% same
Edited · 0
None found.
Wrote their own version · 4
- wentorai/Research-Claw★ 858same name
- samirpatil2000/skills★ 17same name
- Arcadi4/skills★ 4same name
- spenserhale/skills★ 1same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository51 other files it gives its agents.
- AGENTS.mdAGENTS.md
- ai-agent-skills-assistantSkill
- ansibleSkill
- artificial-analysisSkill
- cavemanSkill
- claude-cliSkill
- code-doctorSkill
- code-summarizerSkill
- codex-cliSkill
- concourse-ciSkill
- dev-brainstormingSkill
- docker-cliSkill
- file-organizerSkill
- frontend-web-developerSkill
- github-actions-cicdSkill
- github-cliSkill
- gitlab-ci-cdSkill
- grill-meSkill
- gtd-assistantSkill
- herdr-cliSkill
- hf-cliSkill
- karpathy-guidelinesSkill
- kestraSkill
- list-large-filesSkill
- list-most-intensive-processesSkill
- llama-cppSkill
- llm-wikiSkill
- mermaidSkill
- morning-ritualSkill
- obsidian-masterSkill
- obsidian-open-loops-collectorSkill
- opencode-agent-creatorSkill
- pi-cliSkill
- pi-subagents-masterSkill
- planka-development-flowSkill
- plnk-cliSkill
- ponytailSkill
- product-prd-brainstormingSkill
- python-api-developerSkill
- ralph-prd-converterSkill
- ralph-prd-generatorSkill
- release-managementSkill
- rest-testsuite-skillSkill
- skill-loaderSkill
- design-taste-frontendSkill
- terraformSkill
- tmux-coderSkill
- tmux-specialistSkill
- trello-cliSkill
- tts-conversationSkill
- uvSkill
The file
Files
opencode CLI
opencode is an AI coding agent. This skill covers every CLI command and flag.
Global Options (apply to every command)
| Flag | Type | Default | Description |
--print-logs | bool | false | Print logs to stderr |
--log-level | string | — | DEBUG / INFO / WARN / ERROR |
--port | number | 0 (random) | Port to listen on |
--hostname | string | 127.0.0.1 | Hostname to listen on |
--mdns | bool | false | Enable mDNS (sets hostname → 0.0.0.0) |
--mdns-domain | string | opencode.local | Custom mDNS domain |
--cors | array | [] | Extra CORS domains |
-m, --model | string | — | provider/model |
-c, --continue | bool | — | Continue last session |
-s, --session | string | — | Session ID to continue |
--fork | bool | — | Fork session (with -c/-s) |
--prompt | string | — | Prompt to use |
--agent | string | — | Agent to use |
Commands
TUI / Default
opencode [project] # start TUI in current or given directoryrun — Non-interactive execution
opencode run [message..] [flags]| Flag | Default | Notes |
--command | — | Command to run (message = args) |
--share | false | Share the session |
--format | default | default or json (raw events) |
-f, --file | — | Attach file(s) |
--title | — | Session title |
--attach | — | Attach to running server (URL) |
-p, --password | — | Basic auth password (OPENCODE_SERVER_PASSWORD) |
--dir | — | Directory (local or remote) |
--port | random | Local server port |
--variant | — | Model reasoning effort: high/max/minimal |
--thinking | false | Show thinking blocks |
serve — Headless server
opencode serve [server-flags]
# Server flags: --port, --hostname, --mdns, --mdns-domain, --corsweb — Server + browser UI
opencode web [server-flags]attach — Attach to running server
opencode attach <url> # e.g. http://localhost:4096
--dir # directory on remote
-c/--continue / -s/--session / --fork
-p, --passwordacp — ACP server
opencode acp [server-flags]
--cwd # working directory (default: cwd)Session Management
opencode session list [-n <N>] [--format table|json]
opencode session delete <sessionID>
opencode export [sessionID] # → stdout JSON
opencode import <file|url> # import JSONProviders / Auth
opencode providers list # (alias: auth list)
opencode providers login [url] [-p <id>] [-m <method>]
opencode providers logoutModels
opencode models [provider]
--verbose # include cost metadata
--refresh # refresh cache from models.devAgents
opencode agent list
opencode agent create \
[--path <dir>] \
[--description "..."] \
[--mode all|primary|subagent] \
[--tools "bash,read,write,edit,list,glob,grep,webfetch,task,todowrite,todoread"] \
[-m provider/model]
opencode debug agent <name> [--tool <id>] [--params <json>]MCP Servers
opencode mcp list # list + status
opencode mcp add # interactive add
opencode mcp auth [name] # OAuth authenticate
opencode mcp auth list # list OAuth status
opencode mcp logout [name] # remove OAuth credentials
opencode mcp debug <name> # debug OAuth connectionStats
opencode stats
--days <N> # last N days (default: all time)
--tools <N> # top N tools
--models [N] # model stats (show all, or top N)
--project <str> # filter by project (empty string = current)GitHub Integration
opencode github install
opencode github run [--event <mock-event>] [--token <github_pat_...>]
opencode pr <number> # checkout PR branch then launch opencodeDatabase Tools
opencode db [query] # sqlite3 shell or run query [--format json|tsv (default: tsv)]
opencode db path # print db path
opencode db migrate # migrate JSON → SQLiteDebug / Diagnostics
opencode debug config # show resolved config
opencode debug paths # data/config/cache/state dirs
opencode debug scrap # list all known projects
opencode debug skill # list available skills
opencode debug agent <name> # agent config details
# LSP
opencode debug lsp diagnostics <file>
opencode debug lsp symbols <query>
opencode debug lsp document-symbols <uri>
# Ripgrep
opencode debug rg tree
opencode debug rg files
opencode debug rg search <pattern>
# Filesystem
opencode debug file read <path>
opencode debug file status
opencode debug file list <path>
opencode debug file search <query>
opencode debug file tree [dir]
# Snapshots
opencode debug snapshot track
opencode debug snapshot patch <hash>
opencode debug snapshot diff <hash>Lifecycle
opencode upgrade [target] # e.g. 0.1.48 or v0.1.48
-m, --method curl|npm|pnpm|bun|brew|choco|scoop
opencode uninstall
-c, --keep-config # keep config files (default: false)
-d, --keep-data # keep sessions/snapshots (default: false)
--dry-run # preview only (default: false)
-f, --force # skip confirmations (default: false)Shell Completion
opencode completion >> ~/.bashrc # bash
opencode completion >> ~/.bash_profile # macOSCommon Workflows
Run a one-shot task non-interactively:
opencode run "fix the failing tests" -m anthropic/claude-opus-4-5Continue last session non-interactively:
opencode run "add docs" --continueStart a headless server on a fixed port:
opencode serve --port 4096Attach a TUI client to a remote server:
opencode attach http://192.168.1.10:4096 -p mypasswordExport/import sessions:
opencode export > backup.json
opencode import backup.jsonList sessions, delete one:
opencode session list -n 10 --format json
opencode session delete <sessionID>Add a provider and list models:
opencode providers login -p anthropic
opencode models anthropic --verboseCreate a custom subagent:
opencode agent create --description "security reviewer" --mode subagent --tools "read,grep,glob"Check cost stats for this week:
opencode stats --days 7 --models 5Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

