Navegador

navegador / docs / getting-started / quickstart.md
1
# Quick Start
2
3
This guide walks from a fresh install to a fully wired agent integration in five steps.
4
5
---
6
7
## Step 1: Install
8
9
```bash
10
pip install navegador
11
navegador --version
12
```
13
14
Python 3.12+ is required. For additional languages (Kotlin, C#, PHP, Ruby, Swift, C, C++) install the `[languages]` extra. See [Installation](installation.md) for all extras and Redis setup.
15
16
---
17
18
## Step 2: Ingest a repo
19
20
Point navegador at any local source tree:
21
22
```bash
23
navegador ingest ./my-repo
24
```
25
26
On first run this builds the graph from scratch. Re-run anytime to pick up changes. Use `--incremental` to skip files that haven't changed (based on content hashing — much faster on large repos):
27
28
```bash
29
navegador ingest ./my-repo --incremental
30
```
31
32
Use `--watch` to keep the graph in sync as files change:
33
34
```bash
35
navegador ingest ./my-repo --watch
36
```
37
38
Use `--clear` to wipe and rebuild from scratch:
39
40
```bash
41
navegador ingest ./my-repo --clear
42
```
43
44
Use `--json` to get a machine-readable summary of what was indexed:
45
46
```bash
47
navegador ingest ./my-repo --json
48
```
49
50
Navegador walks the tree, parses source files in 13 languages with tree-sitter, and writes nodes and edges for: files, modules, classes, functions, methods, imports, decorators, and call relationships. Framework enrichers automatically detect and annotate Django models, FastAPI routes, React components, Rails controllers, Spring Boot beans, and more.
51
52
---
53
54
## Step 3: Query the graph
55
56
**Explain anything by name** — works for functions, classes, files, concepts, rules, and decisions:
57
58
```bash
59
navegador explain AuthService
60
navegador explain validate_token
61
navegador explain src/payments/processor.py
62
```
63
64
**Search across code and knowledge together:**
65
66
```bash
67
navegador search "rate limit" --all
68
navegador search "authentication" --docs --limit 10
69
```
70
71
**Inspect a function** (callers, callees, decorators, source):
72
73
```bash
74
navegador function validate_token
75
navegador function validate_token --depth 2 --format json
76
```
77
78
**Inspect a class** (hierarchy, methods, references):
79
80
```bash
81
navegador class PaymentProcessor
82
navegador class PaymentProcessor --format json
83
```
84
85
---
86
87
## Step 4: Add business knowledge
88
89
Code alone doesn't capture *why*. Add concepts, rules, and decisions and link them to code.
90
91
**Add a concept:**
92
93
```bash
94
navegador add concept "Idempotency" \
95
--desc "Operations that can be retried safely without side effects" \
96
--domain Payments
97
```
98
99
**Add a rule:**
100
101
```bash
102
navegador add rule "PaymentsMustBeIdempotent" \
103
--desc "All payment endpoints must handle duplicate submissions" \
104
--domain Payments \
105
--severity critical \
106
--rationale "Card networks retry on timeout; double-charging causes chargebacks"
107
```
108
109
**Annotate code with a concept or rule:**
110
111
```bash
112
navegador annotate process_payment \
113
--type Function \
114
--concept Idempotency \
115
--rule PaymentsMustBeIdempotent
116
```
117
118
**Add a decision:**
119
120
```bash
121
navegador add decision "UseStripeForPayments" \
122
--desc "Stripe is the primary payment processor" \
123
--domain Payments \
124
--rationale "Best fraud tooling for SaaS" \
125
--alternatives "Braintree, Adyen" \
126
--date 2025-01-15 \
127
--status accepted
128
```
129
130
Now `navegador explain process_payment` returns code structure *and* the rules that govern it.
131
132
---
133
134
## Step 5: Wire an agent hook
135
136
Use the bootstrap script to ingest your repo and install the hook for your AI coding assistant in one command:
137
138
```bash
139
./bootstrap.sh --repo owner/repo --wiki --agent claude
140
```
141
142
Options:
143
144
| Flag | Effect |
145
|---|---|
146
| `--repo owner/repo` | GitHub repo to clone + ingest |
147
| `--wiki` | Also ingest the GitHub wiki |
148
| `--agent claude` | Install `.claude/hooks/claude-hook.py` |
149
| `--agent gemini` | Install `.gemini/hooks/gemini-hook.py` |
150
| `--agent openai` | Install `openai-hook.py` + `openai-tools.json` |
151
152
After bootstrap, every file the agent edits triggers a re-ingest so the graph stays in sync. See [Agent Hooks](../guide/agent-hooks.md) for manual setup and the `NAVEGADOR.md` template.
153
154
---
155
156
## Step 6 (optional): SDK quick start
157
158
All CLI functionality is available through the Python SDK:
159
160
```python
161
from navegador import Navegador
162
163
nav = Navegador(".navegador/navegador.db")
164
165
# ingest (incremental by default in SDK)
166
nav.ingest("./my-repo", incremental=True)
167
168
# query
169
bundle = nav.explain("AuthService")
170
print(bundle.to_markdown())
171
172
# analysis
173
impact = nav.impact("validate_token")
174
churn = nav.churn(days=30)
175
cycles = nav.cycles()
176
```
177
178
The `Navegador` class wraps `GraphStore`, `ContextLoader`, all ingesters, and the analysis commands into one interface.
179
180
---
181
182
## Step 7 (optional): Code analysis
183
184
Once the graph is populated, use the analysis commands to understand your codebase:
185
186
```bash
187
# impact of changing a function
188
navegador impact validate_token
189
190
# trace execution flow
191
navegador trace process_payment --depth 3
192
193
# find dead code
194
navegador deadcode
195
196
# detect dependency cycles
197
navegador cycles
198
199
# map tests to source files
200
navegador testmap
201
202
# code churn (files that change most)
203
navegador churn --days 30
204
205
# diff — what changed between two refs
206
navegador diff HEAD~1 HEAD
207
```
208

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button