@artifactshare/cli 0.11.2 → 0.12.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 CHANGED
@@ -5,6 +5,17 @@ For user-facing announcements, see https://artifactshare.com/updates?product=cli
5
5
 
6
6
  ## Unreleased
7
7
 
8
+ ## 0.12.0 - 2026-08-29
9
+
10
+ - Add `preview <file>` for local review: serve a `.md` or `.html` file with the product viewer look on `127.0.0.1` without authentication, print one ready JSON line, and let the user annotate elements and text selections in the browser as explicit batches. Agents collect batches with `preview next [--wait <sec>]` (non-claiming long poll; `timed_out` / `session_ended` are normal results), report generation-idempotent outcomes via `preview done --stdin` (`accepted` / `stale` / `already_reported` / `unknown_thread`), reply with `preview reply --thread --body`, and end with `preview stop` (with `--force` to clear a record once its process is gone; it refuses while the recorded process is alive) (annotations stay on disk). Previewing uploads nothing; sharing a snapshot happens only from the page's share dialog.
11
+ - Define `login --preset agent` as an attended local-agent flow, add `--project <exact-name-or-id>` for fixed-project browser confirmation, and expose session versus rotating refresh-credential lifetimes in `login` and `whoami`. CI guidance now uses token injection, while shared agent platforms use workspace-managed bots outside the model sandbox.
12
+ - Report duplicate active project names as the agent-recoverable `project_name_conflict` error from `projects create` and `projects edit`.
13
+
14
+ ## 0.11.3 - 2026-08-20
15
+
16
+ - Support Windows Credential Manager for saved profiles, resolve Windows config homes without `HOME`, and expose token-store diagnostics from `doctor --json`. The explicit plaintext fallback is now limited to POSIX systems with mode `0600` instead of implying Windows protection from ignored mode bits.
17
+ - `profiles import-token` detects workspace-issued bot tokens (`asb_` prefix), imports them as rotating refresh credentials (the first refresh consumes the displayed token; the rotated credential is stored before success is reported), persists `kind: "bot"` in the profile, and adds `--force` to replace an existing profile credential (no-op for API tokens). Rejected bot tokens report `bot_token_invalid`; runtime 401s on bot profiles now point to an admin reissue instead of login/preset/API-token recovery. `profiles list` and `doctor` surface bot profiles.
18
+
8
19
  ## 0.11.2 - 2026-08-12
9
20
 
10
21
  - Direct agents with a user present to project-scoped browser login, and reserve API-token guidance for unattended CI or scripts without browser approval.
package/README.md CHANGED
@@ -43,9 +43,18 @@ runs add versions to the same file.
43
43
 
44
44
  ## Authentication
45
45
 
46
- - **Interactive**: run `npx --yes @artifactshare/cli login`, or use `login --preset agent` to authorize a profile for one selected project with restricted agent operations. Running `share`, `update`, or `download` directly also starts sign-in when unauthenticated (the CLI prints a link and code to open in your browser). Profiles created by `login` renew expired CLI sessions automatically during normal use.
47
- - **CI / non-interactive**: issue a token at `https://artifactshare.com/settings/tokens`, then set `ARTIFACTSHARE_TOKEN` (or pass `--token`). Without a token, non-interactive runs fail with `error.code: "auth_required"` instead of hanging.
48
- - Multiple accounts: keep one local profile per account (`profiles list` / `profiles use <name>`). In non-interactive agents, pipe an issued token into `profiles import-token --profile <name> --json` to create a saved API-token profile without browser login; API-token profiles are not renewed by the CLI. Use `logout --profile <name>` to revoke a device-login credential before removing it locally while keeping profile metadata, or `profiles delete <name>` to remove the profile entry too. API-token profiles are only removed locally.
46
+ - **Interactive person**: run `npx --yes @artifactshare/cli login`.
47
+ - **Attended local agent**: use `login --preset agent` on the user's own machine to authorize one project. Add `--project <exact-name-or-id>` to make the browser confirm that fixed project; omit it to use the project picker. Device-login profiles renew expired CLI sessions automatically during normal use, and `login` / `whoami` distinguish the session expiry from the rotating refresh-credential expiry.
48
+ - **CI / non-interactive**: issue a token at `https://artifactshare.com/settings/tokens`, then inject `ARTIFACTSHARE_TOKEN` (or pass `--token`). Without a token, non-interactive runs fail with `error.code: "auth_required"` instead of hanging.
49
+ - **Shared agent platform**: use a workspace-managed bot credential in a trusted host service outside the model sandbox. Do not store a user's device-login profile or expose the bot credential to model shell commands.
50
+
51
+ Running `share`, `update`, or `download` directly also starts interactive sign-in when unauthenticated (the CLI prints a link and code to open in your browser).
52
+
53
+ - Multiple accounts: keep one local profile per account (`profiles list` / `profiles use <name>`). In non-interactive agents, pipe an issued token into `profiles import-token --profile <name> --json` to create a saved API-token profile without browser login; API-token profiles are not renewed by the CLI. Workspace-issued bot tokens (`asb_` prefix) are imported the same way: the CLI detects the prefix, performs the first rotating refresh (which consumes the displayed token), and stores the rotated credential; replacing an existing profile credential with a bot token requires `--force` (a no-op for API tokens), and a rejected bot token reports `bot_token_invalid` (recovery is an admin reissue). Use `logout --profile <name>` to revoke a device-login credential before removing it locally while keeping profile metadata, or `profiles delete <name>` to remove the profile entry too. API-token profiles are only removed locally.
54
+
55
+ Successful `share --json` output may include `data.warnings`. Surface each
56
+ warning to the user. `slack_reauthorization_required` means the destination
57
+ project's Slack channel must be reauthorized.
49
58
 
50
59
  ## Commands
51
60
 
@@ -63,8 +72,10 @@ runs add versions to the same file.
63
72
  | `comments list / post / edit / resolve / reopen / delete <target>` | Read, write, edit, resolve, reopen, and permanently delete comments |
64
73
  | `projects list / create / edit` | List, create, and edit project destinations and audience |
65
74
  | `move <target>` | Move an existing file into a project or back home; `edit` is preferred for new automation |
75
+ | `preview <file>` (alias of `preview start`) | Serve a local Markdown or HTML file with the product viewer look for browser annotation; local only, no sign-in, nothing uploaded |
76
+ | `preview next` / `preview done` / `preview reply` / `preview stop` | Agent loop for a live preview: poll submitted annotation batches, report fixed/skipped outcomes from stdin, reply into a thread, and stop the session |
66
77
  | `login` / `logout` / `whoami` | Sign in, revoke a device-login credential before removing it locally, and check who you are |
67
- | `doctor` | Diagnose auth, destination, network, and upload readiness — tells you the next command to run |
78
+ | `doctor` | Diagnose token storage, auth, destination, network, and upload readiness — tells you the next command to run |
68
79
  | `changelog` | Show the installed version, this release's notes, and the public updates page |
69
80
  | `profiles list / use / import-token / delete` | Switch between local account profiles, import an issued token from stdin, and delete profile entries |
70
81
  | `init` | Set up this directory: detect Claude Code, Codex, or Cursor and install the skill in user scope, then show next steps; or save defaults with `--profile` / `--project-id` |
@@ -72,7 +83,42 @@ runs add versions to the same file.
72
83
 
73
84
  Public command paths covered by this reference:
74
85
 
75
- `append`, `artifacts`, `artifacts get`, `artifacts list`, `changelog`, `comments`, `comments delete`, `comments edit`, `comments list`, `comments post`, `comments reopen`, `comments resolve`, `config`, `config get`, `config set`, `config unset`, `delete`, `doctor`, `download`, `edit`, `init`, `login`, `logout`, `move`, `open`, `profiles`, `profiles delete`, `profiles import-token`, `profiles list`, `profiles use`, `projects`, `projects create`, `projects edit`, `projects list`, `resolve`, `share`, `skills`, `skills ensure`, `skills install`, `skills list`, `skills remove`, `skills update`, `update`, `whoami`.
86
+ `append`, `artifacts`, `artifacts get`, `artifacts list`, `changelog`, `comments`, `comments delete`, `comments edit`, `comments list`, `comments post`, `comments reopen`, `comments resolve`, `config`, `config get`, `config set`, `config unset`, `delete`, `doctor`, `download`, `edit`, `init`, `login`, `logout`, `move`, `open`, `preview`, `preview done`, `preview next`, `preview reply`, `preview start`, `preview stop`, `profiles`, `profiles delete`, `profiles import-token`, `profiles list`, `profiles use`, `projects`, `projects create`, `projects edit`, `projects list`, `resolve`, `share`, `skills`, `skills ensure`, `skills install`, `skills list`, `skills remove`, `skills update`, `update`, `whoami`.
87
+
88
+ Saved credentials use macOS Keychain, Linux Secret Service, or Windows
89
+ Credential Manager. If no native store is available, the explicit
90
+ `--allow-plaintext-token-store` fallback writes under the resolved user config
91
+ directory with mode `0600` on POSIX systems. It is unavailable on Windows,
92
+ where saved profiles require Credential Manager. Run `doctor --json` to inspect
93
+ the resolved config home, available native store, and plaintext credential
94
+ count.
95
+
96
+ ## Local preview and annotation
97
+
98
+ `preview <file>` serves one local `.md` or `.html` file at a `127.0.0.1` URL
99
+ with the same rendering as the product viewer. It is a local feature: it works
100
+ without signing in, and previewing uploads nothing. In the browser, you select
101
+ an element or a text range, write a note, and send your notes to the agent as
102
+ one explicit batch. Saving the file reloads the page.
103
+
104
+ ```sh
105
+ npx --yes @artifactshare/cli preview ./report.html
106
+ npx --yes @artifactshare/cli preview next ./report.html --wait 90
107
+ npx --yes @artifactshare/cli preview stop ./report.html
108
+ ```
109
+
110
+ The first command prints one ready JSON line (`url`, `session`,
111
+ `share_origin`, `reused`) and keeps serving; pass `--no-open` to skip opening
112
+ the browser. The agent collects submitted batches with `preview next`
113
+ (long-polling with `--wait <sec>`; `timed_out` and `session_ended` are normal
114
+ results, while `preview_session_not_found` means no session is live), fixes
115
+ the file, and reports outcomes by piping
116
+ `{"items":[{"thread":...,"generation":...,"outcome":"fixed"|"skipped","note":...}]}`
117
+ into `preview done --stdin`. Reporting is idempotent per thread generation.
118
+ `preview reply --thread <id> --body <text>` adds a reply without changing
119
+ thread state, and `preview stop` ends the session while keeping annotations
120
+ saved on disk. Sharing a snapshot happens only from the page's own share
121
+ dialog, and local annotations are not included in what is shared.
76
122
 
77
123
  ## Where shared files are delivered
78
124