@nolto/cli 0.24.0 → 0.25.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.
Files changed (3) hide show
  1. package/README.md +19 -1
  2. package/dist/index.js +528 -139
  3. package/package.json +4 -4
package/README.md CHANGED
@@ -285,6 +285,24 @@ List output is one line per issue plus `n / total (page p)`. View includes body
285
285
  | 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. |
286
286
  | 5 | Network/generic HTTP errors, including a 404 without an API error string |
287
287
 
288
+ ### Wiki
289
+
290
+ Same global options and project priority as Issues. `<page>` is a UUID, a 6-character shortId, a page URL (`…/projects/<id>/wiki/<page-id>`) or a short URL (`https://nol.to/w/<shortId>`). A page of another project exits 2. Delete, revision history/restore and attachments are not available in the CLI; use the web app. Token scopes: `wiki:read` for list, view and search; `wiki:write` for create, update and move.
291
+
292
+ | Command | Options |
293
+ |---|---|
294
+ | `wiki list` | Pages as an indented tree with shortId (and share markers in internal mode) |
295
+ | `wiki view <page>` | `--body-only` prints only the body for reading; `--output <path>` writes the body to a file exactly as stored (not combinable with `--body-only`) |
296
+ | `wiki search <query>` | Query of 1 to 100 characters |
297
+ | `wiki create` | Required `--title`; `--body` or `--body-file` (`-` for stdin); `--parent <page>` (default: top level) |
298
+ | `wiki update <page>` | `--title`, `--body` or `--body-file` (at least one); `--base-revision <n>` |
299
+ | `wiki move <page>` | Required `--parent <page-or-none>` and `--position <n>` (from 0); `--confirm-share` |
300
+
301
+ - Edit round trip: `nolto wiki view X` (note `revision`), `nolto wiki view X --output page.md`, edit, `nolto wiki update X --body-file page.md --base-revision <revision>`. With `--base-revision`, a page saved by someone else in between fails with exit 2 (409 `wiki_revision_conflict`) and the message shows the latest revision; view again and retry. The field is sent only when the option is given; without it the last save wins. `--body-only` is for reading in a terminal: it replaces control characters, so do not use it for the round trip.
302
+ - Secrets: view shows a ```` ```secret id=… ```` line instead of the value. Keep that line when you send the body back. A new ```` ```secret <name> ```` fence is encrypted when saved. If the API detects what looks like a password in the text, it saves the page and returns warnings, shown as `注意: <message>` lines.
303
+ - `move --confirm-share`: a move that changes which pages customers can see fails with exit 2 (409 `share_visibility_change`, showing the number of pages and the direction). Re-run with `--confirm-share` only after checking, and with the user's go-ahead. Writes are in internal mode; to write under a shared page, give a parent below the share root.
304
+ - `--json` returns the API response unchanged (list: `{ pages }` as a flat array; view: `{ page, latestRevision, … }`; create, update, move: `{ page, warnings? }`; search: `{ results }`).
305
+ - Exit codes are the same as Issues. 404 `見つかりません。` adds a hint that the project may have the Wiki turned off, or the member may not have the Wiki feature.
288
306
 
289
307
  ## Roadmap conflicts
290
308
 
@@ -347,7 +365,7 @@ Precedence: CLI flags > environment variables > `nolto.json` > config file > def
347
365
 
348
366
  ## JSON Output
349
367
 
350
- `nolto issue … --json` returns the original API response; `create --phase` adds `roadmap: { file, taskId }` metadata (file is the cache path). `whoami` includes `tokenScopes` / `tokenProject` when token introspection succeeds.
368
+ `nolto issue … --json` and `nolto wiki … --json` return the original API response; `create --phase` adds `roadmap: { file, taskId }` metadata (file is the cache path). `whoami` includes `tokenScopes` / `tokenProject` when token introspection succeeds.
351
369
 
352
370
  Use the global `--json` option for machine-readable command output:
353
371