Skip to content

OpenCode cheatsheet

Binary-backed rows were checked against installed opencode v1.4.7 on 2026-08-18; docs-only rows reflect current OpenCode v1 documentation and may describe features added after that binary. The OpenCode GitHub repository is included as a second primary source. The config examples target v1, not the separate opencode2 beta.

Use the search box to find a command, flag, config key, or workflow; the full reference also works with JavaScript disabled.

Command drill

16 verified OpenCode commands. Read the task, type the command, press Enter. Every answer is on this page's tables - this drill only asks what the verified data already states.

Answer key - all 16 commands
  1. Print the installed version. opencode --version
  2. Remove OpenCode and its related files. opencode uninstall
  3. Alias for provider login; choose a provider and authenticate. opencode auth login
  4. List configured providers and credentials. opencode auth list
  5. Interactively remove credentials for a configured provider. opencode auth logout
  6. Start the TUI in the current directory. opencode
  7. Continue the last session. opencode --continue
  8. List saved sessions. opencode session list
  9. Show available TUI commands and keybinds. /help
  10. Add or authenticate an AI provider from the TUI. /connect
  11. Browse available models. /models
  12. Start a new session. /new
  13. Open the session picker. /sessions
  14. Compact the current session. /compact
  15. Undo the last message or change. /undo
  16. Redo an undone message or change. /redo