A Python port of the OpenCode AI coding agent, built for the terminal.
- π€ AI-powered coding assistance
- π§ Multiple tool integrations (bash, edit, read, grep, etc.)
- π Language Server Protocol (LSP) support
- π Session management and chat history
- π Multiple AI provider support (OpenAI, Anthropic, etc.)
- π¨ Rich terminal UI
- π Real-time file watching and diagnostics
pip install opencode-pythonOr for development:
git clone <repository>
cd opencode_python
pip install -e ".[dev]"# Start interactive session
opencode
# Run with a message
opencode run "Help me fix this bug"
# Continue last session
opencode run --continue
# Use specific model
opencode run --model anthropic/claude-3-sonnet "Refactor this code"
# Start server mode
opencode serve --port 8080Configuration files are stored in platform-specific directories:
- Linux:
~/.config/opencode/ - macOS:
~/Library/Application Support/opencode/ - Windows:
%APPDATA%/opencode/
# Install development dependencies
pip install -e ".[dev]"
# Run tests
pytest
# Format code
black .
ruff check --fix .
# Type checking
mypy .The Python port maintains the same architecture as the original TypeScript version:
- CLI: Command-line interface with multiple commands
- Tools: Individual tools for different operations (bash, edit, read, etc.)
- Session: Chat session management and message handling
- LSP: Language Server Protocol integration
- Provider: AI model provider abstraction
- Server: HTTP API server for remote access
MIT License - see LICENSE file for details.