Whatsun is a command-line tool and Go library for code analysis.
The primary use case is to generate a repository digest (a concise, token-efficient summary), which can be used in an LLM prompt to provide context for code-related tasks.
whatsun digest
- Generate a repository summary for LLM context, including detected technologies and the contents of key fileswhatsun analyze
- Perform detailed (rule-based) analysis and show detected frameworks, build tools, and package managerswhatsun deps
- List all dependencies found across the repository with their sources and versionswhatsun tree
- Display a concise repository file structure
- Multi-language dependency detection (Go, JavaScript, Python, Java, PHP, Ruby, Rust, and more)
- Configurable rules (using CEL expressions), which by default identify frameworks, build tools, and package managers
- Handling of Git excludes (
.gitignore
and.git/info/exclude
files) when analyzing the repository. - Fast processing including caching and parallel analysis.
- A digest structure optimized for use in an LLM context, containing:
- A token-efficient file tree.
- The reports from rule-based analysis.
- The contents of automatically selected files (filtered using
.aiignore
and.aiexclude
files, sanitized using secret detection, and truncated).
go install github.com/upsun/whatsun/cmd/whatsun@latest
go get github.com/upsun/whatsun
# Generate repository digest (using a local file path or a URL)
whatsun digest [repository]
# Analyze project structure
whatsun analyze [repository]
# List all dependencies
whatsun deps [repository]
# Show file tree
whatsun tree [repository]
Run whatsun --help
for detailed command options.
Analysis rules are defined in YAML files in the config directory using CEL expressions for pattern matching. See docs/rules.md for rule configuration details.