Getting Started
Requirements
- Python ≥ 3.11
- pip
Installation
Setup
Create a .env file with your API key:
OPENAI_API_KEY=sk-your-key-here
# Optional
ANTHROPIC_API_KEY=sk-ant-your-key-here
AWS_ACCESS_KEY_ID=your-aws-key
AWS_SECRET_ACCESS_KEY=your-aws-secret
Basic usage
Analyze a repository
# Current directory
cocode repox
# Specific directory
cocode repox /path/to/project
# Save with custom name
cocode repox --output-filename my-analysis.txt
Filter files
# Python files only
cocode repox --include-pattern "*.py"
# Exclude tests
cocode repox --exclude-pattern "test_*"
# Specific directory
cocode repox --path-pattern "src"
Python processing modes
# Extract interfaces (signatures + docstrings)
cocode repox --python-rule interface --include-pattern "*.py"
# Extract imports only
cocode repox --python-rule imports --include-pattern "*.py"
# Full code (default)
cocode repox --python-rule integral --include-pattern "*.py"
AI analysis
# Extract project overview
cocode swe-from-repo extract_fundamentals .
# Generate changelog from git diff
cocode swe-from-repo-diff write_changelog v1.0.0 .
# Extract features from text file
cocode swe-from-file extract_features_recap analysis.txt
Output styles
repo_map(default) - Tree structure with file contentsflat- File contents onlytree- Directory structure onlyimport_list- Import statements (with imports rule)