* feat(source-control): add commits and file management components - Introduced `CommitsTab` for displaying commit history with relative time formatting. - Added `GitFlatFileItem` and `GitFlatFileList` for managing file statuses in the source control panel. - Implemented `SourceControlPanel` to encapsulate source control functionalities including changes, commits, and branches. - Enhanced `useGit` hook to manage git operations such as fetch, pull, push, commit, stage, and unstage files with appropriate error handling and toast notifications. - Updated `RepoDetail` to integrate the new source control panel and provide a user interface for source control actions. - Defined `GitCommit` type for better type safety in commit-related operations. * refactor: streamline error handling in Git operations and update error imports * feat: enhance Git services and ESLint configuration for improved functionality * refactor: update method signatures for consistency and clarity in Git services * feat: refactor git services and improve error handling - Remove unused imports and clean up code in repos.ts and git-operations.ts. - Simplify error handling in repo.ts by enforcing message property in ErrorWithMessage interface. - Update GitPushService to remove unnecessary database parameter in methods. - Enhance executeCommand function to better handle command execution results. - Update tests to use mocked functions for better isolation and clarity. - Add specific ESLint rules for test files to accommodate common testing patterns. - Introduce tsconfig.test.json for better TypeScript configuration in tests. - Update vitest.config.ts to use the new test TypeScript configuration. * refactor: remove esbuild configuration from Vitest setup * feat: enhance Source Control Panel with branch management and integrate into RepoDetail and SessionDetail pages * feat: implement Git authentication service and refactor related services - Add GitAuthService to handle Git environment setup with credentials. - Refactor GitBranchService, GitCommitService, GitFetchPullService, GitPushService, GitStatusService, and GitLogService to utilize the new GitAuthService. - Remove GitCommandUtils and related error handling for Git operations. - Delete git-operations.ts and associated tests as functionality is now integrated into other services. - Update TypeScript configuration to enable composite projects for better build management. * feat: refactor Git services to improve structure and update imports * refactor: simplify error utility functions and update test cases for Git services * feat: refactor GitAuthService and update related tests for improved credential handling * feat: implement GitDiffService and related endpoints for file diff functionality * feat: add emitDeclarationOnly option to TypeScript configuration files * feat: enhance GitLogService to fetch remote branches and improve error handling in repo commands * feat: update Git command execution to remove fallback and enhance environment variable handling * feat: add repository authentication tracking - Add `requires_auth` column to repos table - Implement auth check in GitAuthService - Update cloneRepo to detect public/private repos - Add test coverage for auth-related functionality - Improve UI styling for auth-related indicators * feat(git): implement interactive Git authentication with askpass - Add GitAskpassService to handle credential requests from Git - Implement askpass script that communicates with backend - Update GitAuthService to use askpass instead of direct credential injection - Add new endpoint for branch listing and status - Improve branch name handling in GitBranchService - Enhance error handling in GitDiffService for untracked files - Add upstream branch checking and setup in GitFetchPullService - Update UI components for better visual consistency - Fix various minor UI styling issues * feat(git): enhance Git authentication with improved askpass support - Update askpass endpoint to handle hostname parameter and return full credential object - Replace `createNoPromptGitEnv` with `createSilentGitEnv` for better VSCode compatibility - Add compiled Node.js askpass script for broader compatibility - Enhance GitBranchService to return detailed branch information with upstream tracking - Improve branch listing UI with better sorting and display - Update GitAuthService to use askpass for all operations with proper credential handling - Fix various UI styling issues in diff view and source control panel - Update test mocks to use new silent environment function - Add proper error handling and credential caching in GitAskpassService * feat(git-auth): implement IPC-based Git authentication system - Add new IPC server infrastructure for handling Git credential requests - Implement AskpassHandler to manage Git authentication through IPC - Replace previous HTTP-based askpass system with local IPC communication - Remove deprecated GitAskpassService and related HTTP endpoints - Update GitAuthService to use IPC-based authentication flow - Add new shell scripts for Git askpass integration (askpass.sh, askpass-main.js) - Remove database column 'requires_auth' as it's no longer needed - Update all Git service classes to use new authentication approach - Improve error handling and credential caching - Add proper cleanup for IPC server on shutdown * fix(frontend): correct GitBranch type usage in BranchesTab and BranchSwitcher * fix(ipc): handle empty responses and add logging for askpass handler - Handle empty response bodies in askpass-main.ts to prevent JSON parse errors - Add logging to IPC server for debugging request/response issues - Add logging to AskpassHandler for credential lookup visibility * fix(ipc): return empty credentials for silent fetches instead of failing Silent fetch operations (used when fetching commit history on repo open) should return empty credentials gracefully rather than failing, allowing git to proceed without credentials for public repos or cached credentials. * chore(ipc): add detailed logging for debugging askpass requests - Log handler registration and lookup paths - Log incoming request details - Log handler response results * chore(askpass): add comprehensive debugging to trace IPC communication - Add detailed stderr logging to askpass-main.ts for all steps - Log environment variables and paths at initialization - Log IPC connection attempts and responses - Log JSON parsing results This will help trace where the IPC communication fails. * chore(debug): add comprehensive logging to trace git environment and IPC requests - Log GIT_ASKPASS, VSCODE_GIT_IPC_HANDLE, GIT_TERMINAL_PROMPT env vars when executing git - Log all incoming IPC requests with URL and body - Log handler registration status * Integrate GitAuthService throughout repo operations - Add GitAuthService parameter to all repo service functions - Replace direct git env creation with GitAuthService.getGitEnvironment() - Update route handlers to pass GitAuthService to service calls - Remove createSilentGitEnv utility in favor of centralized auth - Ensure consistent git authentication across all operations * refactor: consolidate git services and remove duplicate fetch service - Remove GitFetchService and consolidate into GitFetchPullService - Clean up duplicate git authentication logic across services - Simplify repo service by removing redundant environment handling - Update tests to reflect consolidated service structure - Remove unused imports and streamline API endpoints - Reduce codebase complexity by eliminating service duplication * refactor: clean up unnecessary config changes and improve git API types * feat(git): add GitCommit interface and fix push mutation * feat(git): fix source control panel issues - Fix unstaged file diff showing all changes instead of working directory only - Remove auto-refresh (10s) to reduce git command spam - Add reset/revert mutation for unpushed local commits - Fix branch creation/switching to update database - Add unpushed commit detection and visual indicator in commits tab - Handle no-upstream branch status gracefully * fix(git): improve branch listing and remove regex parsing issue - Fix branch name parsing to use full name instead of regex capturing only first word - Add refresh button for branches - Show remote branches with Globe icon and make them non-clickable - Add 'local' label for branches without upstream tracking - Handle remotes/ prefix properly in branch detection * fix(git): remove duplicate refresh button * fix(git): properly extract branch name from git output - Extract branch name before whitespace/bracket in git branch -vv -a output - When clicking remote branch, checkout local tracking branch instead of remote reference * fix(git): remove duplicate refresh button from branches tab * fix: improve source control panel mobile layout - Set full height on mobile for better screen utilization - Add larger centered close button on mobile - Hide default close button when custom one is shown on mobile * Remove git credential test feature The test credential button in settings was broken because it tried to test authentication against just the host URL (e.g., https://github.com/) instead of a repository path. Since git credentials are already handled correctly through the askpass mechanism when cloning repositories, the test button was redundant and has been removed. Changes: - Remove /test-credential endpoint from settings routes - Remove testGitCredential API from frontend - Remove TestCredentialRequest/Response types - Remove test button and related state from GitSettings component * fix: resolve Copilot review issues - Remove duplicate GitCommit interface definition - Fix CSS typos: bg-linear-to-br -> bg-gradient-to-br - Fix typo: /sessflex-shrink-0 -> flex-shrink-0 - Add *.test.js to .gitignore and remove compiled test files - Fix missing closing brace in useGit.test.tsx - Remove unused maskToken function * fix(git): correct ahead/behind count order and add renamed file path parsing - Fix git rev-list output parsing: ahead comes first, behind second - Add oldPath extraction for renamed (R) and copied (C) files in status - Refactor git service tests to use consistent mocking patterns - Add missing Database and SettingsService mocks to prevent test failures --------- Co-authored-by: Chris Scott <99081550+chriswritescode-dev@users.noreply.github.com>
OpenCode Manager
Mobile-first web interface for OpenCode AI agents. Manage, control, and code with OpenCode from any device - your phone, tablet, or desktop. Features Git integration, file management, and real-time chat in a responsive PWA. Deploy with Docker for instant setup. View diffs, edit files and much more.
Features
Repository Management
- Multi-Repository Support - Clone and manage multiple git repos/worktrees in local workspaces
- Private Repository Support - GitHub PAT configuration for cloning private repos
- Worktree Support - Create and manage Git worktrees for working on multiple branches
Git Integration
- Source Control Panel - Comprehensive Git operations in a modal interface with tabs for Changes, Commits, and Branches
- Git Diff Viewer - View file changes with unified diff, line numbers, and addition/deletion counts
- Git Status Panel - See all uncommitted changes (modified, added, deleted, renamed, untracked)
- Branch Management - Switch, create, and manage branches through the Source Control Panel
- Branch/Worktree Creation - Create new branch workspaces from any repository
- Ahead/Behind Tracking - Shows commits ahead/behind remote
- Push PRs to GitHub - Create and push pull requests directly from your phone
File Browser
- Directory Navigation - Browse files and folders with tree view
- File Search - Search files within directories
- Syntax Highlighting - Code preview with syntax highlighting
- File Operations - Create files/folders, rename, delete
- Drag-and-Drop Upload - Upload files by dragging into the browser
- Large File Support - Virtualization for large files
- ZIP Download - Download repos as ZIP excluding gitignored files
Chat & Session Features
- Slash Commands - Built-in commands (
/help,/new,/models,/export,/compact, etc.) - Custom Commands - Create custom slash commands with templates
- File Mentions - Reference files with
@filenameautocomplete - Plan/Build Mode Toggle - Switch between read-only and file-change modes
- Mermaid Diagram Support - Visual diagram rendering in chat messages
- Session Management - Create, search, delete, and bulk delete sessions
- Real-time Streaming - Live message streaming with SSE
AI Model & Provider Configuration
- Model Selection - Browse and select from available AI models with filtering
- Provider Management - Configure multiple AI providers with API keys or OAuth
- OAuth Authentication - Secure OAuth login for supported providers (Anthropic, GitHub Copilot)
- Context Usage Indicator - Visual progress bar showing token usage
- Agent Configuration - Create custom agents with system prompts and tool permissions
MCP Server Management
- MCP Server Configuration - Add local (command-based) or remote (HTTP) MCP servers
- Server Templates - Pre-built templates for common MCP servers
- Enable/Disable Servers - Toggle servers on/off with auto-restart
Settings & Customization
- Theme Selection - Dark, Light, or System theme
- Keyboard Shortcuts - Customizable keyboard shortcuts
- OpenCode Config Editor - Raw JSON editor for advanced configuration
Mobile & PWA
- Mobile-First Design - Responsive UI optimized for mobile use
- PWA Support - Installable as Progressive Web App
- iOS Keyboard Support - Proper keyboard handling on iOS
- Enter Key Send - Press Enter to automatically close keyboard and send messages
- Swipe-to-Navigate - Swipe right from left edge to navigate back
Text-to-Speech (TTS)
- Dual Provider Support - Browser-native Web Speech API + external OpenAI-compatible endpoints
- Browser-Native TTS - Built-in Web Speech API for instant playback without API keys
- AI Message Playback - Listen to assistant responses with TTS
- OpenAI-Compatible - Works with any OpenAI-compatible TTS endpoint
- Voice & Speed Discovery - Automatic voice detection with caching (1hr TTL)
- Voice & Speed Controls - Configurable voice selection and playback speed
- Audio Caching - 24-hour cache with 200MB limit for performance
- Markdown Sanitization - Filters unreadable symbols for smooth playback
- Floating Controls - Persistent stop button for audio control
- Custom Endpoints - Connect to local or self-hosted TTS services
Screenshots
| Files (Mobile) | Files (Desktop) |
| Chat (Mobile) | Chat (Desktop) |
| Inline Diff View | |
Coming Soon
- Authentication - User authentication and session management
See the Roadmap for planned features and future development.
Installation
Option 1: Docker (Recommended for Production)
# Clone the repository
git clone https://github.com/chriswritescode-dev/opencode-manager.git
cd opencode-manager
# Start with Docker Compose (single container)
docker-compose up -d
# Access the application at http://localhost:5001
The Docker setup automatically:
- Installs OpenCode if not present
- Builds and serves frontend from backend
- Sets up persistent volumes for workspace and database
- Includes health checks and auto-restart
Docker Commands:
# Start container
docker-compose up -d
# Stop and remove container
docker-compose down
# Rebuild image
docker-compose build
# View logs
docker-compose logs -f
# Restart container
docker-compose restart
# Access container shell
docker exec -it opencode-manager sh
Dev Server Ports
The Docker container exposes ports 5100-5103 for running dev servers inside your repositories. Configure your project's dev server to use one of these ports and access it directly from your browser.
Example usage:
# Vite (vite.config.ts)
server: { port: 5100, host: '0.0.0.0' }
# Next.js
next dev -p 5100 -H 0.0.0.0
# Express/Node
app.listen(5100, '0.0.0.0')
Access your dev server at http://localhost:5100 (or your Docker host IP).
To customize the exposed ports, edit docker-compose.yml:
ports:
- "5003:5003" # OpenCode Manager
- "5100:5100" # Dev server 1
- "5101:5101" # Dev server 2
- "5102:5102" # Dev server 3
- "5103:5103" # Dev server 4
Global Agent Instructions (AGENTS.md)
OpenCode Manager creates a default AGENTS.md file in the workspace config directory (/workspace/.config/opencode/AGENTS.md). This file provides global instructions to AI agents working within the container.
Default instructions include:
- Reserved ports (5003 for OpenCode Manager, 5551 for OpenCode server)
- Available dev server ports (5100-5103)
- Guidelines for binding to
0.0.0.0for Docker accessibility
Editing AGENTS.md:
- Via UI: Settings > OpenCode > Global Agent Instructions
- Via file: Edit
/workspace/.config/opencode/AGENTS.mddirectly
This file is merged with any repository-specific AGENTS.md files, with repository instructions taking precedence for their respective codebases.
Option 2: Local Development (Contributors)
For contributors who want to develop locally instead of using Docker.
Prerequisites:
- pnpm - Package manager (required for workspaces)
- Bun - Backend runtime
- OpenCode TUI -
npm install -g @opencode/tui
# Clone the repository
git clone https://github.com/chriswritescode-dev/opencode-manager.git
cd opencode-manager
# Install dependencies (uses pnpm workspaces)
pnpm install
# Copy environment configuration
cp .env.example .env
# Start development servers (backend + frontend)
pnpm dev
OAuth Provider Setup
OpenCode WebUI supports OAuth authentication for select providers, offering a more secure and convenient alternative to API keys.
Supported OAuth Providers
- Anthropic (Claude) - OAuth login with Claude Pro/Max accounts
- GitHub Copilot - OAuth device flow authentication
Setting Up OAuth
- Navigate to Settings → Provider Credentials
- Select a provider that shows the "OAuth" badge
- Click "Add OAuth" to start the authorization flow
- Choose authentication method:
- "Open Authorization Page" - Opens browser for sign-in
- "Use Authorization Code" - Provides code for manual entry
- Complete authorization in the browser or enter the provided code
- Connection status will show as "Configured" when successful