Problem
The GET /opencode/command endpoint currently only returns custom/user-defined commands (source: command, mcp, skill). Built-in TUI commands like /compact, /clear, /undo, etc. are hardcoded in the OpenCode TUI client and not discoverable via any API endpoint.
This means Gigacode has no way to expose or list the full set of available commands to users or frontends.
Built-in TUI commands that need coverage
These are the commands defined in OpenCode's EventTuiCommandExecute enum, currently only executable via POST /tui/execute-command:
session.compact — compact/summarize context
session.list — list sessions
session.new — create new session
session.share — share session
session.interrupt — interrupt current generation
prompt.clear — clear prompt input
prompt.submit — submit prompt
agent.cycle — cycle between agents
session.page.up / session.page.down — scroll page
session.line.up / session.line.down — scroll line
session.half.page.up / session.half.page.down — scroll half page
session.first / session.last — jump to first/last
Current behavior
GET /opencode/command proxies to native OpenCode (returns custom commands like /init, /review, skills) or returns [] if no proxy is configured
POST /tui/execute-command accepts built-in command strings but there's no listing endpoint
- No single endpoint returns the full set of available commands (custom + built-in)
Expected behavior
The GET /opencode/command endpoint (or a supplementary mechanism) should return all available commands, including built-in TUI commands, so that:
- Frontends can render a complete command palette
- Users can discover all available commands
- Gigacode doesn't depend on the native OpenCode proxy just to list built-in commands
Relevant code
oc_command_list handler: server/packages/sandbox-agent/src/opencode_compat.rs
oc_tui_execute_command handler: server/packages/sandbox-agent/src/opencode_compat.rs
- OpenCode OpenAPI spec:
resources/agent-schemas/artifacts/openapi/opencode.json
- Command stub spec:
research/specs/command-shell-exec.md
Problem
The
GET /opencode/commandendpoint currently only returns custom/user-defined commands (source:command,mcp,skill). Built-in TUI commands like/compact,/clear,/undo, etc. are hardcoded in the OpenCode TUI client and not discoverable via any API endpoint.This means Gigacode has no way to expose or list the full set of available commands to users or frontends.
Built-in TUI commands that need coverage
These are the commands defined in OpenCode's
EventTuiCommandExecuteenum, currently only executable viaPOST /tui/execute-command:session.compact— compact/summarize contextsession.list— list sessionssession.new— create new sessionsession.share— share sessionsession.interrupt— interrupt current generationprompt.clear— clear prompt inputprompt.submit— submit promptagent.cycle— cycle between agentssession.page.up/session.page.down— scroll pagesession.line.up/session.line.down— scroll linesession.half.page.up/session.half.page.down— scroll half pagesession.first/session.last— jump to first/lastCurrent behavior
GET /opencode/commandproxies to native OpenCode (returns custom commands like/init,/review, skills) or returns[]if no proxy is configuredPOST /tui/execute-commandaccepts built-in command strings but there's no listing endpointExpected behavior
The
GET /opencode/commandendpoint (or a supplementary mechanism) should return all available commands, including built-in TUI commands, so that:Relevant code
oc_command_listhandler:server/packages/sandbox-agent/src/opencode_compat.rsoc_tui_execute_commandhandler:server/packages/sandbox-agent/src/opencode_compat.rsresources/agent-schemas/artifacts/openapi/opencode.jsonresearch/specs/command-shell-exec.md