Skip to content

Commit c8e176b

Browse files
Add CLI quickstart to the welcome page
Verified against the actual CLI: ran 'supermodel analyze' on the cli repo (3207 nodes cached, 178 source files → 151 .graph.* sidecars) and inspected a real sidecar from cmd/login.graph.go. The quickstart leads with 'supermodel setup' because the wizard handles the entire onboarding in one command — auth → repo detect → hook offer → starts the watch daemon. Then shows what a real .graph.go sidecar looks like, and lists the common follow-up commands (dead-code, blast-radius, audit, find, focus).
1 parent 414f936 commit c8e176b

1 file changed

Lines changed: 97 additions & 8 deletions

File tree

index.mdx

Lines changed: 97 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,110 @@ title: Introduction
33
description: 'Welcome to the Supermodel API documentation'
44
---
55

6+
## Documentation Index
7+
8+
Fetch the complete documentation index at: [https://docs.supermodeltools.com/llms.txt](https://docs.supermodeltools.com/llms.txt)
9+
10+
Use this file to discover all available pages before exploring further.
11+
612
## Welcome
713

814
Supermodel provides a unified graph representation of your codebase, enabling powerful analysis and visualization tools.
915

10-
<Info>
11-
**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/).
12-
</Info>
13-
14-
## Where to start
16+
Two ways to use it:
1517

1618
<CardGroup cols={2}>
17-
<Card title="API Reference" icon="code" href="/api-reference">
18-
View the OpenAPI specification and endpoints.
19+
<Card title="API" icon="code" href="/api-reference">
20+
Hit the endpoints directly. Best for SDKs, services, and CI integrations.
1921
</Card>
2022
<Card title="CLI" icon="terminal" href="/cli/install">
21-
Install the Supermodel CLI and start analyzing repositories from your terminal.
23+
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.
2224
</Card>
2325
</CardGroup>
26+
27+
## CLI quickstart
28+
29+
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.
30+
31+
### 1. Install
32+
33+
```bash
34+
curl -fsSL https://supermodeltools.com/install.sh | sh
35+
```
36+
37+
Other options: `brew install supermodeltools/tap/supermodel`, `npm install -g @supermodeltools/cli`, or build from source. See [Installation](/cli/install).
38+
39+
### 2. Run the setup wizard
40+
41+
```bash
42+
cd /path/to/your/repo
43+
supermodel setup
44+
```
45+
46+
The wizard walks four steps:
47+
48+
1. **Authentication** — opens your browser to create an API key and saves it to `~/.supermodel/config.yaml`.
49+
2. **Repository** — detects the git root and confirms the directory.
50+
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.
51+
4. **Shard mode** — enables writing `.graph.*` sidecars next to your source files.
52+
53+
It then runs the watch daemon for you. Press `Ctrl+C` to stop.
54+
55+
### 3. What you get
56+
57+
After setup runs, every source file has a sidecar with its call graph, dependencies, and blast-radius data:
58+
59+
```
60+
src/
61+
├── login.go
62+
├── login.graph.go ← generated
63+
├── client.go
64+
└── client.graph.go ← generated
65+
```
66+
67+
A real sidecar (excerpt from `cmd/login.graph.go` in the CLI repo itself):
68+
69+
```go
70+
//go:build ignore
71+
package ignore
72+
// @generated supermodel-shard — do not edit
73+
// [deps]
74+
// imports internal/auth/handler.go
75+
// imported-by main.go
76+
// [calls]
77+
// init → Login internal/auth/handler.go:29
78+
// [impact]
79+
// risk LOW
80+
// domains CLI
81+
// affects main.go
82+
```
83+
84+
Your agent reads these via `cat` and `grep` like any other file. No prompt changes, no extra context windows.
85+
86+
### 4. Keep it running
87+
88+
The bare `supermodel` command is the watch daemon. Run it any time you want sidecars to stay fresh as you code:
89+
90+
```bash
91+
supermodel
92+
```
93+
94+
For one-shot analysis (no daemon), use:
95+
96+
```bash
97+
supermodel analyze
98+
```
99+
100+
### 5. What to do with the graph
101+
102+
Once a graph is cached, every other command reuses it instantly:
103+
104+
| Goal | Command |
105+
|---|---|
106+
| Find unreachable functions | `supermodel dead-code` |
107+
| See what a change impacts | `supermodel blast-radius path/to/file.go` |
108+
| Codebase health report | `supermodel audit` |
109+
| Find usages of a symbol | `supermodel find handleRequest` |
110+
| Token-efficient context for one file | `supermodel focus path/to/file.go` |
111+
112+
See the [command reference](/cli/commands/analyze) for every flag and example.

0 commit comments

Comments
 (0)