01a0ef46c9
- 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
1.7 KiB
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_commandfield 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
tmuxandrangerfor 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: Addstartup_commandfield to the ToolType model and CRUD endpointstool-terminal: Terminal session spawning must execute the startup command before the interactive shellopencode-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_commandcolumn to tool_types table - APIs:
POST/PUT /api/tool-typeswill accept newstartup_commandfield