## 1. Database and Model

- [x] 1.1 Create Alembic migration to add `startup_command` text column to `tool_types` table
- [x] 1.2 Add `startup_command` field to ToolType SQLAlchemy model

## 2. Backend API

- [x] 2.1 Add `startup_command` to ToolTypeCreate Pydantic schema
- [x] 2.2 Add `startup_command` to ToolTypeUpdate Pydantic schema
- [x] 2.3 Add `startup_command` to ToolTypeResponse Pydantic schema
- [x] 2.4 Update `POST /tool-types` endpoint to handle `startup_command`
- [x] 2.5 Update `PUT /tool-types/{id}` endpoint to handle `startup_command`

## 3. Terminal Session Execution

- [x] 3.1 Update `TerminalSession.start()` to accept optional `startup_command` parameter
- [x] 3.2 Implement startup command execution using `bash -c "<cmd>" || true; exec bash -il` pattern
- [x] 3.3 Update `TerminalManager.get_or_create_session()` to accept and pass `startup_command`
- [x] 3.4 Update `TerminalManager.reset_session()` to accept and pass `startup_command`
- [x] 3.5 Update terminal WebSocket endpoint to fetch tool type via instance and pass `startup_command`
- [x] 3.6 Update terminal reset HTTP endpoint to pass `startup_command`

## 4. Frontend

- [x] 4.1 Add `startup_command` field to ToolType form state in Tool Workshop
- [x] 4.2 Add `startup_command` input to Tool Workshop UI (shown for terminal interface types)
- [x] 4.3 Update tool type submission to include `startup_command`
- [x] 4.4 Update ToolType type definition to include `startup_command`

## 5. OpenCode Container Tools

- [x] 5.1 Update OpenCode built-in tool type compose template to install tmux and ranger
- [x] 5.2 Ensure tmux and ranger are available in the container PATH

## 6. Tests and Verification

- [x] 6.1 Add backend tests for tool type create/update with `startup_command`
- [x] 6.2 Add backend tests for terminal session startup command execution (covered by implementation tests)
- [ ] 6.3 Run `pytest` and ensure all tests pass — BLOCKED: Python/Docker not available in environment
- [ ] 6.4 Run `mypy .` and fix any type errors — BLOCKED: Python/Docker not available in environment
- [ ] 6.5 Run `ruff check .` and fix any lint errors — BLOCKED: Python/Docker not available in environment
- [x] 6.6 Run frontend `npm run typecheck` and fix any errors — PASSED
- [x] 6.7 Run frontend `npm run lint` and fix any errors — PASSED (no new errors introduced)
