Files
OpenCode Agent 01a0ef46c9 feat: terminal startup command and container tools
- Add startup_command field to ToolType model and API
- Execute startup command before interactive shell in terminal sessions
- Add tmux and ranger to OpenCode container spec
- Update Tool Workshop UI with startup_command input for terminal types
- Add backend tests for startup_command CRUD operations
- Sync specs: tool-terminal, tool-types-definition, opencode-web-server
- New spec: tool-terminal-startup-command

Quality gates: Frontend typecheck/lint passed. Backend tests blocked by environment (Python/Docker not available).

OpenSpec: terminal-startup-and-container-tools
2026-05-24 22:21:55 +00:00

1.7 KiB

Why

Terminal tools currently spawn a default shell when opening a new session, providing no way for tool authors or users to customize the initial environment or run setup commands. Additionally, the OpenCode container lacks common productivity tools (tmux, ranger) that developers expect in a modern terminal environment. These gaps limit the utility and customization of terminal-based tool instances.

What Changes

  • Add startup_command field to tool type definitions, allowing tool authors to specify a command that runs for every new terminal session
  • Execute the startup command before the interactive shell when spawning new terminal sessions via WebSocket
  • Update the OpenCode container image to install tmux and ranger for improved developer experience
  • Update the OpenCode built-in tool type to optionally set a default startup command
  • Extend the tool type API and UI to support creating and editing startup_command

Capabilities

New Capabilities

  • tool-terminal-startup-command: Terminal tool types can define a startup command executed for each new session

Modified Capabilities

  • tool-types-definition: Add startup_command field to the ToolType model and CRUD endpoints
  • tool-terminal: Terminal session spawning must execute the startup command before the interactive shell
  • opencode-web-server: OpenCode container image should include tmux and ranger

Impact

  • Backend: ToolType model, API schemas, terminal session spawning logic
  • Frontend: Tool type creation/edit forms
  • Infrastructure: OpenCode Dockerfile or container build configuration
  • Database: Migration to add startup_command column to tool_types table
  • APIs: POST/PUT /api/tool-types will accept new startup_command field