@niroai/niro 0.16.0 → 0.18.0
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/CHANGELOG.md +149 -0
- package/README.md +123 -302
- package/bin/niro.js +12 -1
- package/docs/agent-antigravity.md +37 -0
- package/docs/agent-claude-code.md +48 -0
- package/docs/agent-claude-desktop.md +47 -0
- package/docs/agent-cline.md +42 -0
- package/docs/agent-codex.md +45 -0
- package/docs/agent-copilot-cli.md +42 -0
- package/docs/agent-cursor.md +44 -0
- package/docs/agent-factory.md +42 -0
- package/docs/agent-gemini-cli.md +42 -0
- package/docs/agent-goose.md +42 -0
- package/docs/agent-kiro.md +37 -0
- package/docs/agent-opencode.md +37 -0
- package/docs/agent-vscode.md +45 -0
- package/docs/agent-windsurf.md +38 -0
- package/docs/answer-shapes.md +69 -0
- package/docs/builds-and-updates.md +68 -0
- package/docs/cloud-README.md +372 -0
- package/docs/configuring-a-folder.md +51 -0
- package/docs/connect-ci.md +24 -0
- package/docs/connect-overview.md +20 -0
- package/docs/connect-review-bots.md +17 -0
- package/docs/connect-team-server.md +12 -0
- package/docs/connect-terminal.md +49 -0
- package/docs/connect-web-agents.md +9 -0
- package/docs/connect-your-ai-assistant.md +59 -175
- package/docs/coverage-audit-and-consent.md +51 -0
- package/docs/evaluate-what-niro-did.md +271 -0
- package/docs/faq-assistants-and-mcp.md +122 -0
- package/docs/faq-feedback-and-receipts.md +33 -0
- package/docs/faq-indexing.md +127 -0
- package/docs/faq-install-and-setup.md +103 -0
- package/docs/faq-licence-and-plans.md +86 -0
- package/docs/faq-login-and-account.md +69 -0
- package/docs/faq-offline.md +34 -0
- package/docs/faq-performance.md +33 -0
- package/docs/faq-privacy-and-security.md +113 -0
- package/docs/faq-uninstall.md +47 -0
- package/docs/faq-updates.md +59 -0
- package/docs/faq-worktrees-and-branches.md +59 -0
- package/docs/faq-wrong-or-missing-answers.md +275 -0
- package/docs/hosted-only.md +33 -0
- package/docs/how-the-graph-works.md +47 -0
- package/docs/index.md +157 -0
- package/docs/licence-and-plans.md +72 -0
- package/docs/lifecycle-debug.md +48 -0
- package/docs/lifecycle-onboarding.md +32 -0
- package/docs/lifecycle-overview.md +77 -0
- package/docs/lifecycle-plan-and-design.md +44 -0
- package/docs/lifecycle-review.md +30 -0
- package/docs/lifecycle-security-and-privacy.md +35 -0
- package/docs/lifecycle-test.md +28 -0
- package/docs/lifecycle-write-code.md +35 -0
- package/docs/llms-full.txt +8015 -0
- package/docs/llms.txt +126 -0
- package/docs/playbook-add-a-feature.md +108 -0
- package/docs/playbook-change-safely.md +93 -0
- package/docs/playbook-data-and-events.md +107 -0
- package/docs/playbook-debug-after-a-change.md +96 -0
- package/docs/playbook-debug-config.md +95 -0
- package/docs/playbook-debug-exception.md +124 -0
- package/docs/playbook-debug-failing-service-call.md +119 -0
- package/docs/playbook-debug-slow-path.md +80 -0
- package/docs/playbook-debug-wrong-value.md +137 -0
- package/docs/playbook-onboard.md +95 -0
- package/docs/playbook-review-a-change.md +72 -0
- package/docs/playbook-test-a-change.md +73 -0
- package/docs/reference-cli.md +113 -0
- package/docs/reference-config-files.md +42 -0
- package/docs/reference-engine-commands.md +56 -0
- package/docs/reference-environment-variables.md +89 -0
- package/docs/reference-exit-codes.md +67 -0
- package/docs/reference-limits.md +75 -0
- package/docs/reference-mcp-tools.md +326 -0
- package/docs/reference-messages.md +180 -0
- package/docs/secrets-and-masking.md +48 -0
- package/docs/supported-c.md +130 -0
- package/docs/supported-cpp.md +157 -0
- package/docs/supported-csharp.md +211 -0
- package/docs/supported-go.md +258 -0
- package/docs/supported-java.md +226 -0
- package/docs/supported-javascript.md +223 -0
- package/docs/supported-kotlin.md +124 -0
- package/docs/supported-overview.md +89 -0
- package/docs/supported-php.md +157 -0
- package/docs/supported-python.md +224 -0
- package/docs/supported-ruby.md +162 -0
- package/docs/supported-rust.md +150 -0
- package/docs/supported-swift.md +133 -0
- package/docs/supported-typescript.md +220 -0
- package/docs/tokens-speed-and-accuracy.md +99 -0
- package/docs/troubleshooting.md +42 -0
- package/docs/uninstall.md +74 -0
- package/docs/what-leaves-your-machine.md +71 -0
- package/docs/where-things-are-stored.md +59 -0
- package/docs/worktrees-and-branches.md +55 -0
- package/package.json +5 -3
- package/src/commands/add-repo.js +5 -0
- package/src/commands/auditSend.js +67 -0
- package/src/commands/build.js +6 -0
- package/src/commands/docsSend.js +73 -0
- package/src/commands/engine.js +120 -0
- package/src/commands/engineRoutes.js +105 -0
- package/src/commands/guide.js +254 -0
- package/src/commands/init.js +16 -7
- package/src/commands/initLocal.js +96 -0
- package/src/commands/journalSend.js +47 -0
- package/src/commands/login.js +89 -12
- package/src/commands/mcp.js +22 -6
- package/src/commands/plan.js +99 -0
- package/src/commands/repoPush.js +33 -0
- package/src/commands/requestIntegration.js +38 -0
- package/src/commands/share.js +56 -0
- package/src/commands/start.js +451 -371
- package/src/commands/status.js +57 -0
- package/src/commands/takeover.js +6 -0
- package/src/commands/uninstall.js +180 -0
- package/src/commands/upgrade.js +38 -8
- package/src/commands/watch.js +420 -6
- package/src/index.js +174 -3
- package/src/lib/agentApi.js +32 -1
- package/src/lib/api.js +20 -6
- package/src/lib/auditUpload.js +293 -0
- package/src/lib/branchDrift.js +149 -0
- package/src/lib/choose.js +116 -0
- package/src/lib/cloudGuard.js +74 -0
- package/src/lib/credentials.js +2 -2
- package/src/lib/docsMarked.js +55 -0
- package/src/lib/docsState.js +213 -0
- package/src/lib/docsUpload.js +481 -0
- package/src/lib/engine.js +619 -0
- package/src/lib/folderSync.js +2 -1
- package/src/lib/graphCheck.js +40 -0
- package/src/lib/guide.js +293 -0
- package/src/lib/guideSearch.js +252 -0
- package/src/lib/integrationRequest.js +89 -0
- package/src/lib/journalUpload.js +147 -0
- package/src/lib/languages.js +129 -0
- package/src/lib/lease.js +375 -0
- package/src/lib/localBuild.js +285 -0
- package/src/lib/localEngine.js +210 -0
- package/src/lib/localOnboard.js +124 -0
- package/src/lib/localWorktrees.js +243 -0
- package/src/lib/machineCheck.js +58 -0
- package/src/lib/mcpClients.js +10 -1
- package/src/lib/migrationNotice.js +118 -0
- package/src/lib/modelFetch.js +153 -0
- package/src/lib/nestedOutput.js +23 -9
- package/src/lib/onboardingLog.js +34 -0
- package/src/lib/planUsage.js +165 -0
- package/src/lib/progressBar.js +46 -0
- package/src/lib/prompt.js +1 -1
- package/src/lib/redact.js +155 -0
- package/src/lib/release.js +33 -0
- package/src/lib/repoPush.js +495 -0
- package/src/lib/secret.js +1 -1
- package/src/lib/service.js +372 -63
- package/src/lib/shareCode.js +367 -0
- package/src/lib/shareExclusions.js +114 -0
- package/src/lib/shareFiles.js +129 -0
- package/src/lib/spinner.js +9 -5
- package/src/lib/watchDaemon.js +33 -10
- package/src/lib/watchState.js +12 -1
- package/src/lib/windowsPaths.js +67 -0
- package/src/mcp/lineCheck.js +382 -0
- package/src/mcp/lineName.js +92 -0
- package/src/mcp/localBackend.js +751 -0
- package/src/mcp/localMode.js +383 -0
- package/src/mcp/localSkill.js +189 -0
- package/src/mcp/server.js +610 -79
- package/src/mcp/setup.js +519 -131
- package/src/mcp/shellSearchHook.js +509 -0
- package/src/mcp/teardown.js +173 -91
- package/src/mcp/usingNiro.js +39 -0
- package/docs/working-on-branches.md +0 -162
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,155 @@ Notable changes to `@niroai/niro`. Dates are release dates.
|
|
|
4
4
|
|
|
5
5
|
## Unreleased
|
|
6
6
|
|
|
7
|
+
### Every coding agent learns how to use Niro beyond code questions
|
|
8
|
+
|
|
9
|
+
The instruction text Niro installs for each agent now has a short "Using Niro" part: for a how-to question
|
|
10
|
+
about Niro, the agent lists the pages with `niro guide`, picks the one whose description fits, and answers
|
|
11
|
+
from it; for a Niro error message it runs `niro guide --search` with the message; and it knows the commands
|
|
12
|
+
that manage Niro (`niro init` for another folder, `niro build`, `niro status`, `niro plan`, `niro impact`,
|
|
13
|
+
`niro route-rule`). It reaches every agent: the engine says it when an agent connects, and it is in the
|
|
14
|
+
Claude Code skill and CLAUDE.md section, the files for Codex, Gemini CLI, Copilot CLI, Factory, OpenCode
|
|
15
|
+
and Windsurf, and the Cursor, Cline and Kiro rules. `niro upgrade` puts it in place and keeps your own lines.
|
|
16
|
+
|
|
17
|
+
### `niro guide --search` understands a question in plain words
|
|
18
|
+
|
|
19
|
+
"how do I uninstall" used to find nothing, because every word had to be on one line. Words such as how,
|
|
20
|
+
do, I, what and the are now left out, and the heading says which words were searched for. When no line
|
|
21
|
+
holds the words but a page does, that page is shown; when no page holds them all, the closest pages come
|
|
22
|
+
first, and the heading says so. Some page descriptions in the `niro guide` list are clearer too.
|
|
23
|
+
|
|
24
|
+
### `niro guide` reads the documentation in the terminal, offline
|
|
25
|
+
|
|
26
|
+
The documentation pages ship inside the package. `niro guide` lists them, grouped as the start page
|
|
27
|
+
groups them. `niro guide <topic>` shows one page, found by its name, its title or a few words.
|
|
28
|
+
`niro guide --search <words>` searches every page and shows the lines that matched. A pasted error
|
|
29
|
+
message finds the page that explains it, even with your own folder names and numbers in it. Source
|
|
30
|
+
notes are left out, and links show the `niro guide` command to run next. `--json` gives a coding agent
|
|
31
|
+
the same answers, and the skills and rule files Niro installs for agents with a terminal now mention it.
|
|
32
|
+
|
|
33
|
+
### Refreshing Niro's part of an agent's instruction file no longer deletes your notes below it
|
|
34
|
+
|
|
35
|
+
For Gemini CLI, Copilot CLI, Factory and OpenCode (and the CLAUDE.md, Codex and Windsurf files the same
|
|
36
|
+
way), Niro adds a section to the agent's own instruction file and refreshes it when its text changes, on
|
|
37
|
+
`niro upgrade` and `niro mcp install`. The refresh used to remove everything from Niro's section to the
|
|
38
|
+
next `## ` heading, so anything you had written straight below it, with no heading or under a `#` or `###`
|
|
39
|
+
heading, was deleted. It now removes only Niro's own text, the way uninstalling does, and every line you
|
|
40
|
+
wrote stays as it was.
|
|
41
|
+
|
|
42
|
+
### Upgrading and uninstalling keep each of your lines on its own line
|
|
43
|
+
|
|
44
|
+
When your own line sat right against Niro's section, with no blank line above and none below, upgrading
|
|
45
|
+
or uninstalling joined it to the next line. When Niro's section was worded by an older release or edited
|
|
46
|
+
by you, your line directly below it was deleted. Now one line break is put back between the two lines,
|
|
47
|
+
and under a section Niro does not know word for word, only lines Niro wrote go. A line Niro cannot tell
|
|
48
|
+
from yours, such as a Niro sentence you edited, is kept, so a little of Niro's old text may stay behind.
|
|
49
|
+
|
|
50
|
+
### Claude Code gets the "ask Niro first" note on shell searches too
|
|
51
|
+
|
|
52
|
+
The note Claude Code already got before its own Grep, Glob and Read tools now also comes before a
|
|
53
|
+
shell command that searches or reads source code in a folder Niro indexes: `grep`, `rg`, `ag`, `ack`,
|
|
54
|
+
`git grep`, `cat`, `head`, `tail`, `sed -n`, `awk`, `less`, `nl`, `bat`, `find -name '*.py'`, and
|
|
55
|
+
`xargs grep`. Agents mostly search through the shell, so the old note rarely fired. It never blocks a
|
|
56
|
+
command, and it stays quiet for config, docs, logs and build output, for a file changed in the last
|
|
57
|
+
10 minutes, for a command that reads a pipe (`ps aux | grep node`, `npm test | tail`), and for
|
|
58
|
+
`git grep` over another commit. `niro mcp install` (or `niro upgrade`) adds it; `niro mcp uninstall`
|
|
59
|
+
removes it. It runs no network call and no Niro command: one `awk` and a walk up the folders.
|
|
60
|
+
|
|
61
|
+
### The coverage audit sends a few lines, not the whole flagged file
|
|
62
|
+
|
|
63
|
+
When a build flags a line it thinks the parser missed, only the method that holds that line (or, when
|
|
64
|
+
no method holds it, at most 10 lines before to 40 after) and one line for each name those lines use
|
|
65
|
+
from the same file are sent, with secrets masked. Every other line of the file goes as an empty line,
|
|
66
|
+
so line numbers stay where they were. `niro status` and `niro plan` say so. niro-cli refuses to post
|
|
67
|
+
a snippet that holds any other line. Removing a copyright holder's name no longer drops a line after a
|
|
68
|
+
`*/` header, which used to move every flag below it one line up on the server.
|
|
69
|
+
|
|
70
|
+
### The background watcher no longer saves your whole shell environment
|
|
71
|
+
|
|
72
|
+
`niro-watch` runs under PM2, and PM2 saves the environment it was started with in
|
|
73
|
+
`~/.pm2/dump.pm2`. That used to be the whole shell, cloud keys and tokens included, in a file other
|
|
74
|
+
users on the machine could read. The watcher is now started with only what it reads (HOME, PATH,
|
|
75
|
+
locale, temp folders, proxy and certificate settings, and the Niro settings), and `dump.pm2` and its
|
|
76
|
+
backup are made readable by you only. An install made by an earlier version is started again with
|
|
77
|
+
the smaller environment the next time you run `niro start` or `niro service install`, which also
|
|
78
|
+
rewrites the saved files.
|
|
79
|
+
|
|
80
|
+
`niro status` and `niro plan` now say what leaves the machine: your code stays on it, and the files
|
|
81
|
+
the coverage audit flags are sent with secrets masked, on every plan.
|
|
82
|
+
|
|
83
|
+
### `niro watch` re-checks a locally indexed folder every few minutes
|
|
84
|
+
|
|
85
|
+
A file event that fs.watch dropped, or a file added while one was lost, was not built into the local
|
|
86
|
+
graph until some later edit arrived. The watcher now lists a locally indexed folder every five minutes
|
|
87
|
+
(file names, sizes and modification times; no file is read) and builds it when the listing changed
|
|
88
|
+
since the last build started. A folder with a build running or due is left to that build, so two
|
|
89
|
+
builds never run at once. Set `NIRO_LOCAL_RECHECK_MS` to change the interval.
|
|
90
|
+
|
|
91
|
+
### The MCP bridge speaks Streamable HTTP
|
|
92
|
+
|
|
93
|
+
`niro mcp serve` now talks to the Niro server over MCP Streamable HTTP (`POST /mcp`) when the server
|
|
94
|
+
offers it: each call is answered in its own HTTP response, so there is no long-lived stream to drop.
|
|
95
|
+
An expired session is renewed and the call resent once; a failed call returns an error instead of
|
|
96
|
+
hanging. A dropped connection is retried only when the call cannot run twice (it never left, or it
|
|
97
|
+
is a read like `tools/list`); a `tools/call` that may have run returns an error instead. Servers without it (404/405 on `/mcp`) get the old SSE transport, unchanged. Force one with
|
|
98
|
+
`NIRO_MCP_TRANSPORT=http` or `sse`. Editor configs do not change.
|
|
99
|
+
|
|
100
|
+
### `niro audit-push-repo`, for the plans that include it
|
|
101
|
+
|
|
102
|
+
Sends this folder's whole source to Niro, so we can measure what the local engine's parser
|
|
103
|
+
misses on code we never see rather than only on the files it already failed to parse. It lands
|
|
104
|
+
in the account-scoped object store, the same place a repository uploaded through `niro add repo`
|
|
105
|
+
goes, and nothing in that chain creates a project.
|
|
106
|
+
|
|
107
|
+
It is explicit: no watcher runs it and no other command triggers it, and it prints the folder,
|
|
108
|
+
the file count and the size, then asks. With no terminal it refuses unless you pass `--yes`.
|
|
109
|
+
|
|
110
|
+
Permission is a claim in the licence lease, and anything that is not a clear yes is a refusal,
|
|
111
|
+
including a licence service that cannot be reached. The folder goes through the same gate as
|
|
112
|
+
`niro init`, which refuses your home directory, the filesystem root and a folder that holds no
|
|
113
|
+
project of its own. The file set is the manifest the CLI already uses, so `.gitignore` is
|
|
114
|
+
honoured and, when git cannot answer on a work tree, every file whose name could carry a secret
|
|
115
|
+
is dropped rather than uploaded unverified; the service then decides what it will take, as it
|
|
116
|
+
does for every other upload. A folder that has been sent is remembered in
|
|
117
|
+
`~/.niro/audit-repos.json`; a second run says when the first one was, and `--force` sends it
|
|
118
|
+
again into the same workspace.
|
|
119
|
+
|
|
120
|
+
### The local graph needs no container, and nothing is offered to the cloud
|
|
121
|
+
|
|
122
|
+
The local engine keeps its graph in a single file on your machine (`~/.niro-local/graph.db`), so it
|
|
123
|
+
needs no container runtime and no database server. An earlier draft of this release kept the graph
|
|
124
|
+
in Memgraph, offered Niro's cloud on a machine that could not run it, and read
|
|
125
|
+
`NIRO_APPROVE_CLOUD_INDEXING`; all of that was removed before release, and that variable is not
|
|
126
|
+
read. `niro engine status` shows a `database` line (whether the graph file opens), printed whichever
|
|
127
|
+
way the engine was found, including from `NIRO_LOCAL_BIN`.
|
|
128
|
+
|
|
129
|
+
### A folder indexed on your own machine is no longer indexed in the cloud as well
|
|
130
|
+
|
|
131
|
+
`niro build`, `niro init` and `niro add repo` now refuse a folder that the local engine
|
|
132
|
+
(`niro-local`) already indexes, and name the two ways out: `niro-local build --path <folder>` to
|
|
133
|
+
update the local index, or `niro-local remove --path <folder>` first if you do want it in the
|
|
134
|
+
cloud. Before this, either command uploaded the folder's source and indexed it a second time,
|
|
135
|
+
which is the one thing the local engine exists to avoid, and the second index was charged for and
|
|
136
|
+
then went stale, because questions in that folder are answered from the local graph.
|
|
137
|
+
|
|
138
|
+
A machine without the engine is unaffected, and so is any folder the engine does not index.
|
|
139
|
+
`niro new-temp-project` is deliberately **not** refused: a temporary project is a cloud project on
|
|
140
|
+
purpose, because it serves pull request review and root cause analysis, which the local graph does
|
|
141
|
+
not answer. It now says so in one line before it uploads.
|
|
142
|
+
|
|
143
|
+
## 0.17.0 — 2026-09-23
|
|
144
|
+
|
|
145
|
+
### `niro init --defaults` still asks which project
|
|
146
|
+
|
|
147
|
+
`--defaults` accepts default values: env vars, indexing scope, the project name. It also used to
|
|
148
|
+
skip the "new project, or add to an existing one?" question and always create a new project, which
|
|
149
|
+
put repos in the wrong place for anyone who already had a project for them. Which project is not a
|
|
150
|
+
default value, so in a terminal the question is now asked with `--defaults` too.
|
|
151
|
+
|
|
152
|
+
Unattended runs are unchanged. With no terminal (CI, a piped script, an agent's shell) there is no
|
|
153
|
+
question and a new project is created, as before. A script that wants an existing project passes
|
|
154
|
+
`--add-to <alias|id>`; `--project-name <name>` still skips the question everywhere.
|
|
155
|
+
|
|
7
156
|
## 0.16.0 — 2026-09-22
|
|
8
157
|
|
|
9
158
|
### A reverse proxy's routing table is offered for upload
|
package/README.md
CHANGED
|
@@ -1,190 +1,101 @@
|
|
|
1
|
-
# niro: CLI + MCP server (`@niroai/niro`)
|
|
1
|
+
# niro: Niro Local CLI + MCP server (`@niroai/niro`)
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
Niro reads your code and builds a map of how it fits together: classes and methods, who calls
|
|
4
|
+
what, HTTP endpoints and calls between services, events, and data access. Your AI assistant
|
|
5
|
+
answers from that map instead of guessing.
|
|
5
6
|
|
|
6
|
-
|
|
7
|
-
|
|
7
|
+
**Niro Local builds and keeps the map on your machine.** Your code is read here and the graph is
|
|
8
|
+
stored here (`~/.niro-local/graph.db`). What is sent, and when, is listed under
|
|
9
|
+
[What leaves your machine](#what-leaves-your-machine).
|
|
8
10
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
+
One package installs the `niro` command, the MCP server your assistant talks to, and two agent
|
|
12
|
+
skills so you can ask for Niro tasks in plain English.
|
|
13
|
+
|
|
14
|
+
Requires Node.js 18 or newer. Niro is in private beta: request access at
|
|
15
|
+
[www.niro.ai](https://www.niro.ai).
|
|
11
16
|
|
|
12
17
|
---
|
|
13
18
|
|
|
14
19
|
## Get started
|
|
15
20
|
|
|
21
|
+
Once per machine, in your first repo:
|
|
22
|
+
|
|
16
23
|
```bash
|
|
17
24
|
cd ~/code/my-service
|
|
18
25
|
npx @niroai/niro start
|
|
19
26
|
```
|
|
20
27
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
Then restart your assistant and ask it something:
|
|
25
|
-
|
|
26
|
-
```
|
|
27
|
-
"What breaks if I change PaymentService.refund?"
|
|
28
|
-
```
|
|
29
|
-
|
|
30
|
-
---
|
|
28
|
+
`niro start` checks the machine, signs you in (one browser screen: choose a plan and approve
|
|
29
|
+
this terminal), installs the local engine, builds this folder's graph, connects your AI
|
|
30
|
+
assistant, and starts a background watcher that keeps the graph current as files change.
|
|
31
31
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
| | |
|
|
35
|
-
|---|---|
|
|
36
|
-
| Anything about your code | call chains, structure, entry points, API endpoints |
|
|
37
|
-
| What breaks if you change something | blast radius across services, including callers a search cannot find |
|
|
38
|
-
| A standing review | issues already in the code, by severity, in the browser |
|
|
39
|
-
| Root causes from your alerts | connect Sentry, Slack, Jira, Linear or CloudWatch and an alert arrives as a bug with the analysis done |
|
|
40
|
-
|
|
41
|
-
---
|
|
42
|
-
|
|
43
|
-
## Everyday commands
|
|
32
|
+
Then add every other repo with one command. It adds the folder and builds its graph:
|
|
44
33
|
|
|
45
34
|
```bash
|
|
46
|
-
|
|
35
|
+
cd ~/code/another-service
|
|
36
|
+
niro init
|
|
47
37
|
```
|
|
48
|
-
Is my index up to date? It answers about the project this folder is synced to **on the branch you
|
|
49
|
-
are on**, so once you have run `niro new-temp-project` it reports that copy rather than the shared
|
|
50
|
-
project. Name one explicitly to ask about a different project: `niro status <project-id>`.
|
|
51
38
|
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
```
|
|
55
|
-
Index another repo. Cross-service answers need more than one.
|
|
39
|
+
Each folder goes into a project named after it. To put a second service into the same project, so
|
|
40
|
+
the calls between them are linked, name the project:
|
|
56
41
|
|
|
57
42
|
```bash
|
|
58
|
-
|
|
43
|
+
cd ~/code/llm-gateway
|
|
44
|
+
niro init --project niro
|
|
59
45
|
```
|
|
60
|
-
What does Niro know about this folder: repo, branch, which project it maps to.
|
|
61
46
|
|
|
62
|
-
|
|
63
|
-
niro projects
|
|
64
|
-
```
|
|
65
|
-
Every project in your account.
|
|
66
|
-
|
|
67
|
-
```bash
|
|
68
|
-
niro build
|
|
69
|
-
```
|
|
70
|
-
Rebuild the index by hand and watch it finish. Like `niro status`, it picks the project for the
|
|
71
|
-
branch you are on, so on a branch with a temporary project it rebuilds that one. Name a project to
|
|
72
|
-
rebuild a different one.
|
|
73
|
-
|
|
74
|
-
```bash
|
|
75
|
-
niro upgrade
|
|
76
|
-
```
|
|
77
|
-
Get the latest version, and bring your hooks, skills and watcher with it. See
|
|
78
|
-
[Upgrading](#upgrading).
|
|
47
|
+
Restart your assistant and ask it something:
|
|
79
48
|
|
|
80
|
-
```bash
|
|
81
|
-
niro doctor
|
|
82
49
|
```
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
that have gone or been renamed. The background watcher runs it for you every six hours.
|
|
86
|
-
|
|
87
|
-
---
|
|
88
|
-
|
|
89
|
-
## Working on a branch
|
|
90
|
-
|
|
91
|
-
Your index covers the branches you chose to build. On a branch nothing covers, Niro says so
|
|
92
|
-
rather than answering from stale code.
|
|
93
|
-
|
|
94
|
-
```bash
|
|
95
|
-
niro new-temp-project
|
|
96
|
-
```
|
|
97
|
-
Run once in the repo folder. Makes a private copy that follows your branch and uncommitted
|
|
98
|
-
edits. Your shared project is untouched.
|
|
99
|
-
|
|
100
|
-
```bash
|
|
101
|
-
niro discard-temp-project
|
|
50
|
+
"What breaks if I change PaymentService.refund?"
|
|
51
|
+
"Which services call the /orders endpoint?"
|
|
102
52
|
```
|
|
103
|
-
Run when the branch is merged. Forgotten copies are cleaned up after two weeks.
|
|
104
|
-
|
|
105
|
-
If a copy is deleted for you, or a project is renamed, your machine is not told and the folder keeps
|
|
106
|
-
pointing at something that is gone. `niro doctor sync-registry` sorts that out, and the background
|
|
107
|
-
watcher runs it every six hours — see [When a project is deleted](#when-a-project-is-deleted).
|
|
108
|
-
|
|
109
|
-
Full guide: [docs/working-on-branches.md](https://unpkg.com/@niroai/niro/docs/working-on-branches.md)
|
|
110
53
|
|
|
111
54
|
---
|
|
112
55
|
|
|
113
|
-
##
|
|
114
|
-
|
|
115
|
-
Delete a project, or let an unused private copy expire, and your machine is not told. The folder
|
|
116
|
-
carries on pointing at something that is no longer there.
|
|
117
|
-
|
|
118
|
-
That is not just untidy. It is what makes `niro new-temp-project` in another folder say the slot is
|
|
119
|
-
already taken, naming a copy that no longer exists. And a `.niro-project` file left naming a deleted
|
|
120
|
-
project keeps answering, because it is read before your git remote.
|
|
121
|
-
|
|
122
|
-
The background watcher checks every six hours and sorts this out for you. `niro
|
|
123
|
-
doctor sync-registry` does the same thing on demand.
|
|
124
|
-
|
|
125
|
-
What it does depends on what went missing:
|
|
56
|
+
## Everyday commands
|
|
126
57
|
|
|
127
|
-
|
|
|
58
|
+
| Command | What it does |
|
|
128
59
|
|---|---|
|
|
129
|
-
|
|
|
130
|
-
|
|
|
131
|
-
|
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
pin identifies nothing and is removed.
|
|
143
|
-
|
|
144
|
-
**Unless the file is committed.** A `.niro-project` in git is shared with everyone who clones the
|
|
145
|
-
repo, and what looks like a dead project to you may be a colleague's. Niro never changes a committed
|
|
146
|
-
one for you. It tells you, and you decide.
|
|
147
|
-
|
|
148
|
-
`niro info` also mentions it when you are standing in an affected folder, so you do not have to go
|
|
149
|
-
looking.
|
|
150
|
-
|
|
151
|
-
## When you run out of private copies
|
|
152
|
-
|
|
153
|
-
You get a limited number of private copies of each project. If you hit that limit, Niro tells you
|
|
154
|
-
which branches are holding them, and the CLI adds where each one is checked out:
|
|
155
|
-
|
|
156
|
-
```
|
|
157
|
-
You already have 5 working copies of this project, which is the limit (5).
|
|
158
|
-
They are for: feature/a, feature/b, feature/c, feature/d, feature/e.
|
|
159
|
-
|
|
160
|
-
You have 5 working copies of this project on this machine:
|
|
161
|
-
feature/a /home/you/work/service
|
|
162
|
-
feature/b /home/you/work/service-wt2
|
|
163
|
-
...
|
|
164
|
-
```
|
|
165
|
-
|
|
166
|
-
Run `niro discard-temp-project` in one you have finished with, then try again. Copies nobody has
|
|
167
|
-
touched for a while are also cleared automatically.
|
|
60
|
+
| `niro init [path]` | Add a folder and build its graph, in one step (an indexed folder is rebuilt). Needs `niro start` once first. Options: `--project <name>` joins or starts that project, `--force` adds a folder with no build file, `--path <folder>`, `--branch <name>` (a folder outside git), `--base-url <url>`. At or over the line limit a new folder is refused before it is added; a folder already indexed is still rebuilt. |
|
|
61
|
+
| `niro build [path]` | Rebuild the graph of a folder already added. A folder not added yet is refused with a pointer to `niro init`. |
|
|
62
|
+
| `niro status` | This folder: indexed or not, last build, plan, connected assistants, auto-sync. |
|
|
63
|
+
| `niro plan` | Your plan, lines used against its limit, every indexed folder (largest first), and your options. |
|
|
64
|
+
| `niro plan remove <folder>` | Stop indexing a folder and free its lines. Your code is not touched. |
|
|
65
|
+
| `niro request-integration <name>` | Ask Niro's team to support a language, framework or tool Niro does not read yet (`--kind framework` or `--kind tool`, `--reason "<why>"`). Asks before sending; the request is kept with your account. Your assistant can do the same with the `request_integration` tool, which also asks you first. `niro start` names languages in a folder that Niro does not read yet. |
|
|
66
|
+
| `niro mcp install` | Connect another AI assistant (Claude Code, Cursor, Codex, Windsurf and others). |
|
|
67
|
+
| `niro service install` | Restart the background watcher if it stopped. |
|
|
68
|
+
| `niro upgrade` | Update to the latest version. |
|
|
69
|
+
| `niro uninstall` | Remove Niro from this machine. See [docs/uninstall.md](docs/uninstall.md). |
|
|
70
|
+
|
|
71
|
+
Most commands take `--json` for scripts and agents (`niro plan --json`, `niro status --json`,
|
|
72
|
+
`niro whoami --json`).
|
|
168
73
|
|
|
169
74
|
---
|
|
170
75
|
|
|
171
|
-
##
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
76
|
+
## Plans and the line limit
|
|
77
|
+
|
|
78
|
+
**Free** indexes up to 500,000 lines of code in total on your machine. Every line of every indexed
|
|
79
|
+
file counts, blank lines and comments included (the same number `wc -l` gives). Each repository
|
|
80
|
+
counts once, by its largest checkout: two checkouts of one repo are not counted twice.
|
|
81
|
+
|
|
82
|
+
- A build starts while you are under the limit, and the build that takes you over is allowed to
|
|
83
|
+
finish. After that, adding a new repository or project stops until you choose how to continue.
|
|
84
|
+
Folders already indexed keep rebuilding, and so do new branches or worktrees of a repository
|
|
85
|
+
already indexed, and a service folder inside an indexed monorepo.
|
|
86
|
+
- The graph you already have keeps answering your assistant in the meantime.
|
|
87
|
+
- `niro start`, `niro init` and `niro plan` tell you when you are over, and open the console's
|
|
88
|
+
**/limit** page with three ways on:
|
|
89
|
+
1. **Unlock unlimited lines on Free** by turning on sharing of redacted code.
|
|
90
|
+
2. **Request a Pro free trial** (30 days, no line limit, no sharing needed). Your code stays on
|
|
91
|
+
this machine, except, for each line the audit flags, the whole method that holds it and one line
|
|
92
|
+
for each name it uses, sent with secrets masked and author and company names removed. A record of which Niro tools your
|
|
93
|
+
assistant used is also sent, to improve Niro and to show you its value. Niro's tools answer
|
|
94
|
+
your assistant from the graph on this machine and never send the contents of your files.
|
|
95
|
+
3. **Stay under the limit** with `niro plan remove <folder>`.
|
|
96
|
+
|
|
97
|
+
You can turn sharing on or off at any time under Settings, Privacy in the console. Turned off on
|
|
98
|
+
Free, the line limit applies again.
|
|
188
99
|
|
|
189
100
|
---
|
|
190
101
|
|
|
@@ -193,179 +104,89 @@ Stop early. Every session uses Niro again.
|
|
|
193
104
|
```bash
|
|
194
105
|
niro mcp install
|
|
195
106
|
```
|
|
196
|
-
Pick from the list, or `--client <id>` to skip the prompt. Restart the assistant afterwards.
|
|
197
107
|
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
All 14 supported clients and the file each one is configured through.
|
|
202
|
-
|
|
203
|
-
```bash
|
|
204
|
-
niro mcp uninstall --all -y
|
|
205
|
-
```
|
|
206
|
-
Removes everything install added: MCP config, hooks and skills. Leaves you logged in.
|
|
207
|
-
|
|
208
|
-
Per-client details: [docs/connect-your-ai-assistant.md](https://unpkg.com/@niroai/niro/docs/connect-your-ai-assistant.md)
|
|
209
|
-
|
|
210
|
-
---
|
|
211
|
-
|
|
212
|
-
## Managing projects
|
|
213
|
-
|
|
214
|
-
```bash
|
|
215
|
-
niro edit --list-env
|
|
216
|
-
```
|
|
217
|
-
Environment variables Niro found, with secret values masked.
|
|
218
|
-
|
|
219
|
-
```bash
|
|
220
|
-
niro edit --set-env KEY=VALUE
|
|
221
|
-
```
|
|
222
|
-
Set one. The value is never printed or logged.
|
|
223
|
-
|
|
224
|
-
```bash
|
|
225
|
-
niro edit --alias new-name
|
|
226
|
-
```
|
|
227
|
-
Rename a project.
|
|
228
|
-
|
|
229
|
-
```bash
|
|
230
|
-
niro remove --unmap-repo <gitId>
|
|
231
|
-
```
|
|
232
|
-
Detach a repo from a project. Nothing is deleted.
|
|
233
|
-
|
|
234
|
-
```bash
|
|
235
|
-
niro remove --project --confirm-name <name>
|
|
236
|
-
```
|
|
237
|
-
Delete a whole project. Destructive, hence the confirmation. It refuses on a temporary project and
|
|
238
|
-
sends you to `niro discard-temp-project` instead, because that removes the copy **and** points this
|
|
239
|
-
folder back at the shared project; deleting it here would leave the folder aimed at a project that
|
|
240
|
-
no longer exists. `niro delete` refuses for the same reason.
|
|
108
|
+
Asks which assistant, writes Niro into its settings, and installs the skills. Restart the
|
|
109
|
+
assistant afterwards; skills load at startup. "Other" prints a config block to paste into any
|
|
110
|
+
assistant that is not listed.
|
|
241
111
|
|
|
242
112
|
---
|
|
243
113
|
|
|
244
|
-
##
|
|
245
|
-
|
|
246
|
-
```bash
|
|
247
|
-
niro service status
|
|
248
|
-
```
|
|
249
|
-
Is the background watcher running? It syncs your indexed folders as you edit.
|
|
250
|
-
|
|
251
|
-
```bash
|
|
252
|
-
niro service install
|
|
253
|
-
```
|
|
254
|
-
Start it and have it come back on login. Needs PM2 (`npm install -g pm2`).
|
|
114
|
+
## What leaves your machine
|
|
255
115
|
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
116
|
+
- **Your account.** Sign-in, and your plan's licence (which plan, its line limit, whether sharing
|
|
117
|
+
is on), renewed while Niro runs.
|
|
118
|
+
- **Which tools were used**, on every plan, to improve Niro and to show you its value. A record of
|
|
119
|
+
the Niro tools your assistant called: the tool names, how long each took, whether it failed,
|
|
120
|
+
whether Niro helped and how many native calls it saved, a short summary of the task written by
|
|
121
|
+
the assistant, and the names, paths and search text it asked about (each cut to 200 characters).
|
|
122
|
+
No source files.
|
|
123
|
+
- **Coverage findings**, on every plan. For each line the graph missed (a class or a route with
|
|
124
|
+
nothing in the graph for it), the method that holds it (or the 10 lines before and 40 after it)
|
|
125
|
+
and one line for each name it uses are sent, with that file's path inside the repo, so the parser can be fixed. Every other line of the
|
|
126
|
+
file is sent blank; a whole file is never sent. Before sending, Niro removes secrets, author names
|
|
127
|
+
and company names it can recognise (your email domain, the git remote's owner, copyright holders).
|
|
128
|
+
- **Catalogue signals**, on every plan, with the coverage findings and under the same rule (a signed-in
|
|
129
|
+
machine with a readable plan). After a build, for each indexed folder: the file extensions Niro read
|
|
130
|
+
no language in, with a count each (for example `.fs: 12`), and the names of outside libraries your
|
|
131
|
+
code imports, each with its ecosystem, whether Niro already has rules for it, and how many files
|
|
132
|
+
import it. This tells us which languages and libraries to support next. No file names, paths, import
|
|
133
|
+
lines or source are sent, and no name of your own code: a package whose source is in your project or
|
|
134
|
+
its other folders, or that shares your packages' own prefix (your npm scope, your Go organisation, your
|
|
135
|
+
Java packages), is never sent. A library whose source is in none of your project's folders is sent by
|
|
136
|
+
its name, even when that name is your company's (a private package or git host), because the catalogue
|
|
137
|
+
needs every outside library. Sent again only when the list changes.
|
|
138
|
+
- **A request for a language, framework or tool, only when you send one** (`niro request-integration`, or
|
|
139
|
+
your assistant's `request_integration` tool after you say yes): its name and kind, your reason if you
|
|
140
|
+
give one, and your account's email.
|
|
141
|
+
- **The code Niro indexes, only while sharing is on.** With "Share redacted code" on in the console,
|
|
142
|
+
the background watcher sends the files Niro indexes in each folder (source, config and build files;
|
|
143
|
+
never a gitignored file, a real `.env`, a key or `node_modules`), with secrets masked and author and
|
|
144
|
+
company names removed on this machine: the whole set the first time, then only changed files. Keep a
|
|
145
|
+
folder out with `niro share exclude <folder>`. Turning sharing off stops it.
|
|
146
|
+
- **One folder at once, when you choose to.** `niro audit-push-repo` sends one folder's indexed files the
|
|
147
|
+
same way, only when sharing is on and your plan includes it. It asks first.
|
|
148
|
+
|
|
149
|
+
Your graph stays on your machine, and your assistant's questions are answered from it there. A
|
|
150
|
+
record of those tool calls is sent, as described above.
|
|
151
|
+
|
|
152
|
+
Your AI assistant (for example Claude Code, Codex or Cursor) may send what Niro shows it to its own
|
|
153
|
+
model provider, under that assistant's terms. That is the assistant's doing, not Niro's.
|
|
260
154
|
|
|
261
155
|
---
|
|
262
156
|
|
|
263
157
|
## Upgrading
|
|
264
158
|
|
|
265
|
-
**Check which you are on first:**
|
|
266
|
-
|
|
267
159
|
```bash
|
|
268
160
|
niro --version
|
|
269
|
-
```
|
|
270
|
-
|
|
271
|
-
**On 0.13.0 or newer**, one command:
|
|
272
|
-
|
|
273
|
-
```bash
|
|
274
161
|
niro upgrade
|
|
275
162
|
```
|
|
276
163
|
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
restarts the background watcher. Restart your assistant afterwards.
|
|
280
|
-
|
|
281
|
-
**On anything older than 0.13.0**, you do not have `niro upgrade` yet, so it is two commands, once:
|
|
282
|
-
|
|
283
|
-
```bash
|
|
284
|
-
npm install -g @niroai/niro@latest
|
|
285
|
-
niro upgrade --finish
|
|
286
|
-
```
|
|
287
|
-
|
|
288
|
-
The first gets the package. The second does the half npm cannot: your hooks, skills and the
|
|
289
|
-
watcher. After that, `niro upgrade` on its own is enough. Do not stop after the first command:
|
|
290
|
-
that leaves you on the new version running the old version's hooks, skills and instruction files,
|
|
291
|
-
which is the problem `niro upgrade` exists to solve.
|
|
292
|
-
|
|
293
|
-
**Why it is more than an npm install.** The hooks, skills and instruction files are written into
|
|
294
|
-
your home folder as fixed text when you install, not read out of the package as it runs, so a newer
|
|
295
|
-
package does not change them. The watcher is a long-running process still holding the code it
|
|
296
|
-
started with. The MCP config is the one part that needs nothing done to it: it runs plain `niro`
|
|
297
|
-
from your `PATH` with no version pinned in it, so the new server is picked up on its own.
|
|
298
|
-
|
|
299
|
-
**Restart your assistant last.** Skills and hooks are read when it starts, so nothing above reaches
|
|
300
|
-
a session that is already open.
|
|
301
|
-
|
|
302
|
-
Fully by hand, if you would rather:
|
|
303
|
-
|
|
304
|
-
```bash
|
|
305
|
-
npm install -g @niroai/niro@latest
|
|
306
|
-
niro mcp install # once per assistant you use
|
|
307
|
-
niro service install # only if you run the watcher
|
|
308
|
-
```
|
|
309
|
-
|
|
310
|
-
`niro start` upgrades nothing. On a machine that has connected an assistant once it skips the
|
|
311
|
-
connect step, so the old hooks and skills stay where they are.
|
|
312
|
-
|
|
313
|
-
---
|
|
314
|
-
|
|
315
|
-
## Reference
|
|
316
|
-
|
|
317
|
-
Add `--help` to any command for its flags. Add `--json` to `whoami`, `info`, `status`,
|
|
318
|
-
`projects`, `build`, `ab report`, `edit --list-env` and `doctor sync-registry` for machine-readable
|
|
319
|
-
output.
|
|
320
|
-
|
|
321
|
-
| File | What it holds |
|
|
322
|
-
|---|---|
|
|
323
|
-
| `~/.niro/credentials.json` | Your login, mode `0600` |
|
|
324
|
-
| `~/.niro/config.json` | Backend URLs saved during setup |
|
|
325
|
-
| `~/.niro/projects.json` | Per-folder sync state |
|
|
326
|
-
| `.niro-project` | Pins a repo folder to a Niro project |
|
|
327
|
-
|
|
328
|
-
| Variable | What it sets | Default |
|
|
329
|
-
|---|---|---|
|
|
330
|
-
| `NIRO_API_URL` | Backend the CLI talks to | `https://aiorchestrator.niroai.dev` |
|
|
331
|
-
| `NIRO_MCP_SERVER_URL` | Backend the MCP server talks to | `https://aiassistant.niroai.dev` |
|
|
332
|
-
| `NIRO_API_KEY` | Read by the MCP server when running headless. For CI, prefer `niro login --api-key` | none |
|
|
333
|
-
| `NIRO_UPLOAD_CONCURRENCY` / `_TIMEOUT_MS` / `_MAX_TOTAL_BYTES` / `_MAX_FILES` | Tune the first upload | 4 / 60000 / 1 GiB / 50000 |
|
|
334
|
-
|
|
335
|
-
Running your own instance? Set `NIRO_API_URL` before `niro login`, and pass `--url <url>` to
|
|
336
|
-
`niro mcp install`.
|
|
337
|
-
|
|
338
|
-
---
|
|
339
|
-
|
|
340
|
-
## What leaves your machine
|
|
341
|
-
|
|
342
|
-
Source and config files from the folder you confirmed, and nothing else. `.gitignore` is
|
|
343
|
-
honoured, so a gitignored `.env` is never sent. Raw `.env` and `*.properties` files are not in
|
|
344
|
-
the upload set; committed files like `application.yml` and `.env.example` are, because they hold
|
|
345
|
-
defaults rather than secrets.
|
|
346
|
-
|
|
347
|
-
Secret values are never printed: `--set-env` does not echo them, and `--list-env` masks anything
|
|
348
|
-
that looks like a secret by name or by content.
|
|
164
|
+
`niro upgrade` replaces the package with the latest version, re-installs Niro into every assistant
|
|
165
|
+
you have configured, and restarts the background watcher. Restart your assistant afterwards.
|
|
349
166
|
|
|
350
167
|
---
|
|
351
168
|
|
|
352
169
|
## If something is wrong
|
|
353
170
|
|
|
354
|
-
**The assistant ignores Niro.** Restart it. Skills load at startup
|
|
355
|
-
|
|
171
|
+
**The assistant ignores Niro.** Restart it. Skills load at startup.
|
|
172
|
+
|
|
173
|
+
**"This folder is not indexed on this machine".** Run `niro init` in that folder (or `niro start`
|
|
174
|
+
there, on a machine that is not set up yet).
|
|
356
175
|
|
|
357
|
-
**`niro
|
|
176
|
+
**`niro init` says you are not signed in, or the engine is missing.** Run `niro start` once on this
|
|
177
|
+
machine.
|
|
358
178
|
|
|
359
|
-
**
|
|
179
|
+
**"No room left under the limit".** See [Plans and the line limit](#plans-and-the-line-limit), or
|
|
180
|
+
run `niro plan` for your options.
|
|
360
181
|
|
|
361
|
-
|
|
182
|
+
**`niro: command not found`.** Your global npm bin is not on `PATH`. Find npm's global folder with `npm prefix -g`; its `bin` folder must be on `PATH`.
|
|
362
183
|
|
|
363
|
-
**
|
|
364
|
-
|
|
365
|
-
one. Plain `npm install -g` on its own always leaves your hooks and skills on the old version.
|
|
184
|
+
**The graph does not update as you edit.** The watcher is not running: `niro service install`
|
|
185
|
+
(it needs PM2: `npm install -g pm2`).
|
|
366
186
|
|
|
367
|
-
**A folder was refused.** Niro will not index your home folder
|
|
368
|
-
|
|
187
|
+
**A folder was refused.** Niro will not index your home folder or the root of the disk. Run it in
|
|
188
|
+
the repo you meant. A git repository inside the folder you index is its own project: run
|
|
189
|
+
`niro init` inside it.
|
|
369
190
|
|
|
370
191
|
---
|
|
371
192
|
|