-
Notifications
You must be signed in to change notification settings - Fork 1
Add CLI documentation tab #7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,40 @@ | ||
| --- | ||
| title: 'analyze' | ||
| description: 'Upload a repository and run the full analysis pipeline' | ||
| --- | ||
|
|
||
| Archives the repository, uploads it to the Supermodel API, and runs call graph generation, dependency analysis, and domain classification. Results are cached locally by content hash. Subsequent commands (`dead-code`, `blast-radius`, `graph`) reuse the cache automatically. | ||
|
|
||
| By default, `.graph.*` shard files are written next to each source file. Pass `--no-shards` to skip writing graph files. | ||
|
|
||
| ## Synopsis | ||
|
|
||
| ```bash | ||
| supermodel analyze [path] [flags] | ||
| ``` | ||
|
|
||
| ## Flags | ||
|
|
||
| | Flag | Description | | ||
| |---|---| | ||
| | `--three-file` | Generate `.calls`/`.deps`/`.impact` files instead of a single `.graph` | | ||
| | `--no-shards` | Skip writing `.graph.*` shard files | | ||
| | `--force` | Re-analyze even if a cached result exists | | ||
| | `-o, --output` | Output format: `human` \| `json` | | ||
| | `-h, --help` | Help for analyze | | ||
|
|
||
| ## Examples | ||
|
|
||
| ```bash | ||
| # Analyze the current directory | ||
| supermodel analyze | ||
|
|
||
| # Generate three-file shards (recommended) | ||
| supermodel analyze --three-file | ||
|
|
||
| # Re-analyze without using the cache, output JSON | ||
| supermodel analyze --force -o json | ||
|
|
||
| # Run analysis without writing sidecar files | ||
| supermodel analyze --no-shards | ||
| ``` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| --- | ||
| title: 'audit' | ||
| description: 'Codebase health report from graph intelligence' | ||
| --- | ||
|
|
||
| Analyses the codebase via the Supermodel API and produces a structured Markdown health report covering: | ||
|
|
||
| - Overall status (HEALTHY / DEGRADED / CRITICAL) | ||
| - Circular dependency detection | ||
| - Domain coupling metrics and high-coupling domains | ||
| - High blast-radius files | ||
| - Prioritised recommendations | ||
|
|
||
| ## Synopsis | ||
|
|
||
| ```bash | ||
| supermodel audit [flags] | ||
| ``` | ||
|
|
||
| ## Flags | ||
|
|
||
| | Flag | Description | | ||
| |---|---| | ||
| | `--dir` | Project directory (default: current working directory) | | ||
| | `-h, --help` | Help for audit | | ||
|
|
||
| ## Examples | ||
|
|
||
| ```bash | ||
| supermodel audit | ||
| supermodel audit --dir ./path/to/project | ||
| ``` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,45 @@ | ||
| --- | ||
| title: 'blast-radius' | ||
| description: 'Analyze the impact of changing a file or function' | ||
| --- | ||
|
|
||
| Uploads the repository to the Supermodel API and runs impact analysis using call graph and dependency graph reachability. Results include risk scoring, affected files and functions, and entry points that would be impacted by changes to the target. | ||
|
|
||
| **Aliases:** `br`, `impact` | ||
|
|
||
| ## Synopsis | ||
|
|
||
| ```bash | ||
| supermodel blast-radius [file...] [flags] | ||
| ``` | ||
|
|
||
| Three usage modes: | ||
|
|
||
| ```bash | ||
| supermodel blast-radius <file> # analyze a specific file | ||
| supermodel blast-radius --diff changes.diff # analyze from a git diff | ||
| supermodel blast-radius # global coupling map | ||
| ``` | ||
|
|
||
| ## Flags | ||
|
|
||
| | Flag | Description | | ||
| |---|---| | ||
| | `--diff` | Path to a unified diff file (git diff output) | | ||
| | `--force` | Re-analyze even if a cached result exists | | ||
| | `-o, --output` | Output format: `human` \| `json` | | ||
| | `-h, --help` | Help for blast-radius | | ||
|
|
||
| ## Examples | ||
|
|
||
| ```bash | ||
| # Impact of changing one file | ||
| supermodel blast-radius internal/api/client.go | ||
|
|
||
| # Impact of a pending PR | ||
| git diff main...HEAD > /tmp/pr.diff | ||
| supermodel blast-radius --diff /tmp/pr.diff | ||
|
|
||
| # Global coupling map (no target) | ||
| supermodel blast-radius -o json | ||
| ``` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| --- | ||
| title: 'clean' | ||
| description: 'Remove all .graph.* files from the repository' | ||
| --- | ||
|
|
||
| Removes every `.graph.*` sidecar file from the repository. | ||
|
|
||
| ## Synopsis | ||
|
|
||
| ```bash | ||
| supermodel clean [path] [flags] | ||
| ``` | ||
|
|
||
| ## Flags | ||
|
|
||
| | Flag | Description | | ||
| |---|---| | ||
| | `--dry-run` | Show what would be removed without removing | | ||
| | `-h, --help` | Help for clean | | ||
|
|
||
| ## Examples | ||
|
|
||
| ```bash | ||
| supermodel clean | ||
| supermodel clean --dry-run | ||
| supermodel clean ./my-project | ||
| ``` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,39 @@ | ||
| --- | ||
| title: 'compact' | ||
| description: 'Reduce token usage of source code while preserving semantics' | ||
| --- | ||
|
|
||
| Strips comments, removes blank lines, and shortens local identifiers to produce token-efficient source code that remains syntactically valid and semantically identical (all tests still pass). | ||
|
|
||
| Supports Go, Python, TypeScript, JavaScript, and Rust. | ||
|
|
||
| For a single file, compacted output is written to stdout. For a directory, files are written to `--output` (default: `./compacted/`). | ||
|
|
||
| **Aliases:** `pack`, `minify` | ||
|
|
||
| ## Synopsis | ||
|
|
||
| ```bash | ||
| supermodel compact [path] [flags] | ||
| ``` | ||
|
|
||
| ## Flags | ||
|
|
||
| | Flag | Description | | ||
| |---|---| | ||
| | `-o, --output` | Output directory for directory mode (default `compacted`) | | ||
| | `--dry-run` | Print stats without writing files | | ||
| | `-h, --help` | Help for compact | | ||
|
|
||
| ## Examples | ||
|
|
||
| ```bash | ||
| # Single file → stdout | ||
| supermodel compact internal/api/client.go | ||
|
|
||
| # Whole repo → ./compacted/ | ||
| supermodel compact . | ||
|
|
||
| # See savings without writing | ||
| supermodel compact --dry-run . | ||
| ``` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,39 @@ | ||
| --- | ||
| title: 'dead-code' | ||
| description: 'Find unreachable functions using static analysis' | ||
| --- | ||
|
|
||
| Uploads the repository to the Supermodel API and runs multi-phase dead code analysis including call graph reachability, entry point detection, and transitive propagation. Results include confidence levels (high/medium/low), line numbers, and explanations for why each function was flagged. | ||
|
|
||
| **Aliases:** `dc` | ||
|
|
||
| ## Synopsis | ||
|
|
||
| ```bash | ||
| supermodel dead-code [path] [flags] | ||
| ``` | ||
|
|
||
| ## Flags | ||
|
|
||
| | Flag | Description | | ||
| |---|---| | ||
| | `--min-confidence` | Minimum confidence: `high`, `medium`, or `low` | | ||
| | `--limit` | Maximum number of candidates to return | | ||
| | `--ignore` | Glob pattern to exclude (repeatable, supports `**`) | | ||
| | `--timeout` | Maximum seconds to wait (default `7200`, `0` = no limit) | | ||
| | `--force` | Re-analyze even if a cached result exists | | ||
| | `-o, --output` | Output format: `human` \| `json` | | ||
| | `-h, --help` | Help for dead-code | | ||
|
|
||
| ## Examples | ||
|
|
||
| ```bash | ||
| # High-confidence candidates only | ||
| supermodel dead-code --min-confidence high | ||
|
|
||
| # Top 20 results, JSON output | ||
| supermodel dead-code --limit 20 -o json | ||
|
|
||
| # Skip vendored and generated code | ||
| supermodel dead-code --ignore '**/vendor/**' --ignore '**/*_pb.go' | ||
| ``` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,40 @@ | ||
| --- | ||
| title: 'docs' | ||
| description: 'Generate static architecture documentation for a repository' | ||
| --- | ||
|
|
||
| Generates a static HTML site documenting the architecture of a codebase. The command uploads the repository to the Supermodel API, converts the returned code graph to markdown, and builds a browsable static site with search, dependency graphs, taxonomy navigation, and SEO metadata. The site also emits machine-readable artifacts (JSON-LD and `LLMS.txt`) alongside the HTML. | ||
|
|
||
| The output directory can be served locally or deployed to any static host (GitHub Pages, Vercel, Netlify, Cloudflare Pages). | ||
|
|
||
| ## Synopsis | ||
|
|
||
| ```bash | ||
| supermodel docs [path] [flags] | ||
| ``` | ||
|
|
||
| ## Flags | ||
|
|
||
| | Flag | Description | | ||
| |---|---| | ||
| | `-o, --output` | Output directory (default `./docs-output`) | | ||
| | `--repo` | GitHub repo slug `owner/repo` for source links | | ||
| | `--base-url` | Canonical base URL where the site will be hosted (default `https://example.com`) | | ||
| | `--site-name` | Display title for the generated site (default `<repo> Architecture Docs`) | | ||
| | `--max-entities` | Cap on entity pages (default `12000`, `0` = unlimited) | | ||
| | `--max-source-files` | Cap on source files in analysis (default `3000`, `0` = unlimited) | | ||
| | `--templates-dir` | Override bundled HTML/CSS/JS templates with a custom directory | | ||
| | `--force` | Bypass cache and re-upload even if a cached result exists | | ||
| | `-h, --help` | Help for docs | | ||
|
|
||
| ## Examples | ||
|
|
||
| ```bash | ||
| supermodel docs | ||
|
|
||
| supermodel docs ./my-project --output ./docs-site | ||
|
|
||
| supermodel docs --repo owner/repo --base-url https://owner.github.io/repo | ||
|
|
||
| supermodel docs --site-name "My App Docs" --output /var/www/html | ||
| ``` | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| --- | ||
| title: 'find' | ||
| description: 'Find usages and callers of a symbol across the codebase' | ||
| --- | ||
|
|
||
| Searches the graph for all nodes matching the given symbol name (substring match, case-insensitive) and prints their call relationships. | ||
|
|
||
| Similar to "Find Usages" in IDEs — without requiring a language server. | ||
|
|
||
| ## Synopsis | ||
|
|
||
| ```bash | ||
| supermodel find <symbol> [flags] | ||
| ``` | ||
|
|
||
| ## Flags | ||
|
|
||
| | Flag | Description | | ||
| |---|---| | ||
| | `--kind` | Filter by node label: `Function`, `File`, `Class`, … | | ||
| | `--force` | Re-analyze even if cache is fresh | | ||
| | `-o, --output` | Output format: `human` \| `json` | | ||
| | `-h, --help` | Help for find | | ||
|
|
||
| ## Examples | ||
|
|
||
| ```bash | ||
| # Find anything containing this name | ||
| supermodel find handleRequest | ||
|
|
||
| # Restrict to classes | ||
| supermodel find Client --kind Class | ||
|
|
||
| # JSON output for tool consumption | ||
| supermodel find parse -o json | ||
| ``` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,38 @@ | ||
| --- | ||
| title: 'focus' | ||
| description: 'Token-efficient graph slice for a single file' | ||
| --- | ||
|
|
||
| Extracts the minimal graph context relevant to the given file: direct imports, functions defined, callers, and (optionally) type declarations. | ||
|
|
||
| Output is structured markdown for direct injection into LLM context windows, keeping token usage minimal while preserving semantic relevance. Use `--output json` for structured consumption by tools. | ||
|
|
||
| **Aliases:** `ctx`, `context` | ||
|
|
||
| ## Synopsis | ||
|
|
||
| ```bash | ||
| supermodel focus <file> [flags] | ||
| ``` | ||
|
|
||
| ## Flags | ||
|
|
||
| | Flag | Description | | ||
| |---|---| | ||
| | `--depth` | Import traversal depth (default `1`) | | ||
| | `--types` | Include type/class declarations | | ||
| | `--force` | Re-analyze even if cache is fresh | | ||
| | `-o, --output` | Output format: `markdown` \| `json` (default `markdown`) | | ||
| | `-h, --help` | Help for focus | | ||
|
|
||
| ## Examples | ||
|
|
||
| ```bash | ||
| supermodel focus internal/api/client.go | ||
|
|
||
| # Walk imports two hops deep, include types | ||
| supermodel focus internal/api/client.go --depth 2 --types | ||
|
|
||
| # JSON for tool consumption | ||
| supermodel focus internal/api/client.go -o json | ||
| ``` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,37 @@ | ||
| --- | ||
| title: 'graph' | ||
| description: 'Display the repository graph' | ||
| --- | ||
|
|
||
| Fetches or loads the cached graph and renders it in one of three formats: | ||
|
|
||
| - `human` — aligned table of nodes (default) | ||
| - `json` — full graph as JSON | ||
| - `dot` — Graphviz DOT for use with `dot`/`graphviz` | ||
|
|
||
| ## Synopsis | ||
|
|
||
| ```bash | ||
| supermodel graph [path] [flags] | ||
| ``` | ||
|
|
||
| ## Flags | ||
|
|
||
| | Flag | Description | | ||
| |---|---| | ||
| | `--label` | Filter nodes by label (`File`, `Function`, `Class`, …) | | ||
| | `--force` | Re-analyze even if a cached result exists | | ||
| | `-o, --output` | Output format: `human` \| `json` \| `dot` (default `human`) | | ||
| | `-h, --help` | Help for graph | | ||
|
|
||
| ## Examples | ||
|
|
||
| ```bash | ||
| supermodel graph | ||
|
|
||
| # Only files | ||
| supermodel graph --label File | ||
|
|
||
| # Render with Graphviz | ||
| supermodel graph -o dot | dot -Tsvg > graph.svg | ||
| ``` |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Capitalize “Markdown” (proper noun).
Line [6] says “converts … to markdown”. For consistency/style (and per typical doclint expectations), it should be “Markdown”.
✅ Proposed fix
📝 Committable suggestion
🧰 Tools
🪛 LanguageTool
[uncategorized] ~6-~6: Did you mean the formatting language “Markdown” (= proper noun)?
Context: ...PI, converts the returned code graph to markdown, and builds a browsable static site wit...
(MARKDOWN_NNP)
🤖 Prompt for AI Agents