mirror of
https://github.com/chriswritescode-dev/opencode-manager.git
synced 2026-12-05 20:34:18 +01:00
Add comprehensive documentation and download feature (#83)
* fix: markdown files now default to rendered view and render properly - Add .md and .mdx MIME type support in backend (files.ts, defaults.ts) - Add key props to FilePreview components to force proper remounting when switching files - Fix markdown file detection with case-insensitive extension check - Reset markdownPreview state when file changes to ensure correct default view - Add onContentLoaded callback to VirtualizedTextView for reactive content updates - Add fullContent state to properly handle large markdown file rendering - Add error handling for async content loading to prevent blank screens - Reduce loading timeout from 50ms to 0ms for more responsive loading Fixes issues where: - Markdown files opened in raw view instead of rendered view - Large markdown files (12k+ lines) showed blank after loading completed - State persisted incorrectly when switching between different file types * Add directory download feature with ZIP archive support * Improve voice recording UX with loading states and better transcript handling * Fix auth config for prod/dev ports and add documentation Update AUTH_TRUSTED_ORIGINS and PASSKEY_ORIGIN to use backend port 5003 (frontend uses 5173 in dev). Add comprehensive auth documentation covering secrets, trusted origins, admin reset, and passkeys. Update README and add mkdocs config. * Remove roadmap section from README
This commit is contained in:
1 parent
358abbf20e
commit
da6cad8b3a
51 files changed
+4276
-353
No files matched your search
@@ -0,0 +1,147 @@
|
||||
# AI Configuration
|
||||
|
||||
Configure AI models, providers, and custom agents.
|
||||
|
||||
## Model Selection
|
||||
|
||||
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 |
|
||||
|
||||
### Changing Models Mid-Session
|
||||
|
||||
You can switch models during a chat session:
|
||||
|
||||
1. Click the model name in the chat header
|
||||
2. Select a different model
|
||||
3. Continue chatting with the new model
|
||||
|
||||
Context is preserved when switching models.
|
||||
|
||||
## Provider Credentials
|
||||
|
||||
Configure API keys or OAuth for AI providers.
|
||||
|
||||
### API Key Method
|
||||
|
||||
1. Go to **Settings > Provider Credentials**
|
||||
2. Select a provider (OpenAI, Anthropic, etc.)
|
||||
3. Enter your API key
|
||||
4. Click **Save**
|
||||
|
||||
### OAuth Method
|
||||
|
||||
For providers that support OAuth (Anthropic, GitHub Copilot):
|
||||
|
||||
1. Go to **Settings > Provider Credentials**
|
||||
2. Select a provider with the OAuth badge
|
||||
3. Click **Add OAuth**
|
||||
4. Choose authorization method:
|
||||
- **Open Authorization Page** - Opens browser for sign-in
|
||||
- **Use Authorization Code** - Provides code for manual entry
|
||||
5. Complete the authorization flow
|
||||
|
||||
### Testing Credentials
|
||||
|
||||
After adding credentials:
|
||||
|
||||
1. Go to **Settings > Models**
|
||||
2. Models from that provider should appear
|
||||
3. Select a model and try sending a message
|
||||
|
||||
If models don't appear, verify your API key and check for errors.
|
||||
|
||||
## Custom Agents
|
||||
|
||||
Create specialized AI agents with custom configurations.
|
||||
|
||||
### Creating an Agent
|
||||
|
||||
1. Go to **Settings > Agents**
|
||||
2. Click **Create Agent**
|
||||
3. Configure:
|
||||
- **Name** - Display name for the agent
|
||||
- **Description** - What this agent does
|
||||
- **System Prompt** - Instructions for the AI
|
||||
- **Default Model** - Model to use
|
||||
- **Allowed Tools** - Which MCP tools it can access
|
||||
|
||||
4. Click **Save**
|
||||
|
||||
### System Prompt Tips
|
||||
|
||||
Write effective system prompts:
|
||||
|
||||
```
|
||||
You are a code review expert specializing in TypeScript and React.
|
||||
|
||||
When reviewing code:
|
||||
1. Check for type safety issues
|
||||
2. Look for potential bugs
|
||||
3. Suggest performance improvements
|
||||
4. Ensure consistent code style
|
||||
|
||||
Be concise but thorough. Prioritize issues by severity.
|
||||
```
|
||||
|
||||
### Tool Permissions
|
||||
|
||||
Control which MCP tools an agent can use:
|
||||
|
||||
- **All Tools** - Access to everything
|
||||
- **Selected Tools** - Only specific tools
|
||||
- **No Tools** - Pure conversation, no tool access
|
||||
|
||||
This is useful for:
|
||||
|
||||
- Security-focused agents that shouldn't modify files
|
||||
- Research agents that only need read access
|
||||
- Specialized agents for specific tasks
|
||||
|
||||
### Using Custom Agents
|
||||
|
||||
1. Start a new session
|
||||
2. Click the agent selector
|
||||
3. Choose your custom agent
|
||||
4. Chat with the specialized agent
|
||||
|
||||
## Context Usage
|
||||
|
||||
Monitor token usage with the context indicator:
|
||||
|
||||
- Progress bar shows current usage
|
||||
- Updates as conversation grows
|
||||
- Warning when approaching limits
|
||||
|
||||
### Managing Context
|
||||
|
||||
When context is running low:
|
||||
|
||||
1. Use `/compact` to summarize history
|
||||
2. Start a new session with `/new`
|
||||
3. Be more concise in prompts
|
||||
4. Remove unnecessary file mentions
|
||||
|
||||
### Context Limits by Model
|
||||
|
||||
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.
|
||||
@@ -0,0 +1,199 @@
|
||||
# Chat & Sessions
|
||||
|
||||
Real-time chat interface for interacting with AI agents.
|
||||
|
||||
## Starting a Session
|
||||
|
||||
1. Select a repository from the sidebar
|
||||
2. Click **New Session** or type `/new`
|
||||
3. Type your message in the input field
|
||||
4. Press **Enter** to send
|
||||
|
||||
Each session maintains its own conversation history and context.
|
||||
|
||||
## Real-time Streaming
|
||||
|
||||
Messages stream in real-time using Server-Sent Events (SSE):
|
||||
|
||||
- See responses as they're generated
|
||||
- No waiting for complete responses
|
||||
- Can interrupt generation if needed
|
||||
|
||||
## Slash Commands
|
||||
|
||||
Type `/` to see available commands:
|
||||
|
||||
### Built-in Commands
|
||||
|
||||
| Command | Description |
|
||||
|---------|-------------|
|
||||
| `/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
|
||||
|
||||
Create your own commands in **Settings > Custom Commands**:
|
||||
|
||||
```yaml
|
||||
name: review
|
||||
description: Request a code review
|
||||
template: |
|
||||
Please review the following code for:
|
||||
- Security vulnerabilities
|
||||
- Performance issues
|
||||
- Best practices
|
||||
- Code style
|
||||
|
||||
{{selection}}
|
||||
```
|
||||
|
||||
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 `@`:
|
||||
|
||||
1. Type `@` in the chat input
|
||||
2. Start typing a filename
|
||||
3. Select from the autocomplete dropdown
|
||||
4. The file reference is inserted
|
||||
|
||||
When you send the message, the AI has access to that file's contents.
|
||||
|
||||
### Multiple Files
|
||||
|
||||
You can mention multiple files in one message:
|
||||
|
||||
```
|
||||
@src/components/Button.tsx @src/styles/button.css
|
||||
Can you refactor the Button component to use CSS modules?
|
||||
```
|
||||
|
||||
### Folder Mentions
|
||||
|
||||
Mention entire folders to include all files:
|
||||
|
||||
```
|
||||
@src/utils/
|
||||
Review all utility functions for consistency
|
||||
```
|
||||
|
||||
## Plan/Build Mode
|
||||
|
||||
Toggle between two operational modes:
|
||||
|
||||
### Plan Mode (Read-Only)
|
||||
|
||||
- AI can read and analyze files
|
||||
- AI cannot modify, create, or delete files
|
||||
- Safe for exploration and planning
|
||||
|
||||
### Build Mode (Full Access)
|
||||
|
||||
- AI can create new files
|
||||
- AI can edit existing files
|
||||
- AI can delete files
|
||||
- Use for implementation tasks
|
||||
|
||||
Toggle modes using the mode selector in the chat header.
|
||||
|
||||
## Mermaid Diagrams
|
||||
|
||||
AI responses can include Mermaid diagrams that render automatically:
|
||||
|
||||
```mermaid
|
||||
graph TD
|
||||
A[User Request] --> B[AI Processing]
|
||||
B --> C{Valid?}
|
||||
C -->|Yes| D[Execute]
|
||||
C -->|No| E[Error Response]
|
||||
D --> F[Return Result]
|
||||
```
|
||||
|
||||
Supported diagram types:
|
||||
|
||||
- Flowcharts
|
||||
- Sequence diagrams
|
||||
- Class diagrams
|
||||
- State diagrams
|
||||
- Entity-relationship diagrams
|
||||
- Gantt charts
|
||||
- And more...
|
||||
|
||||
## Session Management
|
||||
|
||||
### Viewing Sessions
|
||||
|
||||
Access your sessions from the sidebar:
|
||||
|
||||
- Sessions are organized by repository
|
||||
- Most recent sessions appear first
|
||||
- Click a session to resume
|
||||
|
||||
### Searching Sessions
|
||||
|
||||
Find sessions by content:
|
||||
|
||||
1. Click the search icon in the sessions panel
|
||||
2. Type your search query
|
||||
3. Results show sessions with matching content
|
||||
|
||||
### Deleting Sessions
|
||||
|
||||
Remove sessions you no longer need:
|
||||
|
||||
1. Hover over a session
|
||||
2. Click the delete icon
|
||||
3. Confirm deletion
|
||||
|
||||
### Bulk Delete
|
||||
|
||||
Remove multiple sessions at once:
|
||||
|
||||
1. Click **Select** in the sessions panel
|
||||
2. Check sessions to delete
|
||||
3. Click **Delete Selected**
|
||||
4. Confirm deletion
|
||||
|
||||
## Context Management
|
||||
|
||||
Sessions maintain context of your conversation. As context grows, you may need to manage it:
|
||||
|
||||
### Compacting Context
|
||||
|
||||
Use `/compact` to reduce context size:
|
||||
|
||||
- Summarizes earlier messages
|
||||
- Preserves important information
|
||||
- Frees up context for new messages
|
||||
|
||||
### Starting Fresh
|
||||
|
||||
Use `/new` to start a new session when:
|
||||
|
||||
- Context is too large
|
||||
- Topic has changed significantly
|
||||
- You want a clean slate
|
||||
|
||||
## Keyboard Shortcuts
|
||||
|
||||
| Shortcut | Action |
|
||||
|----------|--------|
|
||||
| `Enter` | Send message |
|
||||
| `Shift+Enter` | New line in message |
|
||||
| `↑` | Edit last message |
|
||||
| `/` | Open command menu |
|
||||
| `@` | Open file mention menu |
|
||||
| `Escape` | Close autocomplete menus |
|
||||
@@ -0,0 +1,153 @@
|
||||
# File Browser
|
||||
|
||||
Navigate, view, and manage files within your repositories.
|
||||
|
||||
## Directory Navigation
|
||||
|
||||
### Tree View
|
||||
|
||||
The file browser displays your repository as an expandable tree:
|
||||
|
||||
- Click folders to expand/collapse
|
||||
- Click files to preview content
|
||||
- Icons indicate file types
|
||||
- Modified files are highlighted
|
||||
|
||||
### Breadcrumbs
|
||||
|
||||
Navigate quickly using the breadcrumb path at the top:
|
||||
|
||||
- Click any segment to jump to that directory
|
||||
- Shows current location in the file tree
|
||||
|
||||
### Search
|
||||
|
||||
Filter files by name:
|
||||
|
||||
1. Click the search icon or press `/`
|
||||
2. Type to filter visible files
|
||||
3. Results update as you type
|
||||
4. Press `Escape` to clear search
|
||||
|
||||
## File Preview
|
||||
|
||||
Click any file to preview with:
|
||||
|
||||
- **Syntax Highlighting** - Support for 100+ languages
|
||||
- **Line Numbers** - Easy reference for code discussions
|
||||
- **Large File Support** - Virtualization for files with many lines
|
||||
|
||||
### Supported Languages
|
||||
|
||||
Syntax highlighting is provided for common languages including:
|
||||
|
||||
- JavaScript, TypeScript, JSX, TSX
|
||||
- Python, Ruby, Go, Rust
|
||||
- HTML, CSS, SCSS, Sass
|
||||
- JSON, YAML, TOML, XML
|
||||
- Markdown, SQL, Shell scripts
|
||||
- And many more...
|
||||
|
||||
## File Operations
|
||||
|
||||
### 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
|
||||
|
||||
### Create Folder
|
||||
|
||||
1. Right-click in the file browser
|
||||
2. Select **New Folder**
|
||||
3. Enter folder name
|
||||
4. 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
|
||||
|
||||
### Delete
|
||||
|
||||
1. Right-click a file or folder
|
||||
2. Select **Delete**
|
||||
3. Confirm deletion
|
||||
|
||||
!!! warning
|
||||
Deletion is permanent and cannot be undone through the UI. Use git to recover deleted files if needed.
|
||||
|
||||
## File Upload
|
||||
|
||||
### Drag and Drop
|
||||
|
||||
Upload files by dragging them into the browser:
|
||||
|
||||
1. Open the target folder
|
||||
2. Drag files from your computer
|
||||
3. Drop into the file browser area
|
||||
4. Files are uploaded to current directory
|
||||
|
||||
### Multiple Files
|
||||
|
||||
You can drag multiple files at once. They'll all be uploaded to the current directory.
|
||||
|
||||
### Upload Limitations
|
||||
|
||||
- Large files may take time to upload
|
||||
- Binary files are supported
|
||||
- File permissions are set by the server
|
||||
|
||||
## ZIP Download
|
||||
|
||||
Download directories or repositories as ZIP archives directly from the file browser:
|
||||
|
||||
### Download Options
|
||||
|
||||
Click the download icon in the file browser header to access download options:
|
||||
|
||||
**Current Directory**
|
||||
- Downloads the folder you're currently viewing
|
||||
- Includes all subfolders and files
|
||||
- Useful for archiving specific parts of a project
|
||||
|
||||
**Entire Repository**
|
||||
- Downloads the complete repository
|
||||
- Same as the download button on repository cards
|
||||
- Perfect for full repository backups
|
||||
|
||||
### Download Process
|
||||
|
||||
Both download options follow the same process:
|
||||
|
||||
1. Click the download icon in the file browser header
|
||||
2. Choose **Current Directory** or **Entire Repository**
|
||||
3. Review the confirmation dialog showing what will be downloaded
|
||||
4. Click **Download** to begin
|
||||
5. Wait while the ZIP archive is created (progress indicator shown)
|
||||
6. ZIP automatically downloads to your computer
|
||||
|
||||
### Archive Features
|
||||
|
||||
The ZIP archives:
|
||||
|
||||
- Respects `.gitignore` - ignored files are excluded
|
||||
- Excludes `.git` directory
|
||||
- Uses compression to reduce file size
|
||||
- Includes proper file permissions
|
||||
- Preserves directory structure
|
||||
|
||||
!!! note
|
||||
Download confirmation ensures you're downloading the correct content. Large repositories may take time to create the archive.
|
||||
|
||||
## Large File Handling
|
||||
|
||||
For files with many lines, the viewer uses virtualization:
|
||||
|
||||
- Only visible lines are rendered
|
||||
- Smooth scrolling through large files
|
||||
- Memory-efficient display
|
||||
|
||||
@@ -0,0 +1,133 @@
|
||||
# Repository & Git
|
||||
|
||||
Comprehensive git integration for managing repositories and source control.
|
||||
|
||||
## Cloning Repositories
|
||||
|
||||
Clone any git repository:
|
||||
|
||||
1. Click the **Repositories** button in the sidebar
|
||||
2. Click **Clone Repository**
|
||||
3. Paste the repository URL
|
||||
4. Click **Clone**
|
||||
|
||||
### Private Repositories
|
||||
|
||||
For private repositories, configure a GitHub Personal Access Token:
|
||||
|
||||
1. Go to **Settings > Credentials**
|
||||
2. Enter your GitHub PAT
|
||||
3. Ensure the token has `repo` scope
|
||||
|
||||
## Git Worktrees
|
||||
|
||||
Work on multiple branches simultaneously without switching:
|
||||
|
||||
1. Select a repository
|
||||
2. Click **Create Worktree**
|
||||
3. Enter branch name
|
||||
4. A new workspace is created with that branch checked out
|
||||
|
||||
Worktrees share the same git history but have independent working directories. This is useful for:
|
||||
|
||||
- Comparing implementations across branches
|
||||
- Working on a feature while keeping main branch accessible
|
||||
- Testing changes without disrupting your main work
|
||||
|
||||
## Source Control Panel
|
||||
|
||||
Access comprehensive git operations via the source control button.
|
||||
|
||||
### Changes Tab
|
||||
|
||||
- View all modified, added, deleted, and untracked files
|
||||
- Stage/unstage individual files or all changes
|
||||
- Discard changes to revert modifications
|
||||
- View diffs inline for any changed file
|
||||
|
||||

|
||||
|
||||
### Commits Tab
|
||||
|
||||
- Browse commit history
|
||||
- View commit details including message, author, and date
|
||||
- See file changes in each commit
|
||||
- Track ahead/behind status with remote
|
||||
|
||||

|
||||
|
||||
### Branches Tab
|
||||
|
||||
- List all local and remote branches
|
||||
- Create new branches from current HEAD
|
||||
- Switch branches (checks out the branch)
|
||||
- Delete local branches
|
||||
|
||||

|
||||
|
||||
## Diff Viewer
|
||||
|
||||
View file changes with a unified diff format:
|
||||
|
||||
- **Line Numbers** - Both old and new line numbers displayed
|
||||
- **Syntax Highlighting** - Code is highlighted based on file type
|
||||
- **Change Markers** - Additions in green, deletions in red
|
||||
- **Change Counts** - Summary of lines added/removed
|
||||
|
||||
### Accessing Diffs
|
||||
|
||||
- Click any changed file in the Source Control panel
|
||||
- Diffs appear inline or in a modal depending on context
|
||||
- Use the expand/collapse toggle for large diffs
|
||||
|
||||

|
||||
|
||||
## 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
|
||||
|
||||
Fetch and merge remote changes:
|
||||
|
||||
1. Select a repository
|
||||
2. Click the **Pull** button
|
||||
3. Changes are fetched and merged
|
||||
|
||||
### Fetch
|
||||
|
||||
Download remote changes without merging:
|
||||
|
||||
1. Select a repository
|
||||
2. Click the **Fetch** button
|
||||
3. Remote tracking branches are updated
|
||||
|
||||
### Delete Repository
|
||||
|
||||
Remove a repository from the workspace:
|
||||
|
||||
1. Select a repository
|
||||
2. Click **Delete**
|
||||
3. Confirm deletion
|
||||
|
||||
## Ahead/Behind Tracking
|
||||
|
||||
The UI shows your branch's relationship to its remote:
|
||||
|
||||
- **↑ N** - You have N commits not pushed to remote
|
||||
- **↓ N** - Remote has N commits you haven't pulled
|
||||
- **↑ N ↓ M** - Both local and remote have diverged
|
||||
|
||||
@@ -0,0 +1,216 @@
|
||||
# MCP Servers
|
||||
|
||||
Configure Model Context Protocol (MCP) servers to extend AI capabilities.
|
||||
|
||||
## What is MCP?
|
||||
|
||||
MCP (Model Context Protocol) allows AI models to interact with external tools and data sources. Servers provide:
|
||||
|
||||
- **Tools** - Functions the AI can call
|
||||
- **Resources** - Data the AI can access
|
||||
- **Prompts** - Pre-defined prompt templates
|
||||
|
||||
## Adding Servers
|
||||
|
||||
### Local Servers (Command-based)
|
||||
|
||||
Local servers run as processes on your machine:
|
||||
|
||||
1. Go to **Settings > MCP Servers**
|
||||
2. Click **Add Server**
|
||||
3. Select **Local**
|
||||
4. Configure:
|
||||
|
||||
```json
|
||||
{
|
||||
"name": "filesystem",
|
||||
"command": "npx",
|
||||
"args": ["-y", "@modelcontextprotocol/server-filesystem", "/workspace"]
|
||||
}
|
||||
```
|
||||
|
||||
| Field | Description |
|
||||
|-------|-------------|
|
||||
| `name` | Unique identifier |
|
||||
| `command` | Executable to run |
|
||||
| `args` | Command arguments |
|
||||
| `env` | Environment variables (optional) |
|
||||
|
||||
### Remote Servers (HTTP)
|
||||
|
||||
Remote servers are accessed over HTTP/SSE:
|
||||
|
||||
1. Go to **Settings > MCP Servers**
|
||||
2. Click **Add Server**
|
||||
3. Select **Remote**
|
||||
4. Configure:
|
||||
|
||||
```json
|
||||
{
|
||||
"name": "remote-tools",
|
||||
"url": "https://mcp.example.com/sse"
|
||||
}
|
||||
```
|
||||
|
||||
| Field | Description |
|
||||
|-------|-------------|
|
||||
| `name` | Unique identifier |
|
||||
| `url` | Server SSE endpoint |
|
||||
| `headers` | HTTP headers (optional) |
|
||||
|
||||
## Server Templates
|
||||
|
||||
Pre-built configurations for common MCP servers:
|
||||
|
||||
### Filesystem
|
||||
|
||||
Access local files and directories:
|
||||
|
||||
```json
|
||||
{
|
||||
"name": "filesystem",
|
||||
"command": "npx",
|
||||
"args": ["-y", "@modelcontextprotocol/server-filesystem", "/path/to/dir"]
|
||||
}
|
||||
```
|
||||
|
||||
### GitHub
|
||||
|
||||
Interact with GitHub repositories:
|
||||
|
||||
```json
|
||||
{
|
||||
"name": "github",
|
||||
"command": "npx",
|
||||
"args": ["-y", "@modelcontextprotocol/server-github"],
|
||||
"env": {
|
||||
"GITHUB_TOKEN": "your-token-here"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### PostgreSQL
|
||||
|
||||
Query PostgreSQL databases:
|
||||
|
||||
```json
|
||||
{
|
||||
"name": "postgres",
|
||||
"command": "npx",
|
||||
"args": ["-y", "@modelcontextprotocol/server-postgres"],
|
||||
"env": {
|
||||
"DATABASE_URL": "postgres://user:pass@host:5432/db"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Brave Search
|
||||
|
||||
Web search capabilities:
|
||||
|
||||
```json
|
||||
{
|
||||
"name": "brave-search",
|
||||
"command": "npx",
|
||||
"args": ["-y", "@modelcontextprotocol/server-brave-search"],
|
||||
"env": {
|
||||
"BRAVE_API_KEY": "your-api-key"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## Managing Servers
|
||||
|
||||
### Enable/Disable
|
||||
|
||||
Toggle servers on/off:
|
||||
|
||||
1. Go to **Settings > MCP Servers**
|
||||
2. Find the server
|
||||
3. Click the toggle switch
|
||||
|
||||
Disabled servers won't be started or connected.
|
||||
|
||||
### Edit Configuration
|
||||
|
||||
Modify server settings:
|
||||
|
||||
1. Click the **Edit** button on a server
|
||||
2. Update configuration
|
||||
3. Click **Save**
|
||||
4. Server will restart with new settings
|
||||
|
||||
### Delete Server
|
||||
|
||||
Remove a server:
|
||||
|
||||
1. Click the **Delete** button
|
||||
2. Confirm deletion
|
||||
|
||||
### Restart Server
|
||||
|
||||
Force restart a server:
|
||||
|
||||
1. Click the **Restart** button
|
||||
2. Server process is stopped and restarted
|
||||
|
||||
Useful after configuration changes or if a server becomes unresponsive.
|
||||
|
||||
## Server Status
|
||||
|
||||
Monitor server health:
|
||||
|
||||
| Status | Description |
|
||||
|--------|-------------|
|
||||
| Running | Server is active and connected |
|
||||
| Starting | Server is launching |
|
||||
| Stopped | Server is disabled |
|
||||
| Error | Server failed to start |
|
||||
|
||||
Click on a server to see detailed status and logs.
|
||||
|
||||
## Tool Permissions
|
||||
|
||||
Control which tools AI can access:
|
||||
|
||||
### Global Settings
|
||||
|
||||
In **Settings > MCP Servers**:
|
||||
|
||||
- **Allow All Tools** - AI can use any tool
|
||||
- **Require Confirmation** - Ask before using tools
|
||||
- **Deny by Default** - Block tools unless allowed
|
||||
|
||||
### Per-Agent Settings
|
||||
|
||||
Configure tool access for custom agents:
|
||||
|
||||
1. Go to **Settings > Agents**
|
||||
2. Edit an agent
|
||||
3. Set **Allowed Tools**
|
||||
4. Save changes
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
### Server Won't Start
|
||||
|
||||
1. Check the command is installed: `npx -y @modelcontextprotocol/server-<name>`
|
||||
2. Verify environment variables are set
|
||||
3. Check server logs for errors
|
||||
4. Try running the command manually
|
||||
|
||||
### Tools Not Appearing
|
||||
|
||||
1. Verify server status is "Running"
|
||||
2. Check server provides the expected tools
|
||||
3. Restart the server
|
||||
4. Check AI model supports tool use
|
||||
|
||||
### Connection Issues
|
||||
|
||||
For remote servers:
|
||||
|
||||
1. Verify URL is correct
|
||||
2. Check network connectivity
|
||||
3. Verify authentication headers
|
||||
4. Check server is running and accessible
|
||||
@@ -0,0 +1,132 @@
|
||||
# Mobile & PWA
|
||||
|
||||
OpenCode Manager is designed mobile-first and works as a Progressive Web App.
|
||||
|
||||
## Mobile-First Design
|
||||
|
||||
The UI is optimized for mobile devices:
|
||||
|
||||
- Touch-friendly controls
|
||||
- Responsive layouts
|
||||
- Adaptive components
|
||||
- Gesture support
|
||||
|
||||
## Installing as PWA
|
||||
|
||||
### iOS
|
||||
|
||||
1. Open OpenCode Manager in **Safari**
|
||||
2. Tap the **Share** button (square with arrow)
|
||||
3. Scroll down and tap **Add to Home Screen**
|
||||
4. Name the app and tap **Add**
|
||||
|
||||
!!! note
|
||||
PWA installation only works in Safari on iOS. Chrome and other browsers don't support PWA on iOS.
|
||||
|
||||
### Android
|
||||
|
||||
1. Open OpenCode Manager in **Chrome**
|
||||
2. Tap the **menu** (three dots)
|
||||
3. Tap **Install app** or **Add to Home Screen**
|
||||
4. Confirm installation
|
||||
|
||||
### Desktop
|
||||
|
||||
#### Chrome
|
||||
|
||||
1. Look for the install icon in the address bar
|
||||
2. Click **Install**
|
||||
3. App opens in its own window
|
||||
|
||||
#### Edge
|
||||
|
||||
1. Click the menu (three dots)
|
||||
2. Select **Apps > Install this site as an app**
|
||||
3. Name and install
|
||||
|
||||
## PWA Features
|
||||
|
||||
### Offline Support
|
||||
|
||||
Limited offline functionality:
|
||||
|
||||
- View cached sessions
|
||||
- Browse cached files
|
||||
- Queue messages for later
|
||||
|
||||
Full functionality requires network connection.
|
||||
|
||||
### Background Updates
|
||||
|
||||
The PWA updates automatically:
|
||||
|
||||
- New versions download in background
|
||||
- Prompt to refresh when ready
|
||||
- No manual update needed
|
||||
|
||||
### Native-Like Experience
|
||||
|
||||
- Runs in its own window
|
||||
- No browser chrome
|
||||
- App icon on home screen
|
||||
- Task switcher integration
|
||||
|
||||
## Mobile Keyboard
|
||||
|
||||
### iOS Keyboard Handling
|
||||
|
||||
Special handling for iOS virtual keyboard:
|
||||
|
||||
- Input field stays above keyboard
|
||||
- Viewport adjusts automatically
|
||||
- No content hidden behind keyboard
|
||||
|
||||
### Enter Key Behavior
|
||||
|
||||
On mobile, pressing Enter:
|
||||
|
||||
1. Closes the virtual keyboard
|
||||
2. Sends the message
|
||||
|
||||
Use **Shift+Enter** for new lines.
|
||||
|
||||
### Keyboard Shortcuts
|
||||
|
||||
Mobile keyboards have limited shortcut support. Use the toolbar buttons instead:
|
||||
|
||||
- Mention files with the **@** button
|
||||
- Access commands with the **/** button
|
||||
- Toggle modes with the mode selector
|
||||
|
||||
## Swipe Navigation
|
||||
|
||||
Navigate with gestures:
|
||||
|
||||
### Swipe Right
|
||||
|
||||
Swipe from the left edge to go back:
|
||||
|
||||
- Opens the sidebar
|
||||
- Returns to previous view
|
||||
- Works throughout the app
|
||||
|
||||
### Swipe Requirements
|
||||
|
||||
- Start from the left edge (first 20px)
|
||||
- Swipe at least 50px right
|
||||
- Swipe quickly (within 300ms)
|
||||
|
||||
## Touch Optimizations
|
||||
|
||||
### Larger Touch Targets
|
||||
|
||||
All interactive elements have minimum 44x44px touch targets for easy tapping.
|
||||
|
||||
### Long Press
|
||||
|
||||
Long press for context menus:
|
||||
|
||||
- Files: Rename, delete, copy path
|
||||
- Messages: Copy, delete, regenerate
|
||||
- Sessions: Rename, delete
|
||||
|
||||
@@ -0,0 +1,70 @@
|
||||
# Features Overview
|
||||
|
||||
OpenCode Manager provides a comprehensive web interface for managing OpenCode AI agents.
|
||||
|
||||
## Core Features
|
||||
|
||||
### Repository & Git
|
||||
|
||||
- **Multi-Repository Support** - Clone and manage multiple git repos with private repo support via GitHub PAT
|
||||
- **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)
|
||||
|
||||
### File Management
|
||||
|
||||
- **Directory Browser** - Navigate files with tree view and search
|
||||
- **Syntax Highlighting** - Code preview with highlighting for 100+ languages
|
||||
- **File Operations** - Create, rename, delete, and drag-and-drop upload
|
||||
- **ZIP Download** - Download repos as ZIP (respects .gitignore)
|
||||
|
||||
[Learn more →](files.md)
|
||||
|
||||
### Chat & Sessions
|
||||
|
||||
- **Real-time Streaming** - Live message streaming with SSE
|
||||
- **Slash Commands** - Built-in (`/help`, `/new`, `/compact`) and custom commands
|
||||
- **File Mentions** - Reference files with `@filename` autocomplete
|
||||
- **Plan/Build Modes** - Toggle between read-only and file-change modes
|
||||
- **Mermaid Diagrams** - Visual diagram rendering in chat
|
||||
|
||||
[Learn more →](chat.md)
|
||||
|
||||
### AI Configuration
|
||||
|
||||
- **Model Selection** - Browse and filter available AI models
|
||||
- **Provider Management** - Configure API keys or OAuth for providers
|
||||
- **OAuth Support** - Secure OAuth login for Anthropic and GitHub Copilot
|
||||
- **Custom Agents** - Create agents with custom system prompts and tool permissions
|
||||
|
||||
[Learn more →](ai-config.md)
|
||||
|
||||
### MCP Servers
|
||||
|
||||
- **Local Servers** - Add command-based MCP servers
|
||||
- **Remote Servers** - Connect to HTTP-based MCP servers
|
||||
- **Templates** - Pre-built configurations for common servers
|
||||
- **Management** - Enable, disable, and configure servers
|
||||
|
||||
[Learn more →](mcp.md)
|
||||
|
||||
### Text-to-Speech
|
||||
|
||||
- **Browser TTS** - Built-in Web Speech API support
|
||||
- **External TTS** - Connect to OpenAI-compatible endpoints
|
||||
- **Audio Caching** - 24-hour cache with 200MB limit
|
||||
- **Voice Controls** - Configurable voice and speed settings
|
||||
|
||||
[Learn more →](tts.md)
|
||||
|
||||
### Mobile & PWA
|
||||
|
||||
- **Mobile-First Design** - Responsive UI optimized for mobile
|
||||
- **PWA Installable** - Add to home screen on any device
|
||||
- **iOS Optimized** - Proper keyboard handling and swipe navigation
|
||||
|
||||
[Learn more →](mobile.md)
|
||||
|
||||
@@ -0,0 +1,145 @@
|
||||
# Text-to-Speech
|
||||
|
||||
Listen to AI responses with built-in or external TTS.
|
||||
|
||||
## Overview
|
||||
|
||||
OpenCode Manager supports two TTS providers:
|
||||
|
||||
1. **Built-in Browser** - Uses your browser's Web Speech API
|
||||
2. **External API** - OpenAI-compatible TTS endpoints
|
||||
|
||||
## Built-in Browser TTS
|
||||
|
||||
Uses your browser's built-in speech synthesis via Web Speech API.
|
||||
|
||||
### Advantages
|
||||
|
||||
- No API key required
|
||||
- Works offline
|
||||
- No server communication needed
|
||||
- Free to use
|
||||
|
||||
### Limitations
|
||||
|
||||
- Voice quality varies by browser/OS
|
||||
- Limited voice selection
|
||||
- No audio caching
|
||||
- Requires browser support
|
||||
|
||||
### Browser Support
|
||||
|
||||
Works in modern browsers:
|
||||
- Chrome, Edge, Safari, Firefox
|
||||
|
||||
### Setup
|
||||
|
||||
1. Go to **Settings > TTS**
|
||||
2. Enable **TTS**
|
||||
3. Select **Built-in Browser** provider
|
||||
4. Choose a voice from available browser voices
|
||||
5. Adjust speed if desired
|
||||
6. Click **Test** to verify
|
||||
|
||||
### Voice Selection
|
||||
|
||||
Available voices depend on your operating system:
|
||||
|
||||
- **Chrome** - Google voices and system voices
|
||||
- **Safari** - macOS voices (Alex, Samantha, etc.)
|
||||
- **Firefox** - System voices
|
||||
- **Edge** - Microsoft voices
|
||||
|
||||
### Web Speech API Detection
|
||||
|
||||
The system automatically detects if your browser supports Web Speech API. If not supported, you'll see a warning and should switch to External API.
|
||||
|
||||
## External API TTS
|
||||
|
||||
Connect to OpenAI-compatible TTS endpoints for higher quality voices.
|
||||
|
||||
### Advantages
|
||||
|
||||
- Higher quality voices
|
||||
- Consistent across devices
|
||||
- Audio caching on server
|
||||
- More voice options
|
||||
- Composite voice support
|
||||
|
||||
### Limitations
|
||||
|
||||
- Requires API key and endpoint
|
||||
- Requires network connection
|
||||
- Server-side processing
|
||||
|
||||
### Setup
|
||||
|
||||
1. Go to **Settings > TTS**
|
||||
2. Enable **TTS**
|
||||
3. Select **External API** provider
|
||||
4. Enter the **TTS Server URL**:
|
||||
- OpenAI: `https://api.openai.com`
|
||||
- Kokoro: `https://your-kokoro-server.com:port`
|
||||
5. Enter your **API Key**
|
||||
6. Wait for voice/model discovery
|
||||
7. Choose voice and model
|
||||
8. Click **Test** to verify
|
||||
|
||||
### Compatible Services
|
||||
|
||||
Any OpenAI-compatible TTS API works:
|
||||
|
||||
- OpenAI TTS
|
||||
- Kokoro TTS
|
||||
- Azure OpenAI
|
||||
- Local TTS servers
|
||||
- Self-hosted alternatives
|
||||
|
||||
## Voice Configuration
|
||||
|
||||
### Voice Discovery
|
||||
|
||||
The system automatically discovers available voices and models:
|
||||
|
||||
1. On first connection with API key, voices/models are fetched
|
||||
2. Voice list is cached for 1 hour
|
||||
3. Click **Refresh** button to force re-discovery if voices change
|
||||
|
||||
### Composite Voices
|
||||
|
||||
Kokoro-style composite voices are supported. Combine multiple voices for unique effects:
|
||||
- Example: `am_adam+am_echo`
|
||||
- Example: `af_bella+af_nova`
|
||||
|
||||
## Audio Playback
|
||||
|
||||
### Playing Responses
|
||||
|
||||
To listen to an AI response:
|
||||
|
||||
1. Click the **Play** button on a message
|
||||
2. Audio streams and plays
|
||||
|
||||
### Playback Controls
|
||||
|
||||
While audio is playing:
|
||||
|
||||
- **Stop** - End playback immediately
|
||||
- Audio stops if you navigate away
|
||||
|
||||
## Markdown Sanitization
|
||||
|
||||
Before sending text to TTS, markdown is cleaned for better speech:
|
||||
|
||||
- Code blocks removed entirely
|
||||
- Inline code: `code` → code
|
||||
- Links: [text](url) → text
|
||||
- Images:  → alt
|
||||
- Bold/italic/strikethrough markers removed
|
||||
- Headers: ### Header → Header
|
||||
- List markers removed
|
||||
- Tables converted to readable text
|
||||
- HTML tags removed
|
||||
- Whitespace cleaned up
|
||||
|
||||
This ensures natural, readable speech playback.
|
||||
Reference in new issue
Block a user