@nolto/cli 0.21.0 → 0.22.1

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
@@ -159,6 +159,28 @@ After roadmap sync, the CLI reads the latest 300 commits, extracts uppercase iss
159
159
 
160
160
  This requires `roadmap:sync` token permission and the project's `git_links` scope. Ingestion errors are warnings and do not fail roadmap sync. Disable with `nolto sync --no-git-links` or `NOLTO_GIT_LINKS=0` (also applies to watch). Watch collects at startup and on roadmap/plan changes, not on Git-only changes. Missing Git or a non-worktree is skipped. Counts distinguish newly linked rows, existing links, and unresolved keys (skipped). The log reads `git links: linked N (existing M, skipped K)`. JSON output includes `gitLinks: { linked, existing, skipped } | null`.
161
161
 
162
+ ### Memory Commands
163
+
164
+ | Command | Options / behavior |
165
+ |---|---|
166
+ | `memory pull` | Sync entries and cleanup candidates; `--scope <csv>` |
167
+ | `memory context` | Print the cached index, including cleanup candidates |
168
+ | `memory list` | List live entries; `--scope <scope>`, `--all-branches` |
169
+ | `memory list --deleted` | List cached deleted entries with revision and restoration instructions; `--scope <scope>` |
170
+ | `memory show <name>` | Print frontmatter and body; `--scope`, `--branch`, `--fresh` |
171
+ | `memory put <file>` | Save a draft; `--new`, `--no-ai` |
172
+ | `memory candidates` | List all current cleanup candidates; use the last synced cache if the request fails |
173
+ | `memory rm <names...>` | Delete one or more entries in order; `--scope` and `--branch` apply to all names; continue after failures and exit 2 |
174
+ | `memory log <name>` | Read revision history |
175
+ | `memory revert <name> <revision>` | Restore a revision |
176
+
177
+ These commands support `--json`. From CLI 0.22.0, drafts can declare
178
+ `expires: YYYY-MM-DD`, `ttl: 7d` (1–365 days, converted to a local date on put),
179
+ or `until: NF-51` / `#51` / `<roadmap-slug>/<task-id>`. Use either `expires` or
180
+ `ttl`; either can be combined with `until`. Removing the fields from a draft
181
+ clears the lifetime on put; import ignores lifetime fields in source files.
182
+ Cleanup candidates stay stored until explicitly deleted.
183
+
162
184
  ### Roadmap Commands
163
185
 
164
186
  The server is the roadmap source of truth. Task updates use PATCH and save the
@@ -174,13 +196,13 @@ when its PUT response omits it.
174
196
  | `roadmap sync [slug]` | `--no-git-links`; omit slug to push all |
175
197
  | `roadmap status [slug]` | `--fresh`; progress, current task, revision and cache age warning |
176
198
  | `roadmap validate [slug]` | Validate cached JSON; errors exit 1 |
177
- | `roadmap summary [slug] --text <text>` | Replace summary and PUT |
199
+ | `roadmap summary [slug] --text <text>` | Show the previous summary from the local cache, replace summary and PUT; JSON adds `previousSummary` when present |
178
200
  | `roadmap start <task>` | `--slug <slug>`, `--note <text>`; PATCH in-progress and current task |
179
201
  | `roadmap done <task>` | `--slug <slug>`, `--note <text>`; PATCH done |
180
202
  | `roadmap block <task> --note <text>` | `--slug <slug>`; PATCH blocked |
181
203
  | `roadmap todo <task>` | `--slug <slug>`, `--note <text>`; PATCH todo and clear task timestamps |
182
204
  | `roadmap plan <task> --path <path>` | `--slug <slug>`; PATCH plan link, then PUT its document |
183
- | `roadmap events [slug]` | `--since <revision>`, `--limit <number>`; task history |
205
+ | `roadmap events [slug]` | `--since <revision>`, `--limit <number>`; task and summary change history. Human output uses `roadmap` for summary changes and limits from/to values to 200 code points; `--json` preserves the full response |
184
206
  | `roadmap migrate` | `--yes`; migrate legacy repository JSON to the server/cache |
185
207
 
186
208
  Except for pull/sync (which process all roadmaps), omitting a slug selects the only
@@ -210,7 +232,7 @@ Git commands.
210
232
 
211
233
  All commands accept global `--project <id>`, `--json`, `--token <value>` and `--base-url <url>`.
212
234
  Project priority: flag → NOLTO_PROJECT → nearest ancestor nolto.json → config defaultProjectId. Git is not required. An invalid nolto.json remains an error.
213
- References accept a key (NOLTO-12) or number (12). Only the number is sent: a different key prefix does not protect against acting on the same number in the selected project.
235
+ References accept a key (NOLTO-12) or number (12). Only the number is sent. With `--shared`, a key prefix must match the selected project's key when the project has one; without `--shared`, a different prefix does not protect against acting on the same number in the selected project.
214
236
 
215
237
  | Command | Options |
216
238
  |---|---|
@@ -221,16 +243,19 @@ References accept a key (NOLTO-12) or number (12). Only the number is sent: a di
221
243
  | `issue comment <ref>` | `-m/--comment <text>` or `--body-file <path-or-dash>` |
222
244
  | `issue close <ref>` | `--status <closed-name-or-UUID>`, `-m/--comment <text>` |
223
245
 
246
+ - `--shared` on create, update, comment or close writes in shared mode: customers see the text as written. The default is internal. Shared mode is available only in Pro+ projects with customers; other projects fail before any write. It cannot be combined with `create --draft`, `--priority` or `--category`. Human success output adds ` (shared)` to the first line; JSON responses stay unchanged.
247
+ - `--confirm-references` on create, update, comment or close sends `confirmReferences: true`. Do not add it on the first attempt. After a 409 `internal_references`, check the references customers cannot open (the API lists at most five and reports only the count for the rest). Remove or rewrite those references first. To send the text as written, get the user's go-ahead before retrying with this flag; the references will remain inaccessible to customers. This 409 can also occur without `--shared` when updating the subject or body of a shared issue. Human success output adds ` (references confirmed)`, or ` (shared, references confirmed)` with both flags; JSON success responses stay unchanged. Agents (LLMs) must use `--shared` and `--confirm-references` only with the user's instruction or approval.
248
+
224
249
  Status/type/category accept case-insensitive exact names or UUIDs from the project's settings. Unknown or ambiguous names list candidates. Create with `--type` and no body uses that type's body template. Update never inserts a template automatically. Close chooses the first closed status by sortOrder unless overridden; it fails if no matching closed status exists. `--assignee me` on writes resolves /api/me/profile; none clears the assignee.
225
250
 
226
- List output is one line per issue plus `n / total (page p)`. View includes body and comments with API-token provenance. Writes print the issue key and URL. `--json` preserves API responses: list `{ issues, total, page, pageSize }`, view the full bundle, create `{ issue }`, update/close `{ issue, comment }`, comment `{ comment }`. Successful create with phase additionally returns `roadmap: { file, taskId }`. Human template creation adds `body: from template`. `whoami` adds scopes (null displayed as full) and project binding; JSON uses tokenScopes/tokenProject when introspection succeeds. Introspection failure is non-fatal and retains the old output.
251
+ List output is one line per issue plus `n / total (page p)`. View includes body and comments with API-token provenance. Writes print the issue key and URL. `--json` preserves API responses: list `{ issues, total, page, pageSize }`, view the full bundle, create `{ issue }`, update/close `{ issue, comment }`, comment `{ comment }`. Successful create with phase additionally returns `roadmap: { file, taskId }`. Human template creation adds `body: from template`. Successful issue create (including `--draft`), update, comment, publish and close append API warnings as `注意: <message>` lines. JSON keeps the response `warnings` unchanged. `whoami` adds scopes (null displayed as full) and project binding; JSON uses tokenScopes/tokenProject when introspection succeeds. Introspection failure is non-fatal and retains the old output.
227
252
 
228
253
  `--phase` refers to a **task ID**, not a phase ID. After creation it adds the issue key to task.issues in the cached roadmap (`nolto roadmap path`), avoids duplicates, keeps schemaVersion and updatedAt unchanged, and runs `nolto roadmap sync` for that slug. If the key is already attached, nothing is written or synced. If multiple roadmaps are cached, use `--roadmap <slug>`. A failure after issue creation (missing task, roadmap selection, or sync) exits 2 and the error includes the created key; add it to task.issues in the cache and run `nolto roadmap sync` instead of repeating create.
229
254
 
230
255
  | Exit | Meaning |
231
256
  |---|---|
232
257
  | 0 | Success |
233
- | 2 | Invalid input, recognized API 404, HTTP 422 (details shown), or roadmap cache/sync failure after creation |
258
+ | 2 | Invalid input, recognized API 404, HTTP 422 (details shown), secret_detected (possible secret; message shown), internal_references (confirmation required), or roadmap cache/sync failure after creation |
234
259
  | 3 | HTTP 401/403; token_scope/token_project includes a token settings hint |
235
260
  | 4 | Plan / quota limit (HTTP 402) or rate limit (HTTP 429); resolve or wait before retrying. Token writes: 60/minute; wait Retry-After seconds before retrying. |
236
261
  | 5 | Network/generic HTTP errors, including a 404 without an API error string |
@@ -308,7 +333,7 @@ Errors are written to stderr:
308
333
 
309
334
  ## Exit Codes
310
335
 
311
- Issue validation and API 404 with an error string exit 2; 422 includes details. Token scope/project denial exits 3 with a token-settings URL and whoami hint. A create/phase failure explicitly reports the already-created key.
336
+ Issue validation and API 404 with an error string exit 2; 422 includes details. `secret_detected` exits 2 and displays the server message (possible secret; message shown), without a details line. JSON errors also include `code` and `findings` (field/rule/line only). Token scope/project denial exits 3 with a token-settings URL and whoami hint. A create/phase failure explicitly reports the already-created key.
312
337
 
313
338
  | Code | Meaning |
314
339
  |---|---|