agentleFS
rjstonerjstone/agent-skills/skills/opencode-cli/SKILL.md

opencode-cli

Skill0 starsChanged 6 days agoMITView on GitHub

Use when running or scripting the opencode command line or TUI - opencode run in CI, sessions (export, import, continue), models and auth, mcp/plugin/service/serve commands, the shared background server vs --standalone or --server, cli.json settings, keybinds, themes, the web UI, ACP editor integration - or unsure whether an opencode command or flag is v1 or v2.

7 other projects use a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

3 rules. 0 are common, 1 is distinctive, and 2 are very specific to this project.

  • 0

    Common

    Most of the 4 edited versions we read keep these.

  • 1

    Distinctive

    This author's own choices. Worth a look.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    When they disagree, the higher source wins.

    line 26
  2. Very specific:

    Stop or start the shared server: opencode service stop|start.

    line 52
  3. Very specific:

    No cached page for it? The live Markdown of any docs page is its URL with the trailing / replaced by .md.

    line 59

“Common” is measured: kept by at least 6 in 10 of the 4 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

opencode CLI docs (v2)

Overview

opencode v2 changed the CLI, and what you remember is probably v1: v2 runs one shared background server per account (--standalone for a private one, --server <url> to pick one), sessions live under opencode session ..., and CLI/TUI settings are in cli.json (not opencode.json). Do not give opencode commands or flags from memory. Look them up first:

  1. opencode <command> --help on the installed version, when you can run it.
  2. ERRATA.md beside this file: known mistakes in the docs below.
  3. references/: the v2 CLI docs cached as Markdown.

When they disagree, the higher source wins.

Which reference

TaskRead
Starting opencode, automation, shared background service, debug paths, uninstallreferences/intro.md
A command or flag: run, session, auth, models, mcp, plugin, stats, serve, pair, service, api, acp, debug, upgradereferences/commands.md
TUI basics: context, shell, side questions, models, history, editorreferences/tui.md
cli.json: appearance, input, sessions, diffs, alerts, terminal, pluginsreferences/config.md
A keybind, or rebinding onereferences/keybinds.md
Themes: choose, system colors, create one, use one in a pluginreferences/theme.md
Signing in to providers, credential storage, env varsreferences/providers.md
Web UI access, ports, password, standalonereferences/web.md
Editor integration over ACPreferences/acp.md
Loading TUI-only pluginsreferences/plugins.md

commands.md, config.md, keybinds.md and acp.md are 380-630 lines: list their headings first (grep -n '^##' <file>), then read only the section you need.

Quick facts (checked against the references)

  • CI: opencode run --standalone --model <provider/model> "<prompt>" with the provider key as a secret env var (commands.md, top).
  • Export a session redacted: opencode session export <id> --sanitize.
  • Stop or start the shared server: opencode service stop|start.

Keeping it current

  • References are verbatim copies; never edit them. Refresh with python scripts/refresh_references.py (path relative to this skill's folder; --check reports staleness without writing; --help for the rest).
  • No cached page for it? The live Markdown of any docs page is its URL with the trailing / replaced by .md; the index is https://opencode.ai/docs/llms.txt.
  • Cite the page URL without .md (it is in references/manifest.json).
  • Found a doc mistake (the docs contradict --help or real behavior)? Add an entry to ERRATA.md with your evidence.

Common mistakes

MistakeFix
opencode export <id> (v1)opencode session export <id>
Assuming each TUI or run starts its own serverOne shared background server; --standalone for a private one in CI
Theme/keybinds in opencode.jsoncli.json (config.md)
Adding a TUI-only package to opencode.jsonIt goes in cli.json; a plugin in opencode.json loads its TUI part automatically (plugins.md)
Reading a whole 600-line referenceSearch headings, read one section

Download now (ZIP)

Does 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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.