Skip to content

Commit 747e847

Browse files
committed
README: update for unified binary, olt init/setup, Nimoy quote, MIT link
1 parent a440fa1 commit 747e847

1 file changed

Lines changed: 55 additions & 49 deletions

File tree

README.md

Lines changed: 55 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ Fix: Add 'defer delete(buf)' immediately after the allocation
2020
Download from [Releases](https://github.com/RainerXE/odintooling/releases) for your platform, then:
2121

2222
```bash
23-
./olt --install # installs to ~/.local/bin/
23+
olt setup # detects OLS, installs to ~/.local/bin/, creates symlinks
2424
```
2525

2626
### Build from source
@@ -31,17 +31,16 @@ Requires Odin `dev-2026-04` or newer.
3131
git clone --recurse-submodules https://github.com/RainerXE/odintooling
3232
cd odintooling
3333
./scripts/build.sh # → artifacts/macos-arm64/olt
34-
./scripts/build_mcp.sh # → artifacts/macos-arm64/olt-mcp (AI agent interface)
35-
./scripts/build_lsp.sh # → artifacts/macos-arm64/olt-lsp (editor interface)
3634
```
3735

3836
### First-run setup
3937

4038
```bash
41-
olt --init
39+
olt setup # full system setup: OLS detection, install, symlinks
40+
olt init # create olt.toml in a project directory
4241
```
4342

44-
Detects OLS, creates `olt.toml` with a rule profile, and installs binaries to `~/.local/bin/`.
43+
`olt init` detects if setup has been run and offers to run it first if needed.
4544

4645
---
4746

@@ -51,12 +50,14 @@ Detects OLS, creates `olt.toml` with a rule profile, and installs binaries to `~
5150
olt src/ # lint a directory (recursive)
5251
olt file.odin # lint a single file
5352
olt src/ --fix # apply safe auto-fixes in-place
54-
olt src/ --propose # show proposed fixes as a diff
5553
olt src/ --format json # machine-readable output (json or sarif)
5654
olt src/ --rule C001,C201 # run specific rules only
5755
olt src/ --tier correctness # run only correctness-tier rules
5856
olt --explain C001 # detailed rule documentation
5957
olt --list-rules # show all available rules
58+
59+
olt mcp # start MCP server (AI agent interface)
60+
olt lsp # start LSP proxy (editor interface)
6061
```
6162

6263
### Exit codes
@@ -112,7 +113,7 @@ Enable in `olt.toml`:
112113

113114
## Configuration — olt.toml
114115

115-
Place `olt.toml` at your project root (or run `olt --init` to generate one):
116+
Run `olt init` in your project directory to generate one, or create it manually:
116117

117118
```toml
118119
[domains]
@@ -128,7 +129,7 @@ c020_min_length = 3
128129
c020_allowed = "i,j,k,x,y,z,n,ok,err,db,id"
129130

130131
[tools]
131-
ols_path = "/usr/local/bin/ols" # path to OLS (if not in PATH)
132+
ols_path = "/usr/local/bin/ols_lsp" # path to OLS (if not in PATH)
132133
```
133134

134135
### Inline suppression
@@ -143,45 +144,47 @@ Legacy alias `// odin-lint:ignore` is also accepted.
143144

144145
---
145146

146-
## Editor integration — olt-lsp
147+
## Editor integration
148+
149+
`olt lsp` is an LSP proxy: your editor talks to it as the single Odin language server.
150+
It forwards everything to vanilla [OLS](https://github.com/DanielGavin/ols) (completions, hover, go-to-definition) and injects olt diagnostics into the diagnostic stream.
147151

148-
`olt-lsp` is an LSP proxy: your editor talks to it as the single Odin language server.
149-
It forwards everything to vanilla [OLS](https://github.com/DanielGavin/ols) (completions, hover, go-to-definition) and injects olt lint diagnostics into the diagnostic stream.
152+
After `olt setup`, an `ols` symlink is created pointing to `olt`. Point your editor at that symlink — no other changes needed.
150153

151154
**VS Code** (`settings.json`):
152155
```json
153-
"odin.languageServer.path": "/path/to/olt-lsp"
156+
"odin.languageServer.path": "/path/to/ols"
154157
```
155158

156159
**Helix** (`languages.toml`):
157160
```toml
158161
[[language]]
159162
name = "odin"
160-
language-servers = ["olt-lsp"]
163+
language-servers = ["ols"]
161164

162-
[language-server.olt-lsp]
163-
command = "/path/to/olt-lsp"
165+
[language-server.ols]
166+
command = "/path/to/ols"
164167
```
165168

166169
**Neovim** (lspconfig):
167170
```lua
168-
require('lspconfig').ols.setup { cmd = { '/path/to/olt-lsp' } }
171+
require('lspconfig').ols.setup { cmd = { '/path/to/ols' } }
169172
```
170173

171174
OLS must be installed separately: [github.com/DanielGavin/ols](https://github.com/DanielGavin/ols).
172-
Configure its path in `olt.toml` under `[tools] ols_path` or let olt find it via PATH.
175+
Homebrew installs it as `ols_lsp``olt setup` detects both names automatically.
173176

174177
---
175178

176-
## AI agent integration — olt-mcp
179+
## AI agent integration
177180

178-
`olt-mcp` exposes olt as an [MCP](https://modelcontextprotocol.io) server for Claude Code and other AI agents.
181+
`olt mcp` exposes olt as an [MCP](https://modelcontextprotocol.io) server for Claude Code and other AI agents.
179182

180183
Register in `~/.claude/mcp_servers.json`:
181184
```json
182185
{
183186
"mcpServers": {
184-
"olt": { "command": "/path/to/olt-mcp", "args": [] }
187+
"olt": { "command": "/path/to/olt", "args": ["mcp"] }
185188
}
186189
}
187190
```
@@ -192,16 +195,17 @@ Available MCP tools:
192195
|------|-------------|
193196
| `lint_file` | Lint a file on disk |
194197
| `lint_snippet` | Lint in-memory source text |
195-
| `lint_fix` | Apply fixes and return a before/after diff |
198+
| `lint_fix` | Return proposed fixes as JSON |
196199
| `lint_workspace` | Batch-lint a directory |
197200
| `list_rules` | Return the full rule catalog as JSON |
198201
| `run_odin_check` | Run `odin check` and return compiler diagnostics |
199-
| `codegraph_search` | Search the code knowledge graph by symbol name |
200-
| `codegraph_context` | Get relevant context for a task |
201-
| `codegraph_callers` | Find what calls a function |
202-
| `codegraph_callees` | Find what a function calls |
203-
| `codegraph_impact` | See what's affected by changing a symbol |
204-
| `codegraph_node` | Get source and metadata for a symbol |
202+
| `get_symbol` | Look up a symbol in the code graph |
203+
| `export_symbols` | Build the code knowledge graph |
204+
| `get_dna_context` | Callers, callees, memory role for a proc |
205+
| `get_impact_radius` | Transitive impact of changing a symbol |
206+
| `get_callers` / `get_callees` | Direct call graph neighbours |
207+
| `search_symbols` | Full-text symbol search |
208+
| `rename_symbol` | Generate rename patches across the project |
205209

206210
### Code knowledge graph
207211

@@ -211,46 +215,47 @@ Build a semantic graph of your project for deeper analysis:
211215
olt src/ --export-symbols
212216
```
213217

214-
This writes a SQLite database to `.codegraph/olt_graph.db` and enables:
215-
- C202 switch exhaustiveness checking
216-
- `codegraph_*` MCP tools for AI-assisted refactoring
217-
- C012 T3 graph-backed ownership analysis
218+
This writes a SQLite database to `.codegraph/olt_graph.db` and enables C202 switch exhaustiveness checking and all `get_*` / `search_symbols` MCP tools.
218219

219220
---
220221

221222
## Architecture
222223

223224
```
224-
┌─────────────┐
225-
$ olt src/ │ olt (CLI) │ analyze_file → rule pipeline
226-
└─────────────┘
225+
┌─────────────────────────────┐
226+
│ olt │
227+
│ argv[0] / subcommand │
228+
│ dispatch │
229+
└──────┬──────────┬───────────┘
230+
│ │
231+
┌────────┴──┐ ┌────┴──────┐
232+
│ olt lsp │ │ olt mcp │
233+
│ (editor) │ │ (agent) │
234+
└────────┬──┘ └───────────┘
227235
228-
shared rule engine
229-
analyze_content()
236+
shared rule engine
237+
analyze_content()
230238
231-
┌─────────────┼──────────────┐
232-
│ │ │
233-
┌──────────┐ ┌──────────┐ ┌────────────┐
234-
│ olt-lsp │ │ olt-mcp │ │ rule files │
235-
│ (editor) │ │ (agent) │ │ C001–C203 │
236-
└──────────┘ └──────────┘ └────────────┘
237-
238-
[OLS proxy]
239-
Forwards to vanilla OLS, injects lint diagnostics
239+
C001–C203 rules
240240
```
241241

242+
Symlinks created by `olt setup`:
243+
- `ols → olt` — IDE OLS integration (argv[0] dispatch → LSP mode)
244+
- `olt-lsp → olt` — backward compat
245+
- `olt-mcp → olt` — backward compat
246+
242247
---
243248

244249
## Project layout
245250

246251
```
252+
src/main.odin Unified entry point (argv[0] + subcommand dispatch)
247253
src/core/ Rule engine, CLI, config parsing, graph DB
248254
src/mcp/ MCP server tools
249-
src/lsp/ LSP proxy (olt-lsp)
255+
src/lsp/ LSP proxy
250256
ffi/tree_sitter/ Tree-sitter grammar + static libraries
251257
ffi/sqlite/ SQLite static library
252258
vendor/odin-mcp MCP protocol library (https://github.com/RainerXE/odin-mcp)
253-
vendor/odin-sqlite3 SQLite Odin bindings
254259
tests/ Rule test fixtures
255260
scripts/ Build and test scripts
256261
```
@@ -264,7 +269,6 @@ Run the full test suite before submitting:
264269
```bash
265270
./scripts/run_c001_tests.sh
266271
./scripts/run_c002_tests.sh
267-
./scripts/run_c029_c033_tests.sh
268272
# ... see scripts/run_*.sh for all rule suites
269273
./artifacts/macos-arm64/olt src/ # must produce 0 violations
270274
```
@@ -273,4 +277,6 @@ Run the full test suite before submitting:
273277

274278
## License
275279

276-
MIT
280+
[MIT](https://en.wikipedia.org/wiki/MIT_License)
281+
282+
> "The miracle is this: The more we share the more we have." — Leonard Nimoy

0 commit comments

Comments
 (0)