This Python integration adds deep, interactive Python project configuration to opencode. It provides:
- Smart project detection with confidence scoring
- Interactive configuration wizard for Python projects
- Tool detection for Python development tools
- Project-specific configuration stored in
.opencode/project-config.json - Support for multiple Python project types (FastAPI, Django, Flask, Data Science, ML, CLI, Library)
everything-opencode/
├── scripts/interactive/ # Core interactive system
│ ├── prompts.js # Interactive prompts (color-coded UX)
│ ├── config-manager.js # Configuration management
│ └── project-detector.js # Language detection with confidence scoring
├── languages/python/ # Python-specific wizards
│ └── config-wizard.js # Python configuration wizard
├── scripts/python/ # Python utilities
│ └── tool-detector.js # Python tool detection
├── scripts/interactive-setup.js # Main setup script
└── examples/python-projects/ # Project templates (coming soon)
- Detects 5 languages: Python, TypeScript, Go, Rust, PineScript
- Confidence-based scoring (0-0.95)
- Multiple indicators per language
- Python project type detection (FastAPI, Django, Flask, etc.)
- Color-coded prompts for better UX
- Multiple choice with descriptions
- Yes/no confirmations with defaults
- Text input with validation
- Progress indicators
- Dependency manager selection: uv, poetry, pip, conda
- Testing framework: pytest, unittest
- Linting: ruff, flake8, pylint
- Formatting: ruff, black, autopep8
- Type checking: pyright, mypy
- Project type support: FastAPI, Django, Flask, Data Science, ML, CLI, Library
- Detects 30+ Python tools and libraries
- Version checking
- Installation guides per platform (macOS, Linux, Windows)
- Compatibility checking
# Run interactive setup
node scripts/interactive-setup.js
# Quick setup (automatic detection)
node scripts/interactive-setup.js quick
# Show current configuration
node scripts/interactive-setup.js config
# Detect project languages
node scripts/interactive-setup.js detect
# Detect installed tools
node scripts/interactive-setup.js tools# Run Python configuration wizard
node languages/python/config-wizard.js
# Quick Python setup
node languages/python/config-wizard.js --quick
# Detect Python tools
node scripts/python/tool-detector.jsConfiguration is stored in .opencode/project-config.json:
{
"project": "/path/to/project",
"configuredAt": "2025-01-25T10:30:00.000Z",
"primaryLanguage": "python",
"python": {
"projectType": "fastapi",
"dependencyManager": "uv",
"testRunner": "pytest",
"linter": "ruff",
"formatter": "ruff",
"typeChecker": "pyright",
"tools": {
"python": { "installed": true, "version": "3.11.0" },
"uv": { "installed": true, "version": "0.1.0" }
},
"userApproved": true
}
}- Automatic API documentation (Swagger/ReDoc)
- Dependency injection support
- WebSocket support detection
- Django admin detection
- App structure analysis
- Database configuration hints
- Blueprint detection
- Extension analysis
- Template structure
- Jupyter notebook support
- pandas/numpy/matplotlib detection
- Data pipeline structure
- PyTorch/TensorFlow detection
- Model training pipeline analysis
- Experiment tracking hints
- Click/Typer/argparse detection
- Command structure analysis
- Argument parsing setup
- Package structure validation
- Documentation generation hints
- Testing setup recommendations
The system detects:
- Python interpreters: python, python3
- Dependency managers: uv, poetry, pip, conda
- Testing frameworks: pytest, unittest
- Linting/formatting: ruff, black, flake8, pylint, autopep8, isort
- Type checking: pyright, mypy
- Build tools: setuptools, wheel, build
- Virtual environments: venv, virtualenv
- Frameworks: FastAPI, Django, Flask, pandas, numpy, torch, tensorflow, click, typer
/python-test- Run tests with configured test runner/python-lint- Run linter and formatter/python-typecheck- Run type checker/python-deps- Manage dependencies/python-setup- Re-run configuration wizard
- Pre-commit hooks for Python projects
- Pre-push hooks for testing
- CI/CD integration hints
- Add tool definition to
scripts/python/tool-detector.js:
toolName: {
command: 'tool --version',
description: 'Tool description',
installGuide: {
macos: 'brew install tool',
linux: 'apt-get install tool',
windows: 'Download from...'
},
priority: 5
}-
Add to configuration schema in
scripts/interactive/config-manager.js -
Add to wizard options in
languages/python/config-wizard.js
- Add detection logic to
scripts/interactive/project-detector.js - Add configuration options to wizard
- Add project templates to
examples/python-projects/
# Run test suite
node test-python-setup.js
# Create test project
mkdir test-project && cd test-project
echo 'print("Hello")' > main.py
node ../scripts/interactive-setup.js- Implement
/python-test,/python-lint, etc. - Create command definitions in
commands/directory - Integrate with existing opencode command system
- Create example projects in
examples/python-projects/ - FastAPI production template
- Data science pipeline template
- Trading bot template (PineScript bridge)
- Create Python skills in
skills/python-development/ - Build Python agents in
agents/directory - Integrate with AI assistance
- Follow existing code patterns and conventions
- Add tests for new functionality
- Update documentation
- Use the interactive prompt system for user interaction
- Store configurations in
.opencode/project-config.json
Part of the everything-opencode project.