whatsun

package module
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 18, 2025 License: MIT Imports: 3 Imported by: 0

README

Whatsun

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.

Features

CLI Commands
  • whatsun digest - Generate a repository summary for LLM context, including detected technologies and the contents of key files
  • whatsun analyze - Perform detailed (rule-based) analysis and show detected frameworks, build tools, and package managers
  • whatsun deps - List all dependencies found across the repository with their sources and versions
  • whatsun tree - Display a concise repository file structure
Core Capabilities
  • 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).

Installation

CLI Tool
go install github.com/upsun/whatsun/cmd/whatsun@latest
Go Library
go get github.com/upsun/whatsun

Usage

Command Line
# 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.

Configuration

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.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoadExpressionCache

func LoadExpressionCache() (eval.Cache, error)

LoadExpressionCache provides a default eval.Cache pre-warmed cache for the embedded expressions.

func LoadRulesets

func LoadRulesets() ([]rules.RulesetSpec, error)

LoadRulesets loads default rulesets.

Types

This section is empty.

Directories

Path Synopsis
cmd
gen_docs command
validate command
warm_cache command
whatsun command
internal
fsgitignore
Package fsgitignore adapts go-git's functions for use with an io/fs filesystem.
Package fsgitignore adapts go-git's functions for use with an io/fs filesystem.
pkg
dep
Package dep provides utilities to find dependencies in the manifest files of many different package managers.
Package dep provides utilities to find dependencies in the manifest files of many different package managers.
eval
Package eval provides an Evaluator to run CEL expressions.
Package eval provides an Evaluator to run CEL expressions.
eval/celfuncs
Package celfuncs provides functions for use in a Common Expression Language (CEL) environment.
Package celfuncs provides functions for use in a Common Expression Language (CEL) environment.
rules
Package rules applies rules and combines the results.
Package rules applies rules and combines the results.
searchfs
Package searchfs provides a filesystem implementation that caches the listing of every directory accessed.
Package searchfs provides a filesystem implementation that caches the listing of every directory accessed.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL