-
Notifications
You must be signed in to change notification settings - Fork 1
Add CLI quickstart to the welcome page #8
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
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -3,21 +3,110 @@ title: Introduction | |||||
| description: 'Welcome to the Supermodel API documentation' | ||||||
| --- | ||||||
|
|
||||||
| ## Documentation Index | ||||||
|
|
||||||
| Fetch the complete documentation index at: [https://docs.supermodeltools.com/llms.txt](https://docs.supermodeltools.com/llms.txt) | ||||||
|
|
||||||
| Use this file to discover all available pages before exploring further. | ||||||
|
|
||||||
| ## Welcome | ||||||
|
|
||||||
| Supermodel provides a unified graph representation of your codebase, enabling powerful analysis and visualization tools. | ||||||
|
|
||||||
| <Info> | ||||||
| **Try the API Playground**: Each endpoint in our API Reference includes an interactive playground. To use it, you'll need an API key from the [Supermodel Dashboard](https://dashboard.supermodeltools.com/). | ||||||
| </Info> | ||||||
|
|
||||||
| ## Where to start | ||||||
| Two ways to use it: | ||||||
|
|
||||||
| <CardGroup cols={2}> | ||||||
| <Card title="API Reference" icon="code" href="/api-reference"> | ||||||
| View the OpenAPI specification and endpoints. | ||||||
| <Card title="API" icon="code" href="/api-reference"> | ||||||
| Hit the endpoints directly. Best for SDKs, services, and CI integrations. | ||||||
| </Card> | ||||||
| <Card title="CLI" icon="terminal" href="/cli/install"> | ||||||
| Install the Supermodel CLI and start analyzing repositories from your terminal. | ||||||
| A local binary that analyzes your repo and writes graph sidecars next to your source files. Best for day-to-day work in the terminal. | ||||||
| </Card> | ||||||
| </CardGroup> | ||||||
|
|
||||||
| ## CLI quickstart | ||||||
|
|
||||||
| The fastest path: install the binary and run `setup`. The wizard authenticates you, detects your repo, offers to install the Claude Code hook, and starts the watch daemon — one command, end to end. | ||||||
|
|
||||||
| ### 1. Install | ||||||
|
|
||||||
| ```bash | ||||||
| curl -fsSL https://supermodeltools.com/install.sh | sh | ||||||
| ``` | ||||||
|
|
||||||
| Other options: `brew install supermodeltools/tap/supermodel`, `npm install -g @supermodeltools/cli`, or build from source. See [Installation](/cli/install). | ||||||
|
|
||||||
| ### 2. Run the setup wizard | ||||||
|
|
||||||
| ```bash | ||||||
| cd /path/to/your/repo | ||||||
| supermodel setup | ||||||
| ``` | ||||||
|
|
||||||
| The wizard walks four steps: | ||||||
|
|
||||||
| 1. **Authentication** — opens your browser to create an API key and saves it to `~/.supermodel/config.yaml`. | ||||||
| 2. **Repository** — detects the git root and confirms the directory. | ||||||
| 3. **Agent hook** — if Claude Code is installed, offers to add a `PostToolUse` hook so `.graph.*` files refresh on every `Write`/`Edit`. Cursor, Copilot, Windsurf, and Aider read the files directly — no hook needed. | ||||||
| 4. **Shard mode** — enables writing `.graph.*` sidecars next to your source files. | ||||||
|
|
||||||
| It then runs the watch daemon for you. Press `Ctrl+C` to stop. | ||||||
|
|
||||||
| ### 3. What you get | ||||||
|
|
||||||
| After setup runs, every source file has a sidecar with its call graph, dependencies, and blast-radius data: | ||||||
|
|
||||||
| ``` | ||||||
| src/ | ||||||
| ├── login.go | ||||||
| ├── login.graph.go ← generated | ||||||
| ├── client.go | ||||||
| └── client.graph.go ← generated | ||||||
| ``` | ||||||
|
|
||||||
| A real sidecar (excerpt from `cmd/login.graph.go` in the CLI repo itself): | ||||||
|
|
||||||
| ```go | ||||||
| //go:build ignore | ||||||
| package ignore | ||||||
| // @generated supermodel-shard — do not edit | ||||||
| // [deps] | ||||||
| // imports internal/auth/handler.go | ||||||
| // imported-by main.go | ||||||
| // [calls] | ||||||
| // init → Login internal/auth/handler.go:29 | ||||||
| // [impact] | ||||||
| // risk LOW | ||||||
| // domains CLI | ||||||
| // affects main.go | ||||||
| ``` | ||||||
|
|
||||||
| Your agent reads these via `cat` and `grep` like any other file. No prompt changes, no extra context windows. | ||||||
|
|
||||||
| ### 4. Keep it running | ||||||
|
|
||||||
| The bare `supermodel` command is the watch daemon. Run it any time you want sidecars to stay fresh as you code: | ||||||
|
|
||||||
| ```bash | ||||||
| supermodel | ||||||
| ``` | ||||||
|
|
||||||
| For one-shot analysis (no daemon), use: | ||||||
|
|
||||||
| ```bash | ||||||
| supermodel analyze | ||||||
| ``` | ||||||
|
|
||||||
| ### 5. What to do with the graph | ||||||
|
|
||||||
| Once a graph is cached, every other command reuses it instantly: | ||||||
|
|
||||||
| | Goal | Command | | ||||||
| |---|---| | ||||||
| | Find unreachable functions | `supermodel dead-code` | | ||||||
| | See what a change impacts | `supermodel blast-radius path/to/file.go` | | ||||||
| | Codebase health report | `supermodel audit` | | ||||||
| | Find usages of a symbol | `supermodel find handleRequest` | | ||||||
| | Token-efficient context for one file | `supermodel focus path/to/file.go` | | ||||||
|
|
||||||
| See the [command reference](/cli/commands/analyze) for every flag and example. | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Avoid over-promising on the command-reference link text. Line 112 says “every flag and example” but links to Suggested wording tweak-See the [command reference](/cli/commands/analyze) for every flag and example.
+See the [`analyze` command reference](/cli/commands/analyze), then use the CLI Commands section for the rest.📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||
Uh oh!
There was an error while loading. Please reload this page.