@niroai/niro 0.10.0 → 0.11.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 +117 -0
- package/README.md +185 -249
- package/docs/working-on-branches.md +55 -0
- package/package.json +1 -1
- package/src/commands/cleanup.js +689 -0
- package/src/commands/info.js +51 -2
- package/src/commands/release.js +13 -60
- package/src/commands/takeover.js +52 -2
- package/src/commands/watch.js +93 -25
- package/src/index.js +23 -3
- package/src/lib/folderSync.js +6 -0
- package/src/lib/periodicClaim.js +100 -0
- package/src/lib/printError.js +46 -0
- package/src/lib/takeoverRestore.js +156 -0
- package/src/mcp/setup.js +178 -13
package/README.md
CHANGED
|
@@ -1,367 +1,303 @@
|
|
|
1
|
-
# niro
|
|
1
|
+
# niro: CLI + MCP server (`@niroai/niro`)
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Command-line tool and MCP server for [Niro](https://niroai.dev). Niro reads your code and builds
|
|
4
|
+
a map of how it fits together, so your AI assistant answers from that map instead of guessing.
|
|
4
5
|
|
|
5
|
-
One package
|
|
6
|
+
One package installs three things: the `niro` command, the MCP server your assistant talks to,
|
|
7
|
+
and two agent skills so you can ask for Niro tasks in plain English.
|
|
6
8
|
|
|
7
|
-
|
|
8
|
-
|
|
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
|
-
- **`niro-skill`** — answers questions about your code (structure, call chains, blast radius) using the Niro MCP tools.
|
|
11
|
-
- **`niro-cli`** — runs the CLI for you (onboard, status, rebuild, edit env vars, remove) from a conversation.
|
|
9
|
+
Requires Node.js 18 or newer. Niro is in private beta: you need an access code, which you get
|
|
10
|
+
from the **Request Access** button at [www.niro.ai](https://www.niro.ai).
|
|
12
11
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
## Working on branches
|
|
12
|
+
---
|
|
16
13
|
|
|
17
|
-
|
|
18
|
-
to the project matching your repo and current branch. When you are on a branch **no project
|
|
19
|
-
covers** (with real changes), Niro refuses to answer from stale code. Your assistant offers the fix:
|
|
14
|
+
## Get started
|
|
20
15
|
|
|
21
16
|
```bash
|
|
22
|
-
|
|
17
|
+
cd ~/code/my-service
|
|
18
|
+
npx @niroai/niro start
|
|
23
19
|
```
|
|
24
20
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
Switching branches needs nothing: Niro answers from your copy on the new
|
|
28
|
-
branch, and from the matching indexed project on branches you already cover. When your branch
|
|
29
|
-
is merged:
|
|
21
|
+
Signs you in, installs itself, shows you what it is about to index and asks first, builds the
|
|
22
|
+
graph, and connects your assistant. Run it again in any other repo; it skips what is done.
|
|
30
23
|
|
|
31
|
-
|
|
32
|
-
niro discard-temp-project
|
|
33
|
-
```
|
|
24
|
+
Then restart your assistant and ask it something:
|
|
34
25
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
26
|
+
```
|
|
27
|
+
"What breaks if I change PaymentService.refund?"
|
|
28
|
+
```
|
|
38
29
|
|
|
39
30
|
---
|
|
40
31
|
|
|
41
|
-
##
|
|
42
|
-
|
|
43
|
-
```bash
|
|
44
|
-
npm install -g @niroai/niro
|
|
45
|
-
niro --version
|
|
46
|
-
```
|
|
47
|
-
|
|
48
|
-
Requires **Node.js 18+**. Background auto-sync of local folders uses [PM2](https://pm2.keymetrics.io/) — `niro init` offers to install it for you (or run `npm install -g pm2` yourself).
|
|
32
|
+
## What you can ask for
|
|
49
33
|
|
|
50
|
-
|
|
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 |
|
|
51
40
|
|
|
52
41
|
---
|
|
53
42
|
|
|
54
|
-
##
|
|
43
|
+
## Everyday commands
|
|
55
44
|
|
|
56
45
|
```bash
|
|
57
|
-
|
|
58
|
-
npx @niroai/niro start
|
|
46
|
+
niro status
|
|
59
47
|
```
|
|
48
|
+
Is my index up to date?
|
|
60
49
|
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
is already done.
|
|
50
|
+
```bash
|
|
51
|
+
niro start
|
|
52
|
+
```
|
|
53
|
+
Index another repo. Cross-service answers need more than one.
|
|
66
54
|
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
55
|
+
```bash
|
|
56
|
+
niro info
|
|
57
|
+
```
|
|
58
|
+
What does Niro know about this folder: repo, branch, which project it maps to.
|
|
70
59
|
|
|
71
|
-
|
|
60
|
+
```bash
|
|
61
|
+
niro projects
|
|
62
|
+
```
|
|
63
|
+
Every project in your account.
|
|
72
64
|
|
|
73
65
|
```bash
|
|
74
|
-
niro
|
|
75
|
-
cd ~/code/my-service
|
|
76
|
-
niro init # onboard this folder: create project, upload, build the graph
|
|
77
|
-
niro mcp install # connect one AI assistant — pick it at the prompt, or pass --client
|
|
66
|
+
niro build
|
|
78
67
|
```
|
|
68
|
+
Rebuild the index by hand and watch it finish.
|
|
79
69
|
|
|
80
|
-
|
|
70
|
+
```bash
|
|
71
|
+
niro doctor
|
|
72
|
+
```
|
|
73
|
+
Check this machine against the server and repair what is safe to repair. Today that is
|
|
74
|
+
`niro doctor sync-registry`, which fixes folders and `.niro-project` files left pointing at projects
|
|
75
|
+
that have gone or been renamed. The background watcher runs it for you every six hours.
|
|
81
76
|
|
|
82
77
|
---
|
|
83
78
|
|
|
84
|
-
##
|
|
79
|
+
## Working on a branch
|
|
85
80
|
|
|
86
|
-
|
|
81
|
+
Your index covers the branches you chose to build. On a branch nothing covers, Niro says so
|
|
82
|
+
rather than answering from stale code.
|
|
87
83
|
|
|
88
|
-
**Terminal**
|
|
89
84
|
```bash
|
|
90
|
-
niro
|
|
91
|
-
niro whoami # who am I logged in as?
|
|
92
|
-
niro logout # revoke + remove local credentials
|
|
85
|
+
niro new-temp-project
|
|
93
86
|
```
|
|
87
|
+
Run once in the repo folder. Makes a private copy that follows your branch and uncommitted
|
|
88
|
+
edits. Your shared project is untouched.
|
|
94
89
|
|
|
95
|
-
**Ask the agent**
|
|
96
|
-
> "Am I logged in to Niro?" — the agent runs `niro whoami`. If you're not, it will **ask you to run `niro login` yourself** in your terminal (it can't drive a browser sign-in or handle your credentials).
|
|
97
|
-
|
|
98
|
-
---
|
|
99
|
-
|
|
100
|
-
## Scenario 2 — Onboard a folder you're working in
|
|
101
|
-
|
|
102
|
-
`niro init` does the whole thing end-to-end: detect the repo, **upload its source + config files**, create a Niro project, scan for environment variables, build the graph, and (optionally) keep it synced.
|
|
103
|
-
|
|
104
|
-
**Terminal**
|
|
105
90
|
```bash
|
|
106
|
-
|
|
107
|
-
niro init # onboard the current folder
|
|
108
|
-
niro init ./api # onboard a specific path
|
|
109
|
-
niro init --defaults # accept discovered defaults, don't prompt
|
|
110
|
-
niro init -X '**/test/**' -F '**/*.spec.ts' # exclude modules / files
|
|
91
|
+
niro discard-temp-project
|
|
111
92
|
```
|
|
93
|
+
Run when the branch is merged. Forgotten copies are cleaned up after two weeks.
|
|
112
94
|
|
|
113
|
-
|
|
95
|
+
If a copy is deleted for you, or a project is renamed, your machine is not told and the folder keeps
|
|
96
|
+
pointing at something that is gone. `niro doctor sync-registry` sorts that out, and the background
|
|
97
|
+
watcher runs it every six hours — see [When a project is deleted](#when-a-project-is-deleted).
|
|
114
98
|
|
|
115
|
-
|
|
116
|
-
> "Onboard this folder into Niro." The `niro-cli` skill checks auth, runs `niro info` to see if it's already indexed, then runs `niro init` for you and walks you through the env-var values in chat.
|
|
99
|
+
Full guide: [docs/working-on-branches.md](https://unpkg.com/@niroai/niro/docs/working-on-branches.md)
|
|
117
100
|
|
|
118
|
-
|
|
101
|
+
---
|
|
119
102
|
|
|
120
|
-
|
|
103
|
+
## When a project is deleted
|
|
121
104
|
|
|
122
|
-
|
|
105
|
+
Delete a project, or let an unused private copy expire, and your machine is not told. The folder
|
|
106
|
+
carries on pointing at something that is no longer there.
|
|
123
107
|
|
|
124
|
-
|
|
108
|
+
That is not just untidy. It is what makes `niro new-temp-project` in another folder say the slot is
|
|
109
|
+
already taken, naming a copy that no longer exists. And a `.niro-project` file left naming a deleted
|
|
110
|
+
project keeps answering, because it is read before your git remote.
|
|
125
111
|
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
niro info # repo URL, branch, which project(s) map here, index status
|
|
129
|
-
niro info --json # machine-readable
|
|
130
|
-
niro status # live build status for the pinned project
|
|
131
|
-
niro status my-service --json
|
|
132
|
-
```
|
|
112
|
+
The background watcher checks every six hours and sorts this out for you. `niro
|
|
113
|
+
doctor sync-registry` does the same thing on demand.
|
|
133
114
|
|
|
134
|
-
|
|
115
|
+
What it does depends on what went missing:
|
|
135
116
|
|
|
136
|
-
|
|
137
|
-
|
|
117
|
+
| What is gone | What happens to your folder |
|
|
118
|
+
|---|---|
|
|
119
|
+
| A private copy of a project | Goes back to the original project and carries on syncing |
|
|
120
|
+
| The project itself | Left alone if the repo still exists; unregistered only when both are gone |
|
|
121
|
+
| Neither, just a stale `.niro-project` | Repaired if your git remote says which project it should name; removed if it names nothing and is not shared; otherwise you are told |
|
|
138
122
|
|
|
139
|
-
|
|
123
|
+
It never deletes anything on the server, and it never touches a `.niro-project` file. Everything it
|
|
124
|
+
acts on has already gone. It only acts on what it can check, too: a folder git cannot read, or a
|
|
125
|
+
project it could not reach, is left exactly as it is and reported. A bad connection can never cost
|
|
126
|
+
you a working folder.
|
|
140
127
|
|
|
141
|
-
|
|
128
|
+
**How it decides what to do with a stale `.niro-project`.** That file can hold a project's name
|
|
129
|
+
rather than its id, so a renamed project looks exactly like a deleted one. Niro uses a second signal:
|
|
130
|
+
your folder's git remote. If the remote points at exactly one project, the pin is rewritten to that
|
|
131
|
+
project's id, which cannot be broken by a future rename. If the remote points at nothing either, the
|
|
132
|
+
pin identifies nothing and is removed.
|
|
142
133
|
|
|
143
|
-
**
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
niro projects --json
|
|
147
|
-
```
|
|
134
|
+
**Unless the file is committed.** A `.niro-project` in git is shared with everyone who clones the
|
|
135
|
+
repo, and what looks like a dead project to you may be a colleague's. Niro never changes a committed
|
|
136
|
+
one for you. It tells you, and you decide.
|
|
148
137
|
|
|
149
|
-
|
|
150
|
-
|
|
138
|
+
`niro info` also mentions it when you are standing in an affected folder, so you do not have to go
|
|
139
|
+
looking.
|
|
151
140
|
|
|
152
|
-
|
|
141
|
+
## When you run out of private copies
|
|
153
142
|
|
|
154
|
-
|
|
143
|
+
You get a limited number of private copies of each project. If you hit that limit, Niro tells you
|
|
144
|
+
which branches are holding them, and the CLI adds where each one is checked out:
|
|
155
145
|
|
|
156
|
-
**Terminal**
|
|
157
|
-
```bash
|
|
158
|
-
niro build # full rebuild of the project pinned to this folder
|
|
159
|
-
niro build my-service # by alias or id
|
|
160
|
-
niro build --no-full-rebuild # incremental
|
|
161
|
-
niro build --no-watch # trigger and return immediately
|
|
162
146
|
```
|
|
147
|
+
You already have 5 working copies of this project, which is the limit (5).
|
|
148
|
+
They are for: feature/a, feature/b, feature/c, feature/d, feature/e.
|
|
163
149
|
|
|
164
|
-
|
|
165
|
-
|
|
150
|
+
You have 5 working copies of this project on this machine:
|
|
151
|
+
feature/a /home/you/work/service
|
|
152
|
+
feature/b /home/you/work/service-wt2
|
|
153
|
+
...
|
|
154
|
+
```
|
|
166
155
|
|
|
167
|
-
|
|
156
|
+
Run `niro discard-temp-project` in one you have finished with, then try again. Copies nobody has
|
|
157
|
+
touched for a while are also cleared automatically.
|
|
168
158
|
|
|
169
159
|
---
|
|
170
160
|
|
|
171
|
-
##
|
|
172
|
-
|
|
173
|
-
Niro discovers env-var **names** from your code and their **default values** from committed config files. When the same variable appears in several files (e.g. `application.yml` vs `application-prod.yml`), you choose which file's value to use — the same as the web UI.
|
|
161
|
+
## Measure what Niro changes
|
|
174
162
|
|
|
175
|
-
**Terminal**
|
|
176
163
|
```bash
|
|
177
|
-
niro
|
|
178
|
-
niro edit --list-env --json # machine-readable (secret values masked)
|
|
179
|
-
niro edit --set-env PORT=9000 # set a value directly (never printed back)
|
|
180
|
-
niro edit --set-env-from PORT=application-prod.yml # adopt that file's value for PORT
|
|
181
|
-
niro edit --rescan-env # re-scan after adding config files
|
|
164
|
+
niro ab enable
|
|
182
165
|
```
|
|
166
|
+
Runs Niro **off** for half your sessions for 14 days, so you can compare. Applies to your whole
|
|
167
|
+
account, and asks before it starts.
|
|
183
168
|
|
|
184
|
-
Secret values are always masked (`****`) — whether the variable *name* looks secret (`DB_PASSWORD`) **or** its *value* embeds credentials (`DATABASE_URL=postgres://user:pass@host`). You pick those by file name; the value is never shown.
|
|
185
|
-
|
|
186
|
-
**Ask the agent**
|
|
187
|
-
> "Set PORT from application-prod.yml" or "What env vars does this project have?" — the agent runs `niro edit --list-env --json`, shows you the choices, and applies your pick with `--set-env-from`. It chooses **by file name** and never handles raw secret values.
|
|
188
|
-
|
|
189
|
-
---
|
|
190
|
-
|
|
191
|
-
## Scenario 7 — Rename a project, or add/remove a repo
|
|
192
|
-
|
|
193
|
-
**Terminal**
|
|
194
169
|
```bash
|
|
195
|
-
niro
|
|
196
|
-
niro edit --add-repo <gitId> # map a registered repo into the project
|
|
197
|
-
niro edit --remove-repo <gitId> # unmap a repo (non-destructive)
|
|
198
|
-
niro edit --project my-service --alias renamed # target a project explicitly
|
|
170
|
+
niro ab report
|
|
199
171
|
```
|
|
172
|
+
The with-Niro and without-Niro comparison.
|
|
200
173
|
|
|
201
|
-
|
|
202
|
-
|
|
174
|
+
```bash
|
|
175
|
+
niro ab disable
|
|
176
|
+
```
|
|
177
|
+
Stop early. Every session uses Niro again.
|
|
203
178
|
|
|
204
179
|
---
|
|
205
180
|
|
|
206
|
-
##
|
|
207
|
-
|
|
208
|
-
`niro init` and `niro add repo` install a background daemon (via PM2) that re-uploads your changes and keeps the graph fresh — honoring `.gitignore` so secrets never leave your machine.
|
|
181
|
+
## Connect another assistant
|
|
209
182
|
|
|
210
|
-
**Terminal**
|
|
211
183
|
```bash
|
|
212
|
-
niro
|
|
213
|
-
niro service status
|
|
214
|
-
niro service uninstall
|
|
215
|
-
niro watch # run a watch in the foreground (debugging / no PM2)
|
|
184
|
+
niro mcp install
|
|
216
185
|
```
|
|
186
|
+
Pick from the list, or `--client <id>` to skip the prompt. Restart the assistant afterwards.
|
|
217
187
|
|
|
218
|
-
---
|
|
219
|
-
|
|
220
|
-
## Scenario 9 — Remove a project or detach a repo
|
|
221
|
-
|
|
222
|
-
**Terminal**
|
|
223
188
|
```bash
|
|
224
|
-
niro
|
|
225
|
-
niro remove --project --confirm-name my-service # delete the WHOLE project (guarded)
|
|
189
|
+
niro mcp install --list
|
|
226
190
|
```
|
|
191
|
+
All 14 supported clients and the file each one is configured through.
|
|
227
192
|
|
|
228
|
-
|
|
193
|
+
```bash
|
|
194
|
+
niro mcp uninstall --all -y
|
|
195
|
+
```
|
|
196
|
+
Removes everything install added: MCP config, hooks and skills. Leaves you logged in.
|
|
229
197
|
|
|
230
|
-
|
|
231
|
-
> "Remove the Niro project `my-service`." — the agent confirms with you, then runs `niro remove --project --confirm-name my-service`.
|
|
198
|
+
Per-client details: [docs/connect-your-ai-assistant.md](https://unpkg.com/@niroai/niro/docs/connect-your-ai-assistant.md)
|
|
232
199
|
|
|
233
200
|
---
|
|
234
201
|
|
|
235
|
-
##
|
|
236
|
-
|
|
237
|
-
After `niro mcp install` (and a restart of your assistant), the `niro-skill` routes code questions through Niro's graph instead of grep:
|
|
238
|
-
|
|
239
|
-
> "What calls `chargeCard()`?"
|
|
240
|
-
> "What breaks if I change the `Invoice` schema?"
|
|
241
|
-
> "Where is the auth middleware wired up?"
|
|
242
|
-
> "Is there existing code that parses webhooks before I write a new one?"
|
|
243
|
-
|
|
244
|
-
This works in any folder that resolves to a Niro project (via its git remote or a `.niro-project` pin).
|
|
202
|
+
## Managing projects
|
|
245
203
|
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
## Scenario 11 — Disconnect an AI assistant (uninstall the MCP)
|
|
204
|
+
```bash
|
|
205
|
+
niro edit --list-env
|
|
206
|
+
```
|
|
207
|
+
Environment variables Niro found, with secret values masked.
|
|
252
208
|
|
|
253
|
-
|
|
209
|
+
```bash
|
|
210
|
+
niro edit --set-env KEY=VALUE
|
|
211
|
+
```
|
|
212
|
+
Set one. The value is never printed or logged.
|
|
254
213
|
|
|
255
|
-
**Terminal**
|
|
256
214
|
```bash
|
|
257
|
-
niro
|
|
258
|
-
niro mcp uninstall --client claude-code # remove from one editor, no prompt
|
|
259
|
-
niro mcp uninstall --client claude-code,codex # remove from several in one go
|
|
260
|
-
niro mcp uninstall --all -y # remove from every editor, skip the confirm
|
|
215
|
+
niro edit --alias new-name
|
|
261
216
|
```
|
|
217
|
+
Rename a project.
|
|
262
218
|
|
|
263
|
-
|
|
219
|
+
```bash
|
|
220
|
+
niro remove --unmap-repo <gitId>
|
|
221
|
+
```
|
|
222
|
+
Detach a repo from a project. Nothing is deleted.
|
|
264
223
|
|
|
265
|
-
|
|
266
|
-
|
|
224
|
+
```bash
|
|
225
|
+
niro remove --project --confirm-name <name>
|
|
226
|
+
```
|
|
227
|
+
Delete a whole project. Destructive, hence the confirmation.
|
|
267
228
|
|
|
268
229
|
---
|
|
269
230
|
|
|
270
|
-
##
|
|
231
|
+
## Keeping in sync
|
|
271
232
|
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
Two things to know before you start one:
|
|
233
|
+
```bash
|
|
234
|
+
niro service status
|
|
235
|
+
```
|
|
236
|
+
Is the background watcher running? It syncs your indexed folders as you edit.
|
|
278
237
|
|
|
279
|
-
|
|
280
|
-
|
|
238
|
+
```bash
|
|
239
|
+
niro service install
|
|
240
|
+
```
|
|
241
|
+
Start it and have it come back on login. Needs PM2 (`npm install -g pm2`).
|
|
281
242
|
|
|
282
|
-
**Terminal**
|
|
283
243
|
```bash
|
|
284
|
-
niro
|
|
285
|
-
niro ab enable # start a 14-day window (states the scope, asks first)
|
|
286
|
-
niro ab enable --days 30 --name "Q3 trial"
|
|
287
|
-
niro ab enable --yes # skip the confirm (scripts / CI)
|
|
288
|
-
niro ab report # the with-Niro / without-Niro comparison
|
|
289
|
-
niro ab report --json # same, machine-readable
|
|
290
|
-
niro ab disable # stop early; every session uses Niro again
|
|
244
|
+
niro watch
|
|
291
245
|
```
|
|
246
|
+
Watch this folder in the foreground instead, for one session.
|
|
292
247
|
|
|
293
|
-
|
|
294
|
-
Niro tool calls, and median context size. A figure the server has not recorded reads
|
|
295
|
-
`not measured` rather than `0`, because `0` is a real result here: an off-bucket session
|
|
296
|
-
genuinely makes zero Niro tool calls.
|
|
248
|
+
---
|
|
297
249
|
|
|
298
|
-
|
|
250
|
+
## Reference
|
|
299
251
|
|
|
300
|
-
|
|
301
|
-
|
|
252
|
+
Add `--help` to any command for its flags. Add `--json` to `whoami`, `info`, `status`,
|
|
253
|
+
`projects`, `build`, `ab report`, `edit --list-env` and `doctor sync-registry` for machine-readable
|
|
254
|
+
output.
|
|
302
255
|
|
|
303
|
-
|
|
256
|
+
| File | What it holds |
|
|
257
|
+
|---|---|
|
|
258
|
+
| `~/.niro/credentials.json` | Your login, mode `0600` |
|
|
259
|
+
| `~/.niro/config.json` | Backend URLs saved during setup |
|
|
260
|
+
| `~/.niro/projects.json` | Per-folder sync state |
|
|
261
|
+
| `.niro-project` | Pins a repo folder to a Niro project |
|
|
304
262
|
|
|
305
|
-
|
|
263
|
+
| Variable | What it sets | Default |
|
|
264
|
+
|---|---|---|
|
|
265
|
+
| `NIRO_API_URL` | Backend the CLI talks to | `https://aiorchestrator.niroai.dev` |
|
|
266
|
+
| `NIRO_MCP_SERVER_URL` | Backend the MCP server talks to | `https://aiassistant.niroai.dev` |
|
|
267
|
+
| `NIRO_API_KEY` | Read by the MCP server when running headless. For CI, prefer `niro login --api-key` | none |
|
|
268
|
+
| `NIRO_UPLOAD_CONCURRENCY` / `_TIMEOUT_MS` / `_MAX_TOTAL_BYTES` / `_MAX_FILES` | Tune the first upload | 4 / 60000 / 1 GiB / 50000 |
|
|
306
269
|
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
| `niro start [path]` | First-time setup end to end: sign in, onboard this folder, connect an assistant |
|
|
310
|
-
| `niro login` / `logout` / `whoami` | Authenticate / sign out / show current account |
|
|
311
|
-
| `niro init [path]` | Onboard a folder end-to-end (upload, project, env scan, build, watch) |
|
|
312
|
-
| `niro info [path]` | What Niro knows about this folder (repo, branch, project(s), status) |
|
|
313
|
-
| `niro projects` (`niro ls`) | List all projects in your account |
|
|
314
|
-
| `niro status [project]` | Live build status for a project |
|
|
315
|
-
| `niro build [project]` | Trigger a rebuild and stream progress |
|
|
316
|
-
| `niro edit …` | Rename, map/unmap repos, manage env vars (incl. `--set-env-from`) |
|
|
317
|
-
| `niro remove …` | Delete a project (`--project`, guarded) or detach a repo (`--unmap-repo`) |
|
|
318
|
-
| `niro add repo [path\|url]` | Register a local folder or remote git URL |
|
|
319
|
-
| `niro add project` | Create a project from registered repos |
|
|
320
|
-
| `niro watch [path]` / `niro service …` | Foreground watch / manage the auto-sync daemon |
|
|
321
|
-
| `niro mcp install` | Connect an AI assistant + install the agent skills (one per run; `--client <id>` to skip the prompt, `--url <url>` for your own backend) |
|
|
322
|
-
| `niro mcp uninstall` | Disconnect an AI assistant — reverses `mcp install` (`--client <id>` / `--all`, `-y` to skip confirm) |
|
|
323
|
-
| `niro ab status\|enable\|disable\|report` | Run Niro off for half your sessions for a fixed window, then compare (`--days`, `--name`, `--yes`, `--json`) |
|
|
324
|
-
| `niro delete [project]` | Older whole-project delete (prefer `niro remove --project`) |
|
|
325
|
-
|
|
326
|
-
Add `--json` to `whoami`, `info`, `status`, `projects`, `build`, `ab report`, and `edit --list-env` for machine-readable output. Add `--help` to any command for its full flags.
|
|
270
|
+
Running your own instance? Set `NIRO_API_URL` before `niro login`, and pass `--url <url>` to
|
|
271
|
+
`niro mcp install`.
|
|
327
272
|
|
|
328
273
|
---
|
|
329
274
|
|
|
330
|
-
##
|
|
275
|
+
## What leaves your machine
|
|
331
276
|
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
| `~/.niro/projects.json` | Per-folder sync state (gitId, patterns, file hashes) |
|
|
337
|
-
| `.niro-project` (in a repo) | Pins that folder to a Niro project (single line: project id or alias) |
|
|
277
|
+
Source and config files from the folder you confirmed, and nothing else. `.gitignore` is
|
|
278
|
+
honoured, so a gitignored `.env` is never sent. Raw `.env` and `*.properties` files are not in
|
|
279
|
+
the upload set; committed files like `application.yml` and `.env.example` are, because they hold
|
|
280
|
+
defaults rather than secrets.
|
|
338
281
|
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
| `NIRO_API_URL` | CLI → ai-orchestrator base URL | `https://aiorchestrator.niroai.dev` |
|
|
342
|
-
| `NIRO_MCP_SERVER_URL` | MCP server (ai-assistant) base URL | `https://aiassistant.niroai.dev` |
|
|
343
|
-
| `NIRO_API_KEY` | Read by the **MCP server** (e.g. headless `niro mcp serve`) — not a CLI-command auth path; for CI use `niro login --api-key` | — |
|
|
344
|
-
| `NIRO_UPLOAD_CONCURRENCY` / `NIRO_UPLOAD_TIMEOUT_MS` / `NIRO_UPLOAD_MAX_TOTAL_BYTES` / `NIRO_UPLOAD_MAX_FILES` | Tune the initial upload | 4 / 60000 / 1 GiB / 50000 |
|
|
282
|
+
Secret values are never printed: `--set-env` does not echo them, and `--list-env` masks anything
|
|
283
|
+
that looks like a secret by name or by content.
|
|
345
284
|
|
|
346
285
|
---
|
|
347
286
|
|
|
348
|
-
##
|
|
287
|
+
## If something is wrong
|
|
349
288
|
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
- **The agent never handles raw secret values.** It picks env sources *by file name*; you type any real secret yourself.
|
|
289
|
+
**The assistant ignores Niro.** Restart it. Skills load at startup, so a fresh `niro mcp install`
|
|
290
|
+
does nothing until you do.
|
|
353
291
|
|
|
354
|
-
|
|
292
|
+
**`niro: command not found`.** Your global npm bin is not on `PATH`. Check with `npm bin -g`.
|
|
355
293
|
|
|
356
|
-
|
|
294
|
+
**This folder maps to several projects.** Pass `--project <alias|id>`, or pick one when asked.
|
|
357
295
|
|
|
358
|
-
-
|
|
359
|
-
- **`niro` not found** — ensure your global npm bin is on `PATH` (`npm bin -g`).
|
|
360
|
-
- **A folder maps to multiple projects** — pass `--project <alias|id>` (or pick one when prompted).
|
|
361
|
-
- **Auto-sync isn't running** — install PM2 (`npm install -g pm2`) then `niro service install`.
|
|
296
|
+
**Auto-sync is not running.** `npm install -g pm2`, then `niro service install`.
|
|
362
297
|
|
|
363
|
-
|
|
298
|
+
**A folder was refused.** Niro will not index your home folder, or a folder with no build file
|
|
299
|
+
in it. Point it at the repo you meant.
|
|
364
300
|
|
|
365
|
-
|
|
301
|
+
---
|
|
366
302
|
|
|
367
303
|
MIT
|
|
@@ -63,6 +63,61 @@ Run this in the repo folder:
|
|
|
63
63
|
It deletes your private copy. Your local files are never touched.
|
|
64
64
|
If you forget, Niro deletes unused copies by itself after two weeks.
|
|
65
65
|
|
|
66
|
+
## Tidying up copies that were deleted for you
|
|
67
|
+
|
|
68
|
+
When a copy goes after two weeks, or somebody deletes it in the web app,
|
|
69
|
+
your machine is not told. The folder is left pointing at a copy that is
|
|
70
|
+
no longer there. Nothing breaks, but "niro new-temp-project" in another
|
|
71
|
+
worktree of the same repo will say the slot is already taken.
|
|
72
|
+
|
|
73
|
+
Run this from anywhere to sort it out:
|
|
74
|
+
|
|
75
|
+
niro doctor sync-registry
|
|
76
|
+
|
|
77
|
+
You will rarely need to type it. The background watcher runs the same
|
|
78
|
+
check every six hours by itself.
|
|
79
|
+
|
|
80
|
+
It sorts out three things, and treats them differently:
|
|
81
|
+
|
|
82
|
+
- A folder pointing at a private copy that has gone goes back to the
|
|
83
|
+
original project, and carries on syncing.
|
|
84
|
+
- A folder pointing at a project that has gone is only unregistered when
|
|
85
|
+
the repo has gone too. A project can be deleted while its repos are
|
|
86
|
+
moved somewhere else, and that folder is still syncing perfectly well.
|
|
87
|
+
- A ".niro-project" file naming something the server does not know is
|
|
88
|
+
repaired where possible. That file can hold a project's NAME rather
|
|
89
|
+
than its id, so a renamed project looks exactly like a deleted one.
|
|
90
|
+
Niro checks your folder's git remote instead: if that points at one
|
|
91
|
+
project, the file is rewritten to that project's id, which a future
|
|
92
|
+
rename cannot break. If the remote points at nothing either, the file
|
|
93
|
+
names nothing and is removed.
|
|
94
|
+
|
|
95
|
+
Not if the file is committed to git, though. Then it is shared with
|
|
96
|
+
everyone who clones the repo, and a project that means nothing to you
|
|
97
|
+
may be a colleague's. Niro tells you and leaves the choice to you.
|
|
98
|
+
"niro info" mentions it too, when you are standing in that folder.
|
|
99
|
+
|
|
100
|
+
Copies that are still there are left alone, and so is anything it could
|
|
101
|
+
not check, so a dropped connection never costs you a working folder. Add
|
|
102
|
+
"--dry-run" to see the list without changing anything.
|
|
103
|
+
|
|
104
|
+
## When you run out of private copies
|
|
105
|
+
|
|
106
|
+
You get a limited number of private copies of each project. When you hit
|
|
107
|
+
the limit, Niro says which branches are holding them, and the CLI adds
|
|
108
|
+
where each one is checked out on this machine:
|
|
109
|
+
|
|
110
|
+
You already have 5 working copies of this project, which is
|
|
111
|
+
the limit (5). They are for: feature/a, feature/b, ...
|
|
112
|
+
|
|
113
|
+
You have 5 working copies of this project on this machine:
|
|
114
|
+
feature/a /home/you/work/service
|
|
115
|
+
feature/b /home/you/work/service-wt2
|
|
116
|
+
|
|
117
|
+
Run "niro discard-temp-project" in one you have finished with, then try
|
|
118
|
+
again. Copies nobody has touched for a while are cleared automatically,
|
|
119
|
+
so this usually sorts itself out.
|
|
120
|
+
|
|
66
121
|
## A feature that spans several repos
|
|
67
122
|
|
|
68
123
|
Run "niro new-temp-project" in each repo folder you branch.
|