Files
opencode-primer/docs/reference/slash-commands.md
T
Wesam Abousaid 73e9274bac docs(reference): add CLI, slash-commands, permissions, FAQ, changelog, further-reading
Six reference pages, each a single-purpose cheatsheet:

- cli.md: full CLI surface (21 commands + global flags + experimental
  env vars) sourced from packages/web/src/content/docs/cli.mdx
- slash-commands.md: every built-in TUI slash command verified against
  packages/web/src/content/docs/tui.mdx
- permissions.md: all 17 permission keys verified against PermissionConfig
  in the JSON schema (read, edit, bash, glob, grep, list, task, todowrite,
  question, external_directory, repo_clone, repo_overview, webfetch,
  websearch, lsp, skill, doom_loop)
- faq.md: covers free-vs-paid, OpenCode vs Claude Code, offline, model
  picks (multi-provider, not Anthropic-only), config locations, sharing,
  privacy, migration, troubleshooting
- changelog.md: notable releases through v1.15.4 (verified via GitHub
  releases API, published 2026-05-17T17:44Z)
- further-reading.md: curated external resources — only links that
  resolve (link-checked at commit time)
2026-05-18 19:59:40 +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.