@invariant.guru/cli 0.5.6 → 0.6.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/README.md CHANGED
@@ -151,12 +151,30 @@ invariant plan "implement the cargo booking command" --context nest-clean-archit
151
151
  invariant plan "implement the cargo booking command" --full
152
152
  ```
153
153
 
154
+ Every session file starts with a `<session-meta>` header carrying its title and
155
+ status (`draft` → `planned` → `in-progress` → `executed`). The agent updates it
156
+ as the work progresses; the UI reads it.
157
+
154
158
  When the session is done, stamp it:
155
159
 
156
160
  ```bash
157
161
  invariant plan:complete <session-id> --summary "Booking command + tests"
158
162
  ```
159
163
 
164
+ ### 6. `invariant ui` — see and manage your sessions
165
+
166
+ Opens a local dashboard for this project's sessions: a board grouped by status,
167
+ rendered markdown, a rich editor, and a command palette.
168
+
169
+ ```bash
170
+ invariant ui # start on 4200 (or the next free port) and open a browser
171
+ invariant ui status # every running instance on this machine
172
+ invariant ui stop # stop this project's instance
173
+ ```
174
+
175
+ Each directory gets its own instance on its own port, so several repositories can
176
+ be open at once without ever mixing sessions.
177
+
160
178
  ### Full walkthrough
161
179
 
162
180
  ```bash
@@ -165,6 +183,7 @@ invariant install github:invariant-guru/inv-nest-clean-architecture
165
183
  invariant add nest-clean-architecture # activate the whole module
166
184
  invariant sync
167
185
  invariant plan "add the cargo booking command"
186
+ invariant ui # follow it through to done
168
187
  ```
169
188
 
170
189
  ---
@@ -381,7 +400,9 @@ invariant plan "implement user authentication" --context nest-clean-architecture
381
400
 
382
401
  ### `invariant plan:complete <session>`
383
402
 
384
- Stamp a completion header at the top of a finished session file.
403
+ Mark a session finished: sets `<status>` to `executed` and stamps `<summary>` and
404
+ `<completed>` in the session's `<session-meta>` header. Notes are appended to the
405
+ body as a **Completion notes** section.
385
406
 
386
407
  ```bash
387
408
  invariant plan:complete session-uuid --summary "Auth command + e2e tests"
@@ -394,6 +415,46 @@ invariant plan:complete session-uuid -n "Follow-up: rate limiting" -d 2026-08-19
394
415
  | `-n, --note <note>` | Extra note line (repeatable) |
395
416
  | `-d, --date <date>` | Completion date (`YYYY-MM-DD`), defaults to today |
396
417
 
418
+ ### `invariant ui [port]`
419
+
420
+ Start (or attach to) the local session UI for the current project, then open a
421
+ browser. One instance per directory; the default port is 4200 and the next free
422
+ port is used when it is taken.
423
+
424
+ ```bash
425
+ invariant ui # start and open a browser
426
+ invariant ui 4300 # ask for a specific port (fails if it is busy)
427
+ invariant ui --no-open # start without opening a browser
428
+ invariant ui status --json # machine-readable status of every instance
429
+ invariant ui stop --all # stop every instance on this machine
430
+ invariant ui migrate-headers # add <session-meta> headers to legacy sessions
431
+ ```
432
+
433
+ | Subcommand | Description |
434
+ |--------|-------------|
435
+ | *(none)* / `start [port]` | Start or attach, then open a browser |
436
+ | `stop` | Stop this project's instance (`--all` for every instance) |
437
+ | `status` | Every instance, liveness-checked (`--json`) |
438
+ | `migrate-headers` | Give legacy session files a canonical `<session-meta>` header |
439
+
440
+ | Option | Description |
441
+ |--------|-------------|
442
+ | `-p, --port <port>` | Port to listen on (default 4200) |
443
+ | `--no-open` | Do not open a browser window |
444
+
445
+ The server binds `127.0.0.1` only, checks `Host` and `Origin`, and requires a
446
+ per-instance token kept in `~/.invariant/ui.json` (mode 0600). What it can read
447
+ and write is limited to the directory it was started in.
448
+
449
+ In the UI: `⌘K` opens the command palette, `⇧⌘V` toggles rendered preview and
450
+ editing, `N` starts a session, `?` lists every shortcut.
451
+
452
+ To work on the UI itself: start a daemon (`invariant ui --no-open`), then run
453
+ `yarn dev:ui` for Vite with hot reload against it — `INVARIANT_UI_PORT=<port>`
454
+ when the daemon landed on something other than 4200.
455
+
456
+ See [docs/spec-ui.md](docs/spec-ui.md) for the header contract and the HTTP API.
457
+
397
458
  ### `invariant scan`
398
459
 
399
460
  Scan the codebase with embedded tree-sitter grammars and write a CodeGraph to `.invariant/codegraph/` — a structured inventory of files, languages, and top-level symbols for LLM navigation.
@@ -533,6 +594,7 @@ After `init` + `install` + `sync`:
533
594
  │ ├── contexts/ # rendered contexts
534
595
  │ ├── instructions/ # rendered instructions
535
596
  │ ├── sessions/ # `invariant plan` output
597
+ │ │ └── .archive/ # sessions archived from the UI
536
598
  │ └── codegraph/ # `invariant scan` output
537
599
  ├── .agents/ # canonical store — the only physical copy
538
600
  │ ├── skills/<name>/SKILL.md