Python port of the OpenCode AI-powered development tool.
This is a complete Python reimplementation of the OpenCode TypeScript codebase, maintaining the same architecture, behavior, and features while using idiomatic Python patterns.
pip install -e .# Install with dev dependencies
pip install -e ".[dev]"
# Run tests
pytest
# Type checking
mypy opencode
# Linting
ruff check opencode
black opencodeThe package follows the same modular structure as the TypeScript original:
acp/- Agent Communication Protocolagent/- Agent definitions and managementauth/- Authenticationbus/- Event bus systemcli/- Command-line interfaceconfig/- Configuration managementfile/- File operationslsp/- Language Server Protocolmcp/- Model Context Protocolprovider/- AI provider managementserver/- HTTP/WebSocket serversession/- Session managementskill/- Skills systemstorage/- Data persistencetool/- AI toolsutil/- Utility functions
- Validation: Pydantic replaces Zod
- HTTP: FastAPI/httpx replace Hono/fetch
- CLI: Typer replaces yargs
- AI SDK: litellm/openai/anthropic replace Vercel AI SDK
- File Operations: aiofiles/pathlib replace Bun APIs
- Async: asyncio throughout
MIT