From a5137127457e2ae92237f5d4c2d202e06e2da9e1 Mon Sep 17 00:00:00 2001 From: Chris Scott <99081550+chriswritescode-dev@users.noreply.github.com> Date: Fri, 6 Feb 2026 23:59:58 -0500 Subject: [PATCH] docs: comprehensive documentation updates for v2 infrastructure changes --- docs/configuration/authentication.md | 8 +-- docs/configuration/docker.md | 45 +++++++------- docs/configuration/environment.md | 58 +++++++++++++++++- docs/configuration/oauth.md | 7 +-- docs/development/contributing.md | 8 +-- docs/development/setup.md | 23 ++++---- docs/features/ai-config.md | 30 ++-------- docs/features/chat.md | 11 ---- docs/features/files.md | 26 ++++---- docs/features/git.md | 15 ----- docs/features/mobile.md | 17 +++--- docs/features/overview.md | 9 ++- docs/features/stt.md | 88 ++++++++++++++++++++++++++++ docs/getting-started/first-run.md | 2 +- docs/getting-started/installation.md | 13 ++-- docs/getting-started/quickstart.md | 5 +- docs/index.md | 19 +----- mkdocs.yml | 1 + 18 files changed, 226 insertions(+), 159 deletions(-) create mode 100644 docs/features/stt.md diff --git a/docs/configuration/authentication.md b/docs/configuration/authentication.md index fd1e48cb..580be066 100644 --- a/docs/configuration/authentication.md +++ b/docs/configuration/authentication.md @@ -78,11 +78,7 @@ AUTH_SECRET=your-generated-secret ### Session Duration -Sessions last until: - -- User logs out -- Browser is closed (unless "Remember me") -- Session expires (configurable) +Sessions expire after 7 days. A new session is created on each login. ### Secure Cookies @@ -149,7 +145,7 @@ PASSKEY_ORIGIN=http://192.168.1.244:5003 ### Adding a Passkey 1. Log in with password -2. Go to **Settings > Security** +2. Go to **Settings > Account** 3. Click **Add Passkey** 4. Follow browser/device prompts 5. Name your passkey diff --git a/docs/configuration/docker.md b/docs/configuration/docker.md index d99d9510..af038aad 100644 --- a/docs/configuration/docker.md +++ b/docs/configuration/docker.md @@ -15,11 +15,11 @@ docker-compose up -d Default configuration: ```yaml -version: '3.8' - services: - opencode-manager: - build: . + app: + build: + context: . + dockerfile: Dockerfile container_name: opencode-manager ports: - "5003:5003" # OpenCode Manager @@ -28,20 +28,23 @@ services: - "5102:5102" # Dev server 3 - "5103:5103" # Dev server 4 volumes: - - ./workspace:/workspace - - ./data:/app/data - - opencode-cache:/root/.opencode + - opencode-workspace:/workspace + - opencode-data:/app/data environment: - NODE_ENV=production restart: unless-stopped healthcheck: - test: ["CMD", "curl", "-f", "http://localhost:5003/health"] + test: ["CMD", "curl", "-f", "http://localhost:5003/api/health"] interval: 30s - timeout: 10s + timeout: 3s retries: 3 + start_period: 40s volumes: - opencode-cache: + opencode-workspace: + driver: local + opencode-data: + driver: local ``` ## Port Configuration @@ -108,10 +111,10 @@ Repository storage: ```yaml volumes: - - ./workspace:/workspace + - opencode-workspace:/workspace ``` -All cloned repositories are stored here. The directory is created automatically. +All cloned repositories are stored here. Uses a named volume for data persistence across container recreations. ### Data @@ -119,7 +122,7 @@ Database and configuration: ```yaml volumes: - - ./data:/app/data + - opencode-data:/app/data ``` Contains: @@ -127,16 +130,7 @@ Contains: - User settings - Session data -### OpenCode Cache - -OpenCode runtime cache: - -```yaml -volumes: - - opencode-cache:/root/.opencode -``` - -Using a named volume for better performance. +Uses a named volume for data persistence. ## Environment Variables @@ -174,10 +168,11 @@ The container includes health checks: ```yaml healthcheck: - test: ["CMD", "curl", "-f", "http://localhost:5003/health"] + test: ["CMD", "curl", "-f", "http://localhost:5003/api/health"] interval: 30s - timeout: 10s + timeout: 3s retries: 3 + start_period: 40s ``` Check health status: diff --git a/docs/configuration/environment.md b/docs/configuration/environment.md index 7d48b0e5..d16b5fee 100644 --- a/docs/configuration/environment.md +++ b/docs/configuration/environment.md @@ -11,8 +11,7 @@ Complete reference for all configuration options. | `ADMIN_PASSWORD` | Pre-configured admin password | - | | `ADMIN_PASSWORD_RESET` | Set to `true` to reset admin password | `false` | | `AUTH_TRUSTED_ORIGINS` | Comma-separated list of trusted origins (frontend + backend) | `http://localhost:5173,http://localhost:5003` | -| `AUTH_SECURE_COOKIES` | Use secure cookies (HTTPS only) | `true` in prod | -| `AUTH_SECURE_COOKIES` | Use secure cookies (HTTPS only) | `true` in prod | +| `AUTH_SECURE_COOKIES` | Use secure cookies (HTTPS only) | `true` in prod, `false` in dev | ## OAuth Providers @@ -71,12 +70,65 @@ When configured, users can enable push notifications in Settings → Notificatio | Variable | Description | Default | |----------|-------------|---------| | `PORT` | Server port | `5003` | +| `HOST` | Server bind address | `0.0.0.0` | | `NODE_ENV` | Environment (`development` or `production`) | `development` | -| `WORKSPACE_PATH` | Path to workspace directory | `/workspace` | +| `CORS_ORIGIN` | CORS origin for frontend | `http://localhost:5173` | +| `LOG_LEVEL` | Logging level | `info` | +| `DEBUG` | Enable debug logging | `false` | + +## Database + +| Variable | Description | Default | +|----------|-------------|---------| +| `DATABASE_PATH` | Path to SQLite database file | `./data/opencode.db` | + +## Workspace + +| Variable | Description | Default | +|----------|-------------|---------| +| `WORKSPACE_PATH` | Path to workspace directory | `./workspace` (Docker: `/workspace`) | + +## OpenCode Server + +| Variable | Description | Default | +|----------|-------------|---------| +| `OPENCODE_SERVER_PORT` | Port for the OpenCode CLI server | `5551` | +| `OPENCODE_HOST` | OpenCode server bind address | `127.0.0.1` | + +## Timeouts + +| Variable | Description | Default | +|----------|-------------|---------| +| `PROCESS_START_WAIT_MS` | Wait time for OpenCode process to start | `2000` | +| `PROCESS_VERIFY_WAIT_MS` | Wait time for process health verification | `1000` | +| `HEALTH_CHECK_INTERVAL_MS` | Health check polling interval | `5000` | +| `HEALTH_CHECK_TIMEOUT_MS` | Health check timeout | `30000` | + +## File Limits + +| Variable | Description | Default | +|----------|-------------|---------| +| `MAX_FILE_SIZE_MB` | Maximum file size for reading/preview | `50` | +| `MAX_UPLOAD_SIZE_MB` | Maximum upload file size | `50` | + +## Frontend (Vite) + +| Variable | Description | Default | +|----------|-------------|---------| +| `VITE_API_URL` | Backend API URL for frontend | `http://localhost:5003` | +| `VITE_SERVER_PORT` | Backend port hint for frontend | `5003` | +| `VITE_OPENCODE_PORT` | OpenCode server port hint | `5551` | +| `VITE_MAX_FILE_SIZE_MB` | File size limit for frontend | `50` | +| `VITE_MAX_UPLOAD_SIZE_MB` | Upload size limit for frontend | `50` | ## Example .env File ```bash +# Server +PORT=5003 +HOST=0.0.0.0 +NODE_ENV=development + # Required for production AUTH_SECRET=generate-with-openssl-rand-base64-32 diff --git a/docs/configuration/oauth.md b/docs/configuration/oauth.md index a34b8768..1fff06dd 100644 --- a/docs/configuration/oauth.md +++ b/docs/configuration/oauth.md @@ -109,12 +109,7 @@ On first OAuth login: ### Linking Accounts -If you have an existing password account: - -1. Log in with password -2. Go to **Settings > Connected Accounts** -3. Click **Connect** for a provider -4. Authorize the connection +If you have an existing password account, logging in with an OAuth provider that uses the same email will link the accounts automatically. ## Production Considerations diff --git a/docs/development/contributing.md b/docs/development/contributing.md index 7e66b797..55e8b172 100644 --- a/docs/development/contributing.md +++ b/docs/development/contributing.md @@ -115,14 +115,14 @@ refactor: extract git service from routes ### Writing Tests ```typescript -import { expect, test, describe, beforeEach } from 'bun:test' +import { describe, it, expect, beforeEach } from 'vitest' describe('featureName', () => { beforeEach(() => { // Setup }) - test('should do something', async () => { + it('should do something', async () => { const result = await doSomething() expect(result).toBe(expected) }) @@ -142,10 +142,10 @@ describe('featureName', () => { pnpm test # With coverage -cd backend && bun test --coverage +cd backend && vitest --coverage # Single file -cd backend && bun test path/to/test.ts +cd backend && vitest path/to/test.ts ``` ## Architecture Decisions diff --git a/docs/development/setup.md b/docs/development/setup.md index fe75821b..c58033ec 100644 --- a/docs/development/setup.md +++ b/docs/development/setup.md @@ -51,7 +51,9 @@ opencode-manager/ │ │ └── lib/ # Utilities │ └── public/ # Static assets ├── shared/ # Shared types and utilities -└── docker/ # Docker configuration +├── scripts/ # Build and Docker entrypoint scripts +├── Dockerfile # Docker image definition +└── docker-compose.yml # Docker Compose configuration ``` ## Available Scripts @@ -88,28 +90,27 @@ pnpm typecheck # TypeScript check ## Database -Using Better SQLite3 with Drizzle ORM. +Using Bun's built-in SQLite (`bun:sqlite`) with hand-written migrations. ### Location -- **Development**: `./backend/data/opencode.db` +- **Development**: `./data/opencode.db` - **Docker**: `/app/data/opencode.db` ### Schema Changes -1. Edit schema in `backend/src/db/schema.ts` -2. Generate migration: `cd backend && bun run db:generate` -3. Apply migration: `cd backend && bun run db:migrate` +1. Edit migrations in `backend/src/db/migrations.ts` +2. Migrations run automatically on startup ### Inspection ```bash -sqlite3 ./backend/data/opencode.db +sqlite3 ./data/opencode.db # Useful commands .tables # List tables -.schema users # Show table schema -SELECT * FROM users; # View data +.schema user # Show table schema +SELECT * FROM user; # View data ``` ## Testing @@ -130,11 +131,11 @@ cd backend && bun test --coverage ### Writing Tests ```typescript -import { expect, test, describe } from 'bun:test' +import { describe, it, expect } from 'vitest' import { repoService } from '../src/services/repo' describe('repoService', () => { - test('listAll returns repositories', async () => { + it('listAll returns repositories', async () => { const repos = await repoService.listAll() expect(Array.isArray(repos)).toBe(true) }) diff --git a/docs/features/ai-config.md b/docs/features/ai-config.md index ed14596a..d4aa0de9 100644 --- a/docs/features/ai-config.md +++ b/docs/features/ai-config.md @@ -6,19 +6,9 @@ Configure AI models, providers, and custom agents. Browse and select from available AI models: -1. Go to **Settings > Models** -2. Browse models by provider -3. Filter by capability (chat, code, vision) -4. Click a model to set as default - -### Model Capabilities - -| Capability | Description | -|------------|-------------| -| Chat | General conversation | -| Code | Code generation and analysis | -| Vision | Image understanding | -| Function Calling | Tool use support | +1. Click the **model selector** in the chat interface +2. Browse available models +3. Click a model to set it for the current session ### Changing Models Mid-Session @@ -57,7 +47,7 @@ For providers that support OAuth (Anthropic, GitHub Copilot): After adding credentials: -1. Go to **Settings > Models** +1. Open a chat session and click the model selector 2. Models from that provider should appear 3. Select a model and try sending a message @@ -134,14 +124,6 @@ When context is running low: 3. Be more concise in prompts 4. Remove unnecessary file mentions -### Context Limits by Model +### Context Limits -Different models have different context limits: - -| Model | Context Limit | -|-------|---------------| -| GPT-4 | 8K - 128K tokens | -| Claude 3 | 200K tokens | -| GPT-3.5 | 4K - 16K tokens | - -Check your model's documentation for exact limits. +Different models have different context limits. Check your provider's documentation for exact limits per model. diff --git a/docs/features/chat.md b/docs/features/chat.md index ee345f17..08bc3d78 100644 --- a/docs/features/chat.md +++ b/docs/features/chat.md @@ -29,10 +29,7 @@ Type `/` to see available commands: |---------|-------------| | `/help` | Show available commands | | `/new` | Start a new session | -| `/models` | List available AI models | -| `/export` | Export session history | | `/compact` | Compact session context | -| `/clear` | Clear current session | ### Custom Commands @@ -53,14 +50,6 @@ template: | Use with `/review` in chat. -#### Template Variables - -| Variable | Description | -|----------|-------------| -| `{{selection}}` | Currently selected text | -| `{{file}}` | Current file path | -| `{{clipboard}}` | Clipboard contents | - ## File Mentions Reference files in your prompts with `@`: diff --git a/docs/features/files.md b/docs/features/files.md index 8a774ee3..ebeb9f3f 100644 --- a/docs/features/files.md +++ b/docs/features/files.md @@ -52,30 +52,26 @@ Syntax highlighting is provided for common languages including: ### Create File -1. Right-click in the file browser -2. Select **New File** -3. Enter filename with extension -4. File is created and opened for editing +1. Click the **New File** button in the file browser toolbar +2. Enter filename with extension +3. File is created and opened for editing ### Create Folder -1. Right-click in the file browser -2. Select **New Folder** -3. Enter folder name -4. Folder is created in current directory +1. Click the **New Folder** button in the file browser toolbar +2. Enter folder name +3. Folder is created in current directory ### Rename -1. Right-click a file or folder -2. Select **Rename** -3. Enter new name -4. Press Enter to confirm +1. Click the **rename** action on a file or folder +2. Enter new name +3. Press Enter to confirm ### Delete -1. Right-click a file or folder -2. Select **Delete** -3. Confirm deletion +1. Click the **delete** action on a file or folder +2. Confirm deletion !!! warning Deletion is permanent and cannot be undone through the UI. Use git to recover deleted files if needed. diff --git a/docs/features/git.md b/docs/features/git.md index 75db6a2b..dec6d5c8 100644 --- a/docs/features/git.md +++ b/docs/features/git.md @@ -82,21 +82,6 @@ View file changes with a unified diff format: ![Diff Viewer](../images/git/git-diffview.png) -## Pull Requests - -Create and push PRs directly from the UI: - -1. Make your changes and commit them -2. Open **Source Control > Branches** -3. Click **Create PR** -4. Fill in: - - Title - - Description - - Target branch (usually `main`) -5. Click **Create** - -The PR is created on GitHub and you'll receive a link to view it. - ## Repository Actions ### Pull diff --git a/docs/features/mobile.md b/docs/features/mobile.md index c8ae02e5..5ab3890d 100644 --- a/docs/features/mobile.md +++ b/docs/features/mobile.md @@ -46,15 +46,15 @@ The UI is optimized for mobile devices: ## PWA Features -### Offline Support +### App Shell Caching -Limited offline functionality: +Static assets are cached for faster loads: -- View cached sessions -- Browse cached files -- Queue messages for later +- App shell (HTML, CSS, JS) +- Icons and images +- Fonts and static assets -Full functionality requires network connection. +Full functionality requires network connection to the backend. ### Background Updates @@ -112,9 +112,8 @@ Swipe from the left edge to go back: ### Swipe Requirements -- Start from the left edge (first 20px) -- Swipe at least 50px right -- Swipe quickly (within 300ms) +- Start from the left edge (first 30px) +- Swipe at least 80px right ## Touch Optimizations diff --git a/docs/features/overview.md b/docs/features/overview.md index 821eecc6..2820183d 100644 --- a/docs/features/overview.md +++ b/docs/features/overview.md @@ -10,7 +10,6 @@ OpenCode Manager provides a comprehensive web interface for managing OpenCode AI - **Git Worktrees** - Work on multiple branches simultaneously - **Source Control Panel** - View changes, commits, and branches in a unified interface - **Diff Viewer** - Unified diffs with line numbers and change counts -- **Push PRs** - Create and push pull requests directly from the UI [Learn more →](git.md) @@ -60,6 +59,14 @@ OpenCode Manager provides a comprehensive web interface for managing OpenCode AI [Learn more →](tts.md) +### Speech-to-Text + +- **Browser STT** - Built-in Web Speech API support +- **External STT** - Connect to OpenAI-compatible Whisper endpoints +- **Voice Input** - Dictate messages with microphone button + +[Learn more →](stt.md) + ### Mobile & PWA - **Mobile-First Design** - Responsive UI optimized for mobile diff --git a/docs/features/stt.md b/docs/features/stt.md new file mode 100644 index 00000000..566e58c5 --- /dev/null +++ b/docs/features/stt.md @@ -0,0 +1,88 @@ +# Speech-to-Text + +Dictate messages to AI agents using voice input. + +## Overview + +OpenCode Manager supports two STT providers: + +1. **Built-in Browser** - Uses your browser's Web Speech API +2. **External API** - OpenAI-compatible STT endpoints (Whisper) + +## Built-in Browser STT + +Uses your browser's built-in speech recognition via the Web Speech API. + +### Advantages + +- No API key required +- Works without server communication +- Free to use +- Interim results while speaking + +### Limitations + +- Voice recognition quality varies by browser/OS +- Not supported in all browsers +- Language support depends on browser + +### Setup + +1. Go to **Settings > Voice** +2. Under **Speech-to-Text**, select **Built-in Browser** provider +3. Optionally configure language +4. Click the microphone button in the chat input to test + +## External API STT + +Connect to OpenAI-compatible STT endpoints for higher accuracy transcription. + +### Advantages + +- Higher accuracy transcription +- Consistent across devices +- Supports many languages + +### Limitations + +- Requires API key and endpoint +- Requires network connection +- Server-side processing + +### Setup + +1. Go to **Settings > Voice** +2. Under **Speech-to-Text**, select **External API** provider +3. Enter the **STT Server URL**: + - OpenAI: `https://api.openai.com` +4. Enter your **API Key** +5. Wait for model discovery +6. Choose a model (e.g., `whisper-1`) +7. Optionally set language + +### Compatible Services + +Any OpenAI-compatible transcription API works: + +- OpenAI Whisper +- Azure OpenAI +- Self-hosted Whisper servers +- Local STT servers with OpenAI-compatible API + +## Using Voice Input + +### Recording + +1. Click the **microphone** button in the chat input +2. Speak your message +3. Click the **stop** button when finished +4. Your speech is transcribed into the input field +5. Review and send + +### Recording Overlay + +While recording, a visual overlay indicates active recording status. + +### Aborting + +Click the **cancel** button during recording to discard without transcribing. diff --git a/docs/getting-started/first-run.md b/docs/getting-started/first-run.md index e0033455..92fc76bd 100644 --- a/docs/getting-started/first-run.md +++ b/docs/getting-started/first-run.md @@ -47,7 +47,7 @@ When these are set: After initial setup, you can add passkey authentication for passwordless login: -1. Go to **Settings > Security** +1. Go to **Settings > Account** 2. Click **Add Passkey** 3. Follow your browser/device prompts 4. Name your passkey (e.g., "MacBook Touch ID") diff --git a/docs/getting-started/installation.md b/docs/getting-started/installation.md index dca70fa5..82449eeb 100644 --- a/docs/getting-started/installation.md +++ b/docs/getting-started/installation.md @@ -45,13 +45,12 @@ docker-compose restart docker exec -it opencode-manager sh ``` -### Volume Mounts +### Volumes -| Path | Purpose | -|------|---------| -| `./workspace` | Repository storage | -| `./data` | Database and config | -| `opencode-cache` | OpenCode cache | +| Volume | Container Path | Purpose | +|--------|---------------|---------| +| `opencode-workspace` | `/workspace` | Repository storage | +| `opencode-data` | `/app/data` | Database and config | ## Local Development @@ -61,7 +60,7 @@ For contributors who want to develop locally instead of using Docker. - [pnpm](https://pnpm.io/installation) - Package manager (required for workspaces) - [Bun](https://bun.sh) - Backend runtime -- [OpenCode TUI](https://opencode.ai) - `npm install -g @opencode/tui` +- [OpenCode TUI](https://opencode.ai) - `curl -fsSL https://opencode.ai/install | bash` - [Node.js 24+](https://nodejs.org/en/about/previous-releases) ### Setup diff --git a/docs/getting-started/quickstart.md b/docs/getting-started/quickstart.md index 24af5710..1ebccef0 100644 --- a/docs/getting-started/quickstart.md +++ b/docs/getting-started/quickstart.md @@ -71,7 +71,6 @@ Before chatting, you need to configure at least one AI provider: |---------|-------------| | `/help` | Show available commands | | `/new` | Start a new session | -| `/models` | List available models | | `/compact` | Reduce session context | ### File Mentions @@ -98,7 +97,5 @@ Now that you're set up, explore more features: |----------|--------| | `Enter` | Send message | | `Shift+Enter` | New line | -| `Ctrl+/` | Toggle sidebar | -| `Ctrl+K` | Command palette | -Customize shortcuts in Settings > Keyboard Shortcuts. +The app uses a configurable leader key system (`Cmd+O` on Mac, `Ctrl+O` on other platforms) for additional shortcuts. Customize in Settings > Keyboard Shortcuts. diff --git a/docs/index.md b/docs/index.md index 2a2cbcef..d71ccd8c 100644 --- a/docs/index.md +++ b/docs/index.md @@ -30,26 +30,11 @@ OpenCode Manager provides a web-based interface for OpenCode AI agents, allowing - **Multi-Repository Support** - Clone and manage multiple git repos with private repo support - **Git Integration** - View diffs, manage branches, create PRs directly from the UI - **Real-time Chat** - Stream responses with file mentions and custom slash commands -- **Mobile-First PWA** - Install as an app on any device with offline support +- **Mobile-First PWA** - Install as an app on any device with push notifications - **Push Notifications** - Get background alerts for agent events when app is closed - **AI Configuration** - Configure models, providers, OAuth, and custom agents -- **MCP Servers** - Add local or remote MCP servers with pre-built templates +- **MCP Servers** - Add local or remote MCP servers with OAuth support -## System Requirements - -### Docker (Recommended) - -- Docker Engine 20.10+ -- Docker Compose v2+ -- 2GB RAM minimum -- 5GB disk space - -### Local Development - -- [pnpm](https://pnpm.io) - Package manager -- [Bun](https://bun.sh) - Backend runtime -- [OpenCode TUI](https://opencode.ai) - `npm i -g @opencode/tui` -- [Node.js 24+](https://nodejs.org/en/about/previous-releases) ## Next Steps diff --git a/mkdocs.yml b/mkdocs.yml index 0a094927..f5bc8b80 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -45,6 +45,7 @@ nav: - AI Configuration: features/ai-config.md - MCP Servers: features/mcp.md - Text-to-Speech: features/tts.md + - Speech-to-Text: features/stt.md - Push Notifications: features/notifications.md - Mobile & PWA: features/mobile.md - Configuration: