CLI tool powered by GitHub Copilot CLI that analyzes git repositories and generates beautiful documentation
DocWeave is a command-line tool that analyzes your git repository and generates organized documentation using GitHub Copilot CLI. It transforms your commit history into markdown docs, Mermaid diagrams, and AI-powered insights.
- π€ AI-Powered Analysis: Uses GitHub Copilot CLI to understand code changes and provide context
- π Visual Diagrams: Generates Mermaid diagrams (timelines, file relationships, importance charts)
- π Auto-Documentation: Creates organized markdown files in
DocweaveDocs/folder - π― Next Steps: Suggests actionable next steps based on code analysis
- β‘ Simple CLI: Just run
docweave analyzein any git repository - π Graceful Fallback: Works even without Copilot CLI using intelligent heuristics
- Python 3.10+
- Poetry for dependency management
- GitHub Copilot CLI (optional but recommended for AI-powered analysis)
# Clone the repository
git clone https://github.com/Juls95/DocWeave
cd DocWeave
# Run installation script
./install.sh
# Reload your shell
source ~/.zshrc # or source ~/.bashrc
# Verify installation
docweave --help# Clone the repository
git clone https://github.com/Juls95/DocWeave
cd DocWeave
# Install Poetry (if not installed)
curl -sSL https://install.python-poetry.org | python3 -
# Install dependencies and build
poetry install
poetry build
# Install globally
pip install --user dist/docweave-*.whl
# Add to PATH (add to ~/.zshrc or ~/.bashrc)
export PATH="$HOME/.local/bin:$PATH"
# Reload shell
source ~/.zshrc # or source ~/.bashrccd DocWeave
poetry install
poetry run docweave analyze --path /path/to/repoWhen you run docweave analyze, here's what happens:
π Detecting git repository...
β
Detected git repository: your-repo
βΉοΈ Repository path: /path/to/your/repo
- DocWeave checks if the current directory (or specified path) is a git repository
- It looks for a
.gitfolder, checking up to 5 parent directories if needed - If no git repository is found, it shows a clear error message with instructions
π Checking GitHub Copilot CLI...
β
GitHub Copilot CLI is available - using enhanced analysis
OR if not available:
β οΈ GitHub Copilot CLI not available: [error message]
βΉοΈ Using fallback analysis (still generates great docs!)
What happens if GitHub credentials aren't detected:
- Copilot CLI Not Installed: DocWeave detects this and automatically falls back to heuristic-based analysis. You'll see a warning message, but the tool continues working.
- Copilot CLI Installed but Not Authenticated: Same behavior - fallback analysis is used. The tool will still generate documentation, just without AI-powered insights.
- Copilot CLI Available and Authenticated: Enhanced AI-powered analysis is used for each commit, providing deeper insights, better summaries, and more contextual next steps.
Key Point: DocWeave always works, regardless of Copilot CLI status. It gracefully degrades to intelligent heuristics when Copilot isn't available.
π Analyzing recent commits (limit: 5)...
β
Found 5 commit(s) to analyze
π Analyzing commits with AI-powered insights...
[1/5] abc1234 - Fix bug in login... β
β
[2/5] def5678 - Add new feature... β
β
...
For each commit:
- With Copilot CLI: The commit diff and message are analyzed using AI to extract:
- Summary of changes
- Why the change was made
- Suggested next steps
- Importance level (low/medium/high)
- Without Copilot CLI: Intelligent heuristics analyze:
- Commit message patterns (e.g., "fix", "feat", "test")
- File types changed
- Code diff patterns
- Generates similar insights using rule-based analysis
π Generating documentation...
β
Documentation generated successfully!
DocWeave creates:
- CHANGES.md: Detailed analysis of each commit
- NARRATIVE.md: Storytelling narrative of development journey
- DIAGRAMS.md: Mermaid diagrams (timelines, file relationships, importance charts)
- NEXT_STEPS.md: Actionable next steps based on analysis
π Generated Files:
β CHANGES.md - Detailed commit analysis
β NARRATIVE.md - Development narrative
β DIAGRAMS.md - Mermaid diagrams
β NEXT_STEPS.md - Suggested next steps
π Documentation saved to: /path/to/repo/DocweaveDocs
All files are saved in the DocweaveDocs/ folder in your repository root.
User runs: docweave analyze
β
βββ Detect git repository
β βββ Error if not found β Exit with instructions
β
βββ Check Copilot CLI
β βββ Available β Use AI-powered analysis
β βββ Not available β Use fallback heuristics
β
βββ Analyze commits
β βββ Get commit diffs
β βββ Analyze with Copilot (if available) or heuristics
β βββ Extract insights (summary, why, next steps, importance)
β
βββ Generate documentation
β βββ Create markdown files
β βββ Generate Mermaid diagrams
β βββ Write narrative and next steps
β
βββ Save to DocweaveDocs/
βββ Show summary and completion message
Option 1: Homebrew (macOS/Linux)
brew install copilot-cliOption 2: npm (requires Node.js 22+)
npm install -g @github/copilotOption 3: Install Script
curl -fsSL https://gh.io/copilot-install | bashMethod 1: Interactive Login
copilot
# In the interactive session, type:
/login
# Follow the on-screen instructionsMethod 2: Personal Access Token
- Visit https://github.com/settings/personal-access-tokens/new
- Under "Permissions," select Copilot Requests
- Generate your token
- Set as environment variable:
export GH_TOKEN=your_token_here # or export GITHUB_TOKEN=your_token_here
# Check if installed
copilot --version
# Should show: GitHub Copilot CLI 0.0.407 (or similar)
# Test in DocWeave
cd /path/to/git/repo
docweave analyze
# Look for: β
"GitHub Copilot CLI is available - using enhanced analysis"# Navigate to any git repository
cd /path/to/your/repo
# Analyze last 5 commits (default)
docweave analyze
# Analyze only the last commit (quick)
docweave analyze --last# Analyze last commit only (quick analysis)
docweave analyze --last
# Analyze last 5 commits (default)
docweave analyze
# Analyze specific number of commits
docweave analyze --limit 20
# Analyze specific repository
docweave analyze --path /path/to/repo
# or short: docweave analyze -p /path/to/repo
# Analyze commits from last 7 days only
docweave analyze --days 7
# or short: docweave analyze -d 7
# Combine options
docweave analyze --path ./my-repo --limit 15 --days 30DocWeave creates a DocweaveDocs/ folder in your repository with:
src/docweave/
βββ cli.py # CLI entrypoint and command handling
βββ components/ # Reusable components
β βββ copilot_integration.py # GitHub Copilot CLI integration
β βββ doc_generator.py # Documentation generation
βββ features/ # Business logic
β βββ commit_analysis.py # Git commit analysis
βββ lib/ # Utilities
β βββ copilot_check.py # Copilot CLI availability check
β βββ repo_utils.py # Repository path utilities
β βββ utils.py # General utilities
βββ types/ # Type definitions
βββ models.py # Data models
# Run tests
poetry run pytest-
Check if installed:
which docweave pip show docweave
-
Add to PATH:
export PATH="$HOME/.local/bin:$PATH" # Add this to ~/.zshrc or ~/.bashrc
-
Reinstall:
cd DocWeave ./install.sh
Make sure you're using Python 3.10+:
python3 --version # Should be 3.10 or higher- Ensure you're in a directory with a
.gitfolder - Or use
--pathto specify a repository:docweave analyze --path /path/to/repo
If you see an error about GitHub URLs:
- DocWeave requires local git repositories
- Clone the repository first:
git clone https://github.com/owner/repo.git cd repo docweave analyze
"copilot: command not found"
# Check installation
which copilot
copilot --version
# Install if needed
brew install copilot-cli
# or
npm install -g @github/copilot"Authentication required"
# Authenticate
copilot
# Then type: /login
# Or set token:
export GH_TOKEN=your_token_hereNote: DocWeave works without Copilot CLI - you'll just get fallback analysis instead of AI-powered insights.
Contributions are welcome! Please feel free to submit a Pull Request.
This project is open source and available under the MIT License.
- Built with Click for CLI
- Powered by GitHub Copilot CLI
- Uses Mermaid for diagrams
- Uses GitPython for git operations
- Inspired by Devto Challenge - 2026
Made with β€οΈ from π²π½π¨π΄ to showcase the power of GitHub Copilot CLI