Repository analysis tool that generates AI-friendly documentation
Project description
SourceSage
๏ฝTransforming code for AI๏ฝ
[๐ Website] โข [๐ฑ GitHub] [๐ฆ Twitter] โข [๐ Official Blog]
ๆฅๆฌ่ช | English
SourceSage is a tool that comprehensively analyzes repository structure and content to generate AI-friendly documentation. It primarily provides Repository_summary.md generation and RELEASE_REPORT creation features.
[!IMPORTANT] Nearly 90% of the release notes, README, and commit messages in this repository are generated using AIRA, SourceSage, Gaiah, and HarmonAI_II with claude.ai and ChatGPT4.
๐ Related Projects
SourceSage MCP Server
SourceSage MCP Server is a derived version of SourceSage that integrates with the Model Context Protocol (MCP). It enables AI assistants like Claude Desktop to directly access repository analysis capabilities.
Release Notes
For the latest updates, please visit our GitHub releases page.
https://github.com/Sunwood-ai-labs/SourceSage/releases
๐ฏ Key Features
SourceSage is a simple and lightweight repository analysis tool that provides two main features:
1. ๐ Repository Summary Generation
Comprehensively analyzes repository structure, commit information, and file statistics to generate AI-friendly markdown documentation.
Output File: .SourceSageAssets/Repository_summary.md
Included Information:
- ๐ณ Project tree structure
- ๐ Git repository information
- ๐ File size and line count statistics
- ๐ Detailed file contents
2. ๐ Release Report Generation (Optional Feature - Deprecated)
โ ๏ธ Deprecated Feature: This feature will be removed in a future release. With improvements in LLM command execution capabilities, automatic diff report generation is becoming unnecessary.
Analyzes differences between Git tags to automatically generate release reports (enabled with --diff flag).
Output File: .SourceSageAssets/RELEASE_REPORT/Report_{latest_tag}.md
Included Information:
- ๐ท๏ธ Version comparison
- ๐ Detailed change differences
- ๐ Commit history
- ๐ Repository basic information (remote URL, branch, latest commit, etc.)
- ๐ README content (optional)
๐ Quick Start
๐ฆ Installation (Fastest)
git clone https://github.com/Sunwood-ai-labs/SourceSage.git
cd SourceSage
uv sync
uv run sage
Note: When using as a package, run pip install sourcesage then execute sage (or sourcesage).
๐บ๏ธ Basic Usage (Minimum Required)
# Generate repository summary (default: uses .gitignore)
uv run sage
# Use/generate .SourceSageignore file
uv run sage --use-ignore
# Generate release report (optional - deprecated)
uv run sage --diff
Output locations:
- Repository Summary:
.SourceSageAssets/Repository_summary.md - Release Report:
.SourceSageAssets/RELEASE_REPORT/Report_{latest_tag}.md(only with--diff)
Frequently used options (excerpt):
uv run sage -o ./out # Change output destination
uv run sage --ignore-file .gitignore # Specify ignore rules (default)
uv run sage --use-ignore # Use/generate .SourceSageignore
uv run sage --diff # Generate diff report (deprecated)
Notes:
- From v7.2.0,
.gitignoreis used by default. Use--use-ignoreif you need a custom ignore file. - When
--language-mapis omitted, the included defaults (sourcesage/config/) are automatically used. - Release Report is generated when there are 2 or more tags (only with
--diff).
๐ Upgrade
# If installed via PyPI
pip install --upgrade sourcesage
# If installed via git clone
git pull origin main
# If using uv with local clone
uv sync
๐ Troubleshooting
uvx cache issues
If uvx sourcesage is using an outdated version, clear the cache:
# Force refresh (recommended)
uvx --refresh sourcesage --repo tmp
# Clear all uv cache
uv cache clean
# Clear specific package cache
uv cache clean sourcesage
# Run without cache
uvx --no-cache sourcesage --repo tmp
Cache management
# Check cache size
uv cache size
# Show cache directory
uv cache dir
# Prune unused cache
uv cache prune
๐ Example Generated Content
Repository Summary
# Project: SourceSage
```plaintext
OS: posix
Directory: /path/to/project
โโโ .SourceSageignore
โโโ pyproject.toml
โโโ sourcesage/
โ โโโ __init__.py
โ โโโ cli.py
โ โโโ modules/
โ โโโ DocuSum/
โ โโโ DiffReport/
โ โโโ __init__.py
โ โโโ git_diff.py
โ โโโ markdown_report.py
โโโ README.md
```
## ๐ Project Statistics
- ๐
Created: 2025-02-02 16:22:31
- ๐ Total directories: 5
- ๐ Total files: 15
- ๐ Max depth: 3
### ๐ File Size and Line Count
| File | Size | Lines | Language |
|------|------|-------|----------|
| pyproject.toml | 1.2 KB | 30 | TOML |
| **Total** | | **1234** | |
### ๐ Language Statistics
| Language | Files | Total Lines | Total Size |
|----------|-------|-------------|-----------|
| Python | 15 | 1234 | 45.6 KB |
| Markdown | 3 | 150 | 5.2 KB |
๐ ๏ธ Development Environment
SourceSage supports modern Python development environments:
- Python: 3.8 or later
- Package Management: uv / pip
- Build System: hatchling
- Configuration File: pyproject.toml
Development Setup
# Development environment setup using uv
git clone https://github.com/Sunwood-ai-labs/SourceSage.git
cd SourceSage
uv sync
# Run tests
uv run pytest
# Code formatting
uv run black sourcesage/
uv run isort sourcesage/
# Build package
uv build
๐ก Usage Examples
# 1) Output repository summary (default: uses .gitignore)
uv run sage
# 2) Output summary using .SourceSageignore
uv run sage --use-ignore
# 3) Generate diff report (deprecated feature)
uv run sage --diff
# 4) Change output destination
uv run sage -o ./analysis
Contributing
Help us improve SourceSage! If you have bug reports or feature suggestions, please open an issue or submit a pull request at our GitHub repository.
License
This project is released under the MIT License.
Official Links & Verification (SSAGE)
- Orynth project: https://www.orynth.dev/projects/sourcesage
- GitHub repo: https://github.com/Sunwood-ai-labs/SourceSage
SSAGE (Solana mint):
1QaAfN81sYjenLGeiPa9NW1s6FND4A36R3ASKKxVory
Primary pool (SSAGE/USDC, Meteora): https://www.geckoterminal.com/solana/pools/A4oHVtJxGRRYvqfRuUGPwfxFVdBmPJnYZtcqew5Y8HoH
Dexscreener: https://dexscreener.com/solana/a4ohvtjxgrryvqfruugpwfxfvdbmpjnyztcqew5y8hoh
Note: SSAGE is a community market token/identifier for the SourceSage project on Orynth. It is not equity, ownership, or a claim on the project. No investment advice.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file sourcesage-7.2.2.tar.gz.
File metadata
- Download URL: sourcesage-7.2.2.tar.gz
- Upload date:
- Size: 27.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
eae05865c091dff1f5a7320d780f6765479a8148f2a2fe3fb6c61193c34f1097
|
|
| MD5 |
9acde9d0d96fcb444920807a7bffed33
|
|
| BLAKE2b-256 |
cd8e2da67f82fba6bc93763669aca9d01f0854373f9950104343f8c6bcd7f680
|
Provenance
The following attestation bundles were made for sourcesage-7.2.2.tar.gz:
Publisher:
publish-to-pypi.yml on Sunwood-ai-labs/SourceSage
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
sourcesage-7.2.2.tar.gz -
Subject digest:
eae05865c091dff1f5a7320d780f6765479a8148f2a2fe3fb6c61193c34f1097 - Sigstore transparency entry: 842535408
- Sigstore integration time:
-
Permalink:
Sunwood-ai-labs/SourceSage@dc38f72830f3e94f0abd2e93585b23bee0421747 -
Branch / Tag:
refs/tags/v7.2.2 - Owner: https://github.com/Sunwood-ai-labs
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-to-pypi.yml@dc38f72830f3e94f0abd2e93585b23bee0421747 -
Trigger Event:
push
-
Statement type:
File details
Details for the file sourcesage-7.2.2-py3-none-any.whl.
File metadata
- Download URL: sourcesage-7.2.2-py3-none-any.whl
- Upload date:
- Size: 36.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
97bf48daf549c835404e6e182fbd113e498add56521dc493fabd9c58193a4d02
|
|
| MD5 |
0154a35e2d78744394eecf9d03e39471
|
|
| BLAKE2b-256 |
f838a46a1b280f169ddf9c4e19572b0dc55146e274ee9d54adf7595e5d812e29
|
Provenance
The following attestation bundles were made for sourcesage-7.2.2-py3-none-any.whl:
Publisher:
publish-to-pypi.yml on Sunwood-ai-labs/SourceSage
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
sourcesage-7.2.2-py3-none-any.whl -
Subject digest:
97bf48daf549c835404e6e182fbd113e498add56521dc493fabd9c58193a4d02 - Sigstore transparency entry: 842535421
- Sigstore integration time:
-
Permalink:
Sunwood-ai-labs/SourceSage@dc38f72830f3e94f0abd2e93585b23bee0421747 -
Branch / Tag:
refs/tags/v7.2.2 - Owner: https://github.com/Sunwood-ai-labs
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-to-pypi.yml@dc38f72830f3e94f0abd2e93585b23bee0421747 -
Trigger Event:
push
-
Statement type: