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
- Print the installed version.
opencode --version - Remove OpenCode and its related files.
opencode uninstall - Alias for provider login; choose a provider and authenticate.
opencode auth login - List configured providers and credentials.
opencode auth list - Interactively remove credentials for a configured provider.
opencode auth logout - Start the TUI in the current directory.
opencode - Continue the last session.
opencode --continue - List saved sessions.
opencode session list - Show available TUI commands and keybinds.
/help - Add or authenticate an AI provider from the TUI.
/connect - Browse available models.
/models - Start a new session.
/new - Open the session picker.
/sessions - Compact the current session.
/compact - Undo the last message or change.
/undo - Redo an undone message or change.
/redo