@niroai/niro 0.3.0 → 0.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -5,16 +5,34 @@ The command-line tool **and** MCP server for [Niro](https://niroai.dev) — the
5
5
  One package gives you three things:
6
6
 
7
7
  1. **`niro` CLI** — onboard repos, build the code graph, and manage projects from the terminal.
8
- 2. **A Niro MCP server** — lets an AI assistant answer questions about *your* codebase using Niro's graph. 14 clients supported (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, GitHub Copilot CLI, Factory, Goose, OpenCode, Cline, Kiro, Antigravity, Claude Desktop) — see **[docs/connect-your-ai-assistant.md](docs/connect-your-ai-assistant.md)** for the exact command per client.
8
+ 2. **A Niro MCP server** — lets an AI assistant answer questions about *your* codebase using Niro's graph. 14 clients supported (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, GitHub Copilot CLI, Factory, Goose, OpenCode, Cline, Kiro, Antigravity, Claude Desktop) — see **[docs/connect-your-ai-assistant.md](https://unpkg.com/@niroai/niro/docs/connect-your-ai-assistant.md)** for the exact command per client.
9
9
  3. **Two agent skills** (installed by `niro mcp install`) so you can drive Niro from chat in plain English instead of typing CLI commands:
10
10
  - **`niro-skill`** — answers questions about your code (structure, call chains, blast radius) using the Niro MCP tools.
11
11
  - **`niro-cli`** — runs the CLI for you (onboard, status, rebuild, edit env vars, remove) from a conversation.
12
12
 
13
13
  > **Two ways to do everything:** every task below shows the **terminal** command *and* how you'd **ask the agent**. Pick whichever you prefer — they call the same code.
14
14
 
15
- > **Working on a feature branch?** Niro indexes one branch per repo, but it follows *your* branch
16
- > and uncommitted edits through **temporary projects** — see
17
- > **[docs/working-on-branches.md](docs/working-on-branches.md)** for how that works in plain words.
15
+ ## Working on branches
16
+
17
+ Niro indexes your team's code from one branch (usually main). When you work on a feature
18
+ branch, Niro notices and refuses to answer from the old code. Your assistant will offer the fix:
19
+
20
+ ```bash
21
+ niro new-temp-project # run once in the repo folder
22
+ ```
23
+
24
+ This creates your own private copy of the project that follows your branch and your
25
+ uncommitted edits, live (keep `niro watch` running). Teammates are not affected and cannot
26
+ see your copy. Switching branches needs nothing: Niro answers from your copy on the feature
27
+ branch and from the shared project on main. When your branch is merged:
28
+
29
+ ```bash
30
+ niro discard-temp-project
31
+ ```
32
+
33
+ If you forget, idle copies are cleaned up automatically after two weeks. Full guide:
34
+ [docs/working-on-branches.md](https://unpkg.com/@niroai/niro/docs/working-on-branches.md)
35
+ (plain-text file, ships inside the package too).
18
36
 
19
37
  ---
20
38
 
@@ -40,7 +58,7 @@ niro init # onboard this folder: create project, upload, build the g
40
58
  niro mcp install # connect one AI assistant — pick it at the prompt, or pass --client
41
59
  ```
42
60
 
43
- `niro mcp install` configures **one** assistant per run — pick it at the prompt, or pass `--client <id>`. 14 clients supported; see **[docs/connect-your-ai-assistant.md](docs/connect-your-ai-assistant.md)** for the full list and the exact command for each. Run it once for each assistant you use. The MCP server URL is picked automatically (own instance? pass `--url <url>`). Restart your AI assistant once after, and you're done — ask it about your code, or ask it to run Niro tasks for you.
61
+ `niro mcp install` configures **one** assistant per run — pick it at the prompt, or pass `--client <id>`. 14 clients supported; see **[docs/connect-your-ai-assistant.md](https://unpkg.com/@niroai/niro/docs/connect-your-ai-assistant.md)** for the full list and the exact command for each. Run it once for each assistant you use. The MCP server URL is picked automatically (own instance? pass `--url <url>`). Restart your AI assistant once after, and you're done — ask it about your code, or ask it to run Niro tasks for you.
44
62
 
45
63
  ---
46
64
 
@@ -0,0 +1,202 @@
1
+ # Connect your AI assistant to Niro
2
+
3
+ `niro mcp install` configures one AI client at a time to use Niro's MCP server. This page
4
+ lists every supported client, the exact command for each, and what it does. If you'd rather
5
+ drive setup from chat instead of a terminal, see [Scenario 2](../README.md#scenario-2--onboard-a-folder-youre-working-in)
6
+ in the main README — the `niro-cli` skill can run these commands for you.
7
+
8
+ ## Before you start
9
+
10
+ ```bash
11
+ npm install -g @niroai/niro
12
+ niro login # browser device flow — no API key to copy
13
+ ```
14
+
15
+ After `niro login`, none of the commands below need an API key — the MCP server authenticates
16
+ with your device token. If you'd rather use an API key instead (e.g. a headless CI box), get
17
+ one from **console.niroai.dev > Settings > Account**; the wizard will ask for it when no
18
+ `niro login` session is found.
19
+
20
+ **Pointing at a different backend?** Every command below defaults to Niro's cloud
21
+ (`https://aiassistant.niroai.dev`). Add `--url <your-backend-url>` to any `niro mcp install`
22
+ command to use a self-hosted or dedicated instance instead (or set `NIRO_MCP_SERVER_URL`).
23
+
24
+ ## All Niro tools are read-only
25
+
26
+ Every tool Niro exposes over MCP only *reads* your code graph — none can modify your code,
27
+ your projects, or anything else. That's why several of the installers below turn on
28
+ auto-approve for Niro's tools: there's nothing for a read-only tool call to break.
29
+
30
+ ---
31
+
32
+ ## Claude Code
33
+
34
+ ```bash
35
+ niro mcp install --client claude-code
36
+ ```
37
+
38
+ Registers the server (`claude mcp add --scope user`), adds a `PostCompact` + `UserPromptSubmit`
39
+ hook so Claude stays aware of Niro after context compaction, appends a short reminder to
40
+ `~/.claude/CLAUDE.md`, and installs the **`niro-skill`** (routes code questions through the
41
+ graph) and **`niro-cli`** skill (drives the CLI from chat) to `~/.claude/skills/`.
42
+
43
+ Verify: type `/mcp` inside Claude Code — `niro` should be listed as connected.
44
+
45
+ ## Codex
46
+
47
+ ```bash
48
+ niro mcp install --client codex
49
+ ```
50
+
51
+ Registers the server in `~/.codex/config.toml`, sets `default_tools_approval_mode = "auto"`
52
+ (safe — every niro tool is read-only), appends a reminder to `~/.codex/AGENTS.md`, and installs
53
+ the shared `niro-skill` + `niro-cli` skill to `~/.agents/skills/` (also read by Windsurf).
54
+
55
+ Verify: `/mcp` inside the Codex TUI.
56
+
57
+ ## Cursor
58
+
59
+ ```bash
60
+ niro mcp install --client cursor
61
+ ```
62
+
63
+ Writes `~/.cursor/mcp.json`, adds `"niro:*"` to `~/.cursor/permissions.json`'s `mcpAllowlist`
64
+ (so Agent doesn't ask before every tool call), and writes a project rule to
65
+ `.cursor/rules/niro.mdc` in the current repo.
66
+
67
+ Requires Cursor's Agent **Auto-run** mode enabled (Settings) for the allowlist to take effect —
68
+ "Ask every time" ignores it.
69
+
70
+ ## VS Code (GitHub Copilot)
71
+
72
+ ```bash
73
+ niro mcp install --client vscode
74
+ ```
75
+
76
+ Writes the user-profile `mcp.json` (`servers.niro`) — the same file VS Code's
77
+ **MCP: Open User Configuration** command opens.
78
+
79
+ Verify: run **MCP: List Servers** from the Command Palette, or check the Chat view's tools icon.
80
+ First use of a new server needs a one-time trust confirmation.
81
+
82
+ ## Windsurf
83
+
84
+ ```bash
85
+ niro mcp install --client windsurf
86
+ ```
87
+
88
+ Writes `~/.codeium/windsurf/mcp_config.json`, appends a reminder to
89
+ `~/.codeium/windsurf/memories/global_rules.md`, and installs the shared `niro-skill` +
90
+ `niro-cli` skill to `~/.agents/skills/` (also read by Codex).
91
+
92
+ ## Claude Desktop
93
+
94
+ ```bash
95
+ niro mcp install --client claude-desktop
96
+ ```
97
+
98
+ Writes `claude_desktop_config.json` (macOS: `~/Library/Application Support/Claude/`, Windows:
99
+ `%APPDATA%\Claude\`, Linux: `~/.config/claude/`). Restart Claude Desktop after.
100
+
101
+ ## Gemini CLI
102
+
103
+ ```bash
104
+ niro mcp install --client gemini-cli
105
+ ```
106
+
107
+ Runs `gemini mcp add -s user` to register the server (`~/.gemini/settings.json`) and appends a
108
+ reminder to `~/.gemini/GEMINI.md`.
109
+
110
+ Verify / reload: run `/mcp reload` inside Gemini CLI.
111
+
112
+ ## GitHub Copilot CLI
113
+
114
+ ```bash
115
+ niro mcp install --client copilot-cli
116
+ ```
117
+
118
+ Runs `copilot mcp add` (writes `~/.copilot/mcp-config.json`) and appends a reminder to
119
+ `~/.copilot/copilot-instructions.md`.
120
+
121
+ Verify: run `/mcp` inside the Copilot CLI — servers are available immediately, no restart needed.
122
+
123
+ ## Factory (droid)
124
+
125
+ ```bash
126
+ niro mcp install --client factory
127
+ ```
128
+
129
+ Runs `droid mcp add` (writes `~/.factory/mcp.json`) and appends a reminder to
130
+ `~/.factory/AGENTS.md`. droid reloads automatically when the config file changes.
131
+
132
+ ## Goose
133
+
134
+ ```bash
135
+ niro mcp install --client goose
136
+ ```
137
+
138
+ Writes an `extensions.niro` entry into `~/.config/goose/config.yaml` (Windows:
139
+ `%APPDATA%\Block\goose\config\config.yaml`). Restart Goose (or start a new session) after.
140
+
141
+ If your `config.yaml` already has an unusual `extensions:` layout, the installer prints the
142
+ YAML block to paste in by hand instead of guessing at a risky merge.
143
+
144
+ ## OpenCode
145
+
146
+ ```bash
147
+ niro mcp install --client opencode
148
+ ```
149
+
150
+ Writes `~/.config/opencode/opencode.json` (`mcp.niro`) and appends a reminder to
151
+ `~/.config/opencode/AGENTS.md`. Restart OpenCode after.
152
+
153
+ ## Cline
154
+
155
+ ```bash
156
+ niro mcp install --client cline
157
+ ```
158
+
159
+ Writes Cline's `cline_mcp_settings.json` (under VS Code's `globalStorage` for Cline's
160
+ publisher id) and adds a global rule file to Cline's Rules directory.
161
+
162
+ ## Kiro
163
+
164
+ ```bash
165
+ niro mcp install --client kiro
166
+ ```
167
+
168
+ Writes `~/.kiro/settings/mcp.json` with `autoApprove: ["*"]` (safe — niro's tools are
169
+ read-only) and adds a global steering file at `~/.kiro/steering/niro.md`. Kiro reconnects MCP
170
+ servers automatically when you save the config.
171
+
172
+ ## Antigravity
173
+
174
+ ```bash
175
+ niro mcp install --client antigravity
176
+ ```
177
+
178
+ Writes `~/.gemini/config/mcp_config.json`. Reload via **Agent Settings → Customizations →
179
+ Installed MCP Servers → Refresh** (or `/mcp` in the Antigravity CLI).
180
+
181
+ ---
182
+
183
+ ## Test it
184
+
185
+ After connecting any client, restart it (where noted above) and ask:
186
+
187
+ > "What calls `chargeCard()`? Use Niro tools."
188
+ > "What breaks if I change the `Invoice` schema?"
189
+ > "Is there existing code that parses webhooks, before I write a new one?"
190
+
191
+ If the assistant answers from the graph instead of grepping files, you're connected.
192
+
193
+ ## Disconnect
194
+
195
+ ```bash
196
+ niro mcp uninstall --client <id> # one client
197
+ niro mcp uninstall --all -y # every client, no confirm
198
+ ```
199
+
200
+ `mcp uninstall` is the exact inverse of `mcp install` for each client — it only removes what
201
+ install added, leaving your own config, rules, and other MCP servers untouched. See the main
202
+ [README](../README.md#scenario-11--disconnect-an-ai-assistant-uninstall-the-mcp) for details.
@@ -0,0 +1,86 @@
1
+ # Working on branches with Niro
2
+
3
+ Niro indexes your team's code from one branch, usually main.
4
+ When you work on your own branch, your code is different from what Niro indexed.
5
+ This page explains what happens then. Two minutes to read.
6
+
7
+ ## The short version
8
+
9
+ There is one command to remember:
10
+
11
+ niro new-temp-project
12
+
13
+ Run it in your repo folder when Niro asks for it. That is all.
14
+
15
+ ## What you will see
16
+
17
+ You create a branch and start changing code.
18
+ Then you ask your AI assistant something about the code.
19
+
20
+ Niro notices your branch is not the one it indexed. Instead of giving you
21
+ a wrong answer based on the old code, it replies with something like:
22
+
23
+ I cannot answer this safely. Your branch has diverged
24
+ from the branch Niro indexed.
25
+
26
+ Your assistant will offer to fix this by running:
27
+
28
+ niro new-temp-project
29
+
30
+ Say yes, or run it yourself in the repo folder. It takes a few seconds.
31
+
32
+ ## What the command does
33
+
34
+ It creates your own private copy of the project inside Niro.
35
+
36
+ - The copy follows your branch, including changes you have not committed.
37
+ - Every save updates the copy, as long as "niro watch" is running.
38
+ - Teammates are not affected. They keep using the shared project.
39
+ - Nobody can see your copy. Not even teammates on your account.
40
+
41
+ From then on, answers come from YOUR code.
42
+
43
+ ## Switching branches
44
+
45
+ Nothing to do. Niro checks which branch you are on for every question.
46
+
47
+ - On your feature branch: answers come from your private copy.
48
+ - Back on main: answers come from the shared project.
49
+
50
+ ## When your work is merged
51
+
52
+ Run this in the repo folder:
53
+
54
+ niro discard-temp-project
55
+
56
+ It deletes your private copy. Your local files are never touched.
57
+ If you forget, Niro deletes unused copies by itself after two weeks.
58
+
59
+ ## A feature that spans several repos
60
+
61
+ Run "niro new-temp-project" in each repo folder you branch.
62
+ All of them join the same private copy, so questions that cross repos
63
+ (for example: what breaks in service B if I change service A?) see all
64
+ of your changes together.
65
+
66
+ ## Common questions
67
+
68
+ Can teammates see my unfinished code?
69
+ No. Your copy is private to you.
70
+
71
+ Does this work with my AI assistant and my git host?
72
+ Yes. Any assistant that supports MCP (Claude Code, Cursor, Windsurf,
73
+ Codex, and others) and any git server (GitHub, GitLab, Bitbucket,
74
+ self-hosted).
75
+
76
+ Is creating a copy slow?
77
+ No. Niro copies the existing index instead of re-reading your code.
78
+ It normally takes seconds.
79
+
80
+ I just created a branch and have not changed anything. Will Niro nag me?
81
+ No. Your code is still identical to what Niro indexed, so Niro answers
82
+ normally. It only steps in once your code actually differs.
83
+
84
+ What if I really want an answer from the shared project while on my branch?
85
+ Tell your assistant so. The answer will be clearly labeled as describing
86
+ the indexed branch, not your code.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@niroai/niro",
3
- "version": "0.3.0",
3
+ "version": "0.3.2",
4
4
  "description": "Niro — one package: the niro CLI plus the Niro MCP server (code intelligence for AI coding assistants).",
5
5
  "keywords": [
6
6
  "niro",
@@ -26,6 +26,7 @@
26
26
  "files": [
27
27
  "bin",
28
28
  "src",
29
+ "docs/*.md",
29
30
  "README.md"
30
31
  ],
31
32
  "engines": {