Files
opencode-primer/docs/reference/slash-commands.md
T
Wesam Abousaid a3f328c043 docs: refresh for OpenCode v1.17.13, add Go coverage, and rebrand
- Bump every version pin, pricing table, and model ID to the verified
  2026-07-05 state (v1.17.13): Claude Fable 5 / Sonnet 5 on Zen, new
  free tier, deprecation sunset table, v1.17.x changelog section
- Cover gaps: OpenCode Go vs Zen billing, Anthropic subscription-login
  removal (PR #18186), MCP resources, --mini mode, --auto flag, yolo mode
- Fix correctness bugs: command-template !`cmd` syntax in docs and
  .opencode/commands, protect-secrets regex missing 'cat .env', dual
  plugin exports, quickstart PATH fix, Playwright MCP flags, ctrl+d
  keybind conflict, agent/command required-field claims
- Fix links: cursor.com, windsurf.com, platform.claude.com,
  code.claude.com, opencode.ai/discord, Vercel Grep announcement
- Rebrand: banner (Images/banner.svg), 1280x640 social preview asset,
  hero redesign with star CTA, ecosystem stats, private vulnerability
  reporting channel, CI-matching local checks, MD060 lint opt-out
2026-07-05 14:11:51 +02:00

1.8 KiB

Slash Commands Reference

Every slash command OpenCode ships in the TUI. Aliases are noted in parentheses.

Session

Command Aliases What it does
/new /clear Start a new session
/sessions /resume, /continue List and switch between sessions
/compact /summarize Compact the current session to free up context
/share — Generate a public link (opncd.ai/s/<id>); also configurable via share in opencode.json (manual | auto | disabled)
/unshare — Revoke the public link
/export — Export the conversation to Markdown

Provider & model

Command What it does
/connect Add a provider — interactive picker
/models Browse and switch models

Customization

Command What it does
/themes Switch theme — interactive picker
/editor Open $EDITOR to compose a long prompt
/details Toggle visibility of tool execution details
/thinking Toggle visibility of thinking/reasoning blocks

Repo & docs

Command What it does
/init Guided generation of AGENTS.md
/help Show the help dialog

Edits

Command What it does
/undo Undo the last message
/redo Redo a previously undone message

Exit

Command Aliases What it does
/exit /quit, /q Exit OpenCode

Custom slash commands

Any markdown file in .opencode/commands/<name>.md (or ~/.config/opencode/commands/) creates a /<name> slash command. See ../commands.md for the file format.

📚 Source: opencode.ai/docs/tui. Built-in command set may evolve — check the docs for the current set.


Last reviewed: 2026-07-05.