@artifactshare/cli 0.11.3 → 0.13.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@artifactshare/cli",
3
- "version": "0.11.3",
3
+ "version": "0.13.0",
4
4
  "description": "Upload and share HTML, Markdown, folders, and static sites from terminals, AI agents, automation, and CI.",
5
5
  "homepage": "https://artifactshare.com/connect",
6
6
  "repository": {
@@ -21,7 +21,8 @@
21
21
  "type": "module",
22
22
  "sideEffects": false,
23
23
  "bin": {
24
- "artifactshare": "./dist/index.js"
24
+ "artifactshare": "./dist/index.js",
25
+ "artifactshare-preview-cursor": "./dist/cursor-acp-entry.js"
25
26
  },
26
27
  "engines": {
27
28
  "node": ">=22.19.0"
@@ -38,17 +39,20 @@
38
39
  },
39
40
  "dependencies": {
40
41
  "gunshi": "^0.37.0",
41
- "undici": "^8.10.0"
42
+ "undici": "^8.10.0",
43
+ "zod": "4.4.3"
42
44
  },
43
45
  "devDependencies": {
46
+ "@artifactshare/viewer-kit": "0.0.1",
44
47
  "@types/node": "22.20.1",
45
- "tsdown": "0.22.8",
46
- "typescript": "6.0.3",
48
+ "tsdown": "0.22.14",
49
+ "typescript": "7.0.2",
47
50
  "vitest": "4.1.10"
48
51
  },
49
52
  "scripts": {
50
- "build": "tsdown",
53
+ "build": "node scripts/generate-preview-messages.mjs && tsdown",
51
54
  "test": "pnpm run build && vitest run",
52
- "typecheck": "tsc --noEmit"
55
+ "typecheck": "tsc --noEmit",
56
+ "generate:preview-messages": "node scripts/generate-preview-messages.mjs"
53
57
  }
54
58
  }
@@ -1,10 +1,10 @@
1
1
  ---
2
2
  name: artifactshare
3
- description: Share, publish, upload, host, update, open, or read back existing files and Artifact Share URLs. Use when the user wants a browser link for an HTML/Markdown report, folder, static site, or generated file; wants to update the same URL; says Artifact Share, artifactshare, or contextual "as"; or asks to read comments from a shared URL.
3
+ description: Share, publish, upload, host, update, open, or read back existing files and Artifact Share URLs; or show a local file in the browser for review before sharing. Use when the user wants a browser link for an HTML/Markdown report, folder, static site, or generated file; wants to update the same URL; wants to look at, check, preview, or comment on a file you just generated before it is shared; says Artifact Share, artifactshare, or contextual "as"; or asks to read comments from a shared URL.
4
4
  ---
5
5
 
6
6
  <!-- artifactshare-skill
7
- version: 33
7
+ version: 36
8
8
  managed: true
9
9
  -->
10
10
 
@@ -27,15 +27,15 @@ for creating or designing an artifact inside the chat. Artifact Share is for
27
27
  sharing, updating, opening, or reading back existing files, folders, static
28
28
  sites, and Artifact Share URLs.
29
29
 
30
- Run commands with `npx --yes @artifactshare/cli`. When unsure about a
31
- command or flag, run `npx --yes @artifactshare/cli <command> --help` first.
30
+ Run commands with `npm exec --yes --package=@artifactshare/cli -- artifactshare`. When unsure about a
31
+ command or flag, run `npm exec --yes --package=@artifactshare/cli -- artifactshare <command> --help` first.
32
32
 
33
33
  Honor an explicit user request to use CLI or MCP before selecting the default
34
34
  below. Use the CLI when a coding agent can access a user-controlled workspace,
35
35
  install the CLI package, and reach Artifact Share, even when MCP tools are also
36
36
  available. Use remote MCP for source text in chat or a temporary sandbox when
37
37
  CLI network access is unavailable or uncertain; a temporary file alone is not
38
- enough to try `npx`. MCP OAuth is not CLI authentication: follow the CLI
38
+ enough to try `npm exec`. MCP OAuth is not CLI authentication: follow the CLI
39
39
  `auth_required` recovery for first setup, then reuse the saved CLI profile.
40
40
 
41
41
  When passing paths or free-form text through a shell, quote them. Paths may
@@ -61,25 +61,30 @@ contain `$`, spaces, `*`, or `?`; use single quotes such as
61
61
  | Create a project | `projects create 'Name' --json` |
62
62
  | Find an ID from a title | `resolve <value> --json` |
63
63
  | Open a share URL | `open <url> --json` |
64
+ | Preview a local file | `preview <file> --json` (local, no sign-in) |
64
65
  | Log out | `logout --profile <name> --json` |
65
66
 
66
67
  ## Authentication
67
68
 
68
- - `login --profile <name> --preset agent --json` starts device login for a
69
- project-scoped agent profile. Omit `--preset` for unrestricted login. It may
70
- open the OS browser for approval. Use it when a user is present; the pending
71
- event on stderr includes `browser_open`. Do not pass API tokens to `login`.
72
- Profiles created by `login` renew expired CLI sessions automatically.
69
+ - `login --profile <name> --preset agent --json` is for an attended coding
70
+ agent on the user's own machine. It creates a project-scoped profile and may
71
+ open the OS browser. Add `--project <exact-name-or-id>` to confirm one fixed
72
+ eligible project; omit it to select a project in the browser. Omit `--preset`
73
+ for unrestricted personal login. The pending event on stderr includes
74
+ `browser_open`. Do not pass tokens to `login`. Device-login profiles renew
75
+ expired CLI sessions automatically.
73
76
  - In unattended CI or scripts without browser approval, ask the user to issue
74
- an API token at `https://artifactshare.com/settings/tokens`, then use
75
- `ARTIFACTSHARE_TOKEN` or `--token` for normal commands.
77
+ an API token at `https://artifactshare.com/settings/tokens`, then inject it
78
+ with `ARTIFACTSHARE_TOKEN` or `--token`. A shared agent platform uses a
79
+ workspace-managed bot credential in a trusted host service outside the model
80
+ sandbox; never expose it to model shell commands.
76
81
  - `logout --profile <name> --json` revokes a device-login refresh credential
77
82
  before removing it locally and leaves profile metadata in `config.json`.
78
83
  If remote revoke fails, the local credential is kept and logout fails.
79
84
  API-token profiles are removed locally only and are not revoked on the server.
80
85
  - To keep using an issued token as a named profile without TTY or browser
81
86
  login, pipe it on standard input:
82
- `printf '%s' "$TOKEN" | npx --yes @artifactshare/cli profiles import-token --profile <name> --json`.
87
+ `printf '%s' "$TOKEN" | npm exec --yes --package=@artifactshare/cli -- artifactshare profiles import-token --profile <name> --json`.
83
88
  Bot tokens (`asb_` prefix, issued by a workspace admin) use the same command; the first
84
89
  refresh consumes the displayed token, overwriting an existing profile credential requires
85
90
  `--force`, and a revoked or superseded bot token fails with `bot_token_invalid` (ask the
@@ -99,8 +104,8 @@ case-insensitive `</body>` when present, or at source end otherwise. It adds no
99
104
  newline or separator and does not support sites.
100
105
 
101
106
  ```bash
102
- npx --yes @artifactshare/cli share ./report.html --json
103
- npx --yes @artifactshare/cli share ./site-dir --project-id <id> --json
107
+ npm exec --yes --package=@artifactshare/cli -- artifactshare share ./report.html --json
108
+ npm exec --yes --package=@artifactshare/cli -- artifactshare share ./site-dir --project-id <id> --json
104
109
  ```
105
110
 
106
111
  - `share` accepts a single `.html` / `.md` file or a static-site directory.
@@ -142,10 +147,10 @@ Posting to a project delivers to the audience defined by that project. Without
142
147
  a destination, `share` posts to home. Choose the home audience by purpose:
143
148
 
144
149
  ```bash
145
- npx --yes @artifactshare/cli config set home_audience private --scope user --json
146
- npx --yes @artifactshare/cli config set home_audience workspace --scope repository --json
147
- npx --yes @artifactshare/cli share ./report.html --visibility private --json
148
- npx --yes @artifactshare/cli config get home_audience --scope effective --json
150
+ npm exec --yes --package=@artifactshare/cli -- artifactshare config set home_audience private --scope user --json
151
+ npm exec --yes --package=@artifactshare/cli -- artifactshare config set home_audience workspace --scope repository --json
152
+ npm exec --yes --package=@artifactshare/cli -- artifactshare share ./report.html --visibility private --json
153
+ npm exec --yes --package=@artifactshare/cli -- artifactshare config get home_audience --scope effective --json
149
154
  ```
150
155
 
151
156
  Use the user scope for a personal safe default in this CLI environment, the
@@ -172,7 +177,7 @@ defaults are unchanged.
172
177
  Use `update` to add a new version to an existing artifact while keeping its URL.
173
178
 
174
179
  ```bash
175
- npx --yes @artifactshare/cli update <artifact-id-or-url> ./report.html --json
180
+ npm exec --yes --package=@artifactshare/cli -- artifactshare update <artifact-id-or-url> ./report.html --json
176
181
  ```
177
182
 
178
183
  - To keep an existing share URL, do not run `share --artifact-id`; use `update`.
@@ -186,10 +191,10 @@ npx --yes @artifactshare/cli update <artifact-id-or-url> ./report.html --json
186
191
  Use `artifacts get` for single-file sources. Use `download` for static sites.
187
192
 
188
193
  ```bash
189
- npx --yes @artifactshare/cli artifacts get <artifact-id-or-url> --json
190
- npx --yes @artifactshare/cli artifacts get <artifact-id-or-url> --include versions --include comments --json
191
- npx --yes @artifactshare/cli download <artifact-id-or-url> --output ./out --json
192
- npx --yes @artifactshare/cli download --project-id <id> --output ./out --json
194
+ npm exec --yes --package=@artifactshare/cli -- artifactshare artifacts get <artifact-id-or-url> --json
195
+ npm exec --yes --package=@artifactshare/cli -- artifactshare artifacts get <artifact-id-or-url> --include versions --include comments --json
196
+ npm exec --yes --package=@artifactshare/cli -- artifactshare download <artifact-id-or-url> --output ./out --json
197
+ npm exec --yes --package=@artifactshare/cli -- artifactshare download --project-id <id> --output ./out --json
193
198
  ```
194
199
 
195
200
  - In the successful JSON response, read the source from `data.content` and the current version from `data.version_id`.
@@ -225,11 +230,11 @@ Use `comments list` to read, `comments post` to write. IDs from `list` feed
225
230
  into `edit`, `resolve`, `reopen`, and `delete`.
226
231
 
227
232
  ```bash
228
- npx --yes @artifactshare/cli comments list <artifact-id-or-url> --json
229
- npx --yes @artifactshare/cli comments post <artifact-id-or-url> --body '<text>' --json
230
- npx --yes @artifactshare/cli comments post <artifact-id-or-url> --body '<text>' --reply-to <thread-id> --json
231
- npx --yes @artifactshare/cli comments post <artifact-id-or-url> --body '<text>' --quote 'exact text' --json
232
- npx --yes @artifactshare/cli comments post <artifact-id-or-url> --body '<text>' --agent 'Claude' --json
233
+ npm exec --yes --package=@artifactshare/cli -- artifactshare comments list <artifact-id-or-url> --json
234
+ npm exec --yes --package=@artifactshare/cli -- artifactshare comments post <artifact-id-or-url> --body '<text>' --json
235
+ npm exec --yes --package=@artifactshare/cli -- artifactshare comments post <artifact-id-or-url> --body '<text>' --reply-to <thread-id> --json
236
+ npm exec --yes --package=@artifactshare/cli -- artifactshare comments post <artifact-id-or-url> --body '<text>' --quote 'exact text' --json
237
+ npm exec --yes --package=@artifactshare/cli -- artifactshare comments post <artifact-id-or-url> --body '<text>' --agent 'Claude' --json
233
238
  ```
234
239
 
235
240
  - `--reply-to <thread-id>` replies to an existing thread from `comments list`.
@@ -242,10 +247,10 @@ npx --yes @artifactshare/cli comments post <artifact-id-or-url> --body '<text>'
242
247
  `comments list` returns an `agent` field on messages posted with this flag.
243
248
 
244
249
  ```bash
245
- npx --yes @artifactshare/cli comments edit <artifact-id-or-url> --message-id <id> --body '<text>' --json
246
- npx --yes @artifactshare/cli comments resolve <artifact-id-or-url> --thread-id <id> --json
247
- npx --yes @artifactshare/cli comments reopen <artifact-id-or-url> --thread-id <id> --json
248
- npx --yes @artifactshare/cli comments delete <artifact-id-or-url> --thread-id <id> --message-id <id> --json
250
+ npm exec --yes --package=@artifactshare/cli -- artifactshare comments edit <artifact-id-or-url> --message-id <id> --body '<text>' --json
251
+ npm exec --yes --package=@artifactshare/cli -- artifactshare comments resolve <artifact-id-or-url> --thread-id <id> --json
252
+ npm exec --yes --package=@artifactshare/cli -- artifactshare comments reopen <artifact-id-or-url> --thread-id <id> --json
253
+ npm exec --yes --package=@artifactshare/cli -- artifactshare comments delete <artifact-id-or-url> --thread-id <id> --message-id <id> --json
249
254
  ```
250
255
 
251
256
  - Comment deletion cannot be undone. Omit `--message-id` only when the user
@@ -258,11 +263,11 @@ Use `edit` for post-share changes. Use `projects list/create/edit` for
258
263
  project management.
259
264
 
260
265
  ```bash
261
- npx --yes @artifactshare/cli edit <artifact-id-or-url> --title 'New title' --json
262
- npx --yes @artifactshare/cli edit <artifact-id-or-url> --visibility private --grant-email viewer@example.com --json
263
- npx --yes @artifactshare/cli edit <artifact-id-or-url> --project-id <id> --json
264
- npx --yes @artifactshare/cli edit <artifact-id-or-url> --home --json
265
- npx --yes @artifactshare/cli delete <artifact-id-or-url> --json
266
+ npm exec --yes --package=@artifactshare/cli -- artifactshare edit <artifact-id-or-url> --title 'New title' --json
267
+ npm exec --yes --package=@artifactshare/cli -- artifactshare edit <artifact-id-or-url> --visibility private --grant-email viewer@example.com --json
268
+ npm exec --yes --package=@artifactshare/cli -- artifactshare edit <artifact-id-or-url> --project-id <id> --json
269
+ npm exec --yes --package=@artifactshare/cli -- artifactshare edit <artifact-id-or-url> --home --json
270
+ npm exec --yes --package=@artifactshare/cli -- artifactshare delete <artifact-id-or-url> --json
266
271
  ```
267
272
 
268
273
  - `edit` changes title, visibility, explicit viewers, or project placement
@@ -284,11 +289,11 @@ npx --yes @artifactshare/cli delete <artifact-id-or-url> --json
284
289
  when the user explicitly asks.
285
290
 
286
291
  ```bash
287
- npx --yes @artifactshare/cli projects list --json
288
- npx --yes @artifactshare/cli projects create 'Client reports' --json
289
- npx --yes @artifactshare/cli projects create 'Internal' --visibility private --json
290
- npx --yes @artifactshare/cli projects edit <id> --add-email viewer@example.com --json
291
- npx --yes @artifactshare/cli projects edit <id> --archive --json
292
+ npm exec --yes --package=@artifactshare/cli -- artifactshare projects list --json
293
+ npm exec --yes --package=@artifactshare/cli -- artifactshare projects create 'Client reports' --json
294
+ npm exec --yes --package=@artifactshare/cli -- artifactshare projects create 'Internal' --visibility private --json
295
+ npm exec --yes --package=@artifactshare/cli -- artifactshare projects edit <id> --add-email viewer@example.com --json
296
+ npm exec --yes --package=@artifactshare/cli -- artifactshare projects edit <id> --archive --json
292
297
  ```
293
298
 
294
299
  - `projects create` uses `default_project_visibility` when saved, otherwise
@@ -304,9 +309,9 @@ npx --yes @artifactshare/cli projects edit <id> --archive --json
304
309
  ## Profiles
305
310
 
306
311
  ```bash
307
- npx --yes @artifactshare/cli profiles list --json
308
- npx --yes @artifactshare/cli profiles use <name> --json
309
- npx --yes @artifactshare/cli profiles delete <name> --json
312
+ npm exec --yes --package=@artifactshare/cli -- artifactshare profiles list --json
313
+ npm exec --yes --package=@artifactshare/cli -- artifactshare profiles use <name> --json
314
+ npm exec --yes --package=@artifactshare/cli -- artifactshare profiles delete <name> --json
310
315
  ```
311
316
 
312
317
  - `profiles list` shows saved profiles and the default.
@@ -319,9 +324,9 @@ npx --yes @artifactshare/cli profiles delete <name> --json
319
324
  ## Skills
320
325
 
321
326
  ```bash
322
- npx --yes @artifactshare/cli skills ensure --tool auto --json
323
- npx --yes @artifactshare/cli skills update --json
324
- npx --yes @artifactshare/cli skills list --json
327
+ npm exec --yes --package=@artifactshare/cli -- artifactshare skills ensure --tool auto --json
328
+ npm exec --yes --package=@artifactshare/cli -- artifactshare skills update --json
329
+ npm exec --yes --package=@artifactshare/cli -- artifactshare skills list --json
325
330
  ```
326
331
 
327
332
  - `open`, flag-less `init`, and `skills ensure --tool auto` detect Claude Code,
@@ -340,6 +345,115 @@ npx --yes @artifactshare/cli skills list --json
340
345
  - `--force` overwrites an unmanaged file on install.
341
346
  - Run `skills --help` for all subcommands.
342
347
 
348
+ ## Preview (local annotate-and-fix loop)
349
+
350
+ `preview` is a local, unauthenticated feature: it serves one local `.md` or
351
+ `.html` file with the same rendering as the product viewer, the user annotates
352
+ elements or text selections in the browser and submits them as an explicit
353
+ batch, and the agent fixes the file. Nothing is uploaded by previewing;
354
+ an upload happens only if the user opens the share dialog from the page.
355
+
356
+ ```bash
357
+ npm exec --yes --package=@artifactshare/cli -- artifactshare preview ./lp.html
358
+ npm exec --yes --package=@artifactshare/cli -- artifactshare preview start ./lp.html --no-open
359
+ ```
360
+
361
+ - Internally this runs the `preview start` subcommand (bare `preview <file>`
362
+ is rewritten to it). It prints a single ready JSON line with `url` (the
363
+ local page), `session` (id for `--session`), `share_origin`, and `reused`
364
+ (`true` means an already-live session for the same file was picked up
365
+ instead of starting a new server), plus a sanitized `agent` notification
366
+ projection, then keeps running until stopped.
367
+ `--no-open` skips opening the browser.
368
+ - Editing and saving the file reloads the page automatically; annotations
369
+ stay anchored where possible.
370
+ - `preview next` returns every batch the user has submitted; it is
371
+ non-claiming (calling it again returns the same open items) and with
372
+ `--wait <sec>` it long-polls. `timed_out: true` and `session_ended: true`
373
+ are normal empty results, not errors. The error
374
+ `preview_session_not_found` means no live session exists; ask the user to
375
+ start one. `preview_wait_conflict` means another long poll owns the session;
376
+ use that wait or retry after it returns. `preview_request_failed` means the session is alive but rejected
377
+ the request, so fix the payload (thread id, generation, size) and retry.
378
+ `preview_session_unverified` on startup means a recorded session did not
379
+ answer, or it was started before the current notification contract. Retry a
380
+ temporarily unresponsive session; for an older session, ask the user to stop
381
+ that preview process and start it again with the current CLI. The `--force`
382
+ fallback clears an unresponsive record only once the process is gone.
383
+ - Report outcomes with `preview done --stdin`; reply into a thread with
384
+ `preview reply --thread <id> --body <text>` (state unchanged); end the
385
+ session with `preview stop` (annotations stay saved on disk).
386
+
387
+ ### Waking up when the user submits a batch
388
+
389
+ Pick the first mode your environment supports:
390
+
391
+ 1. In Codex, start preview from the session that owns the work. Current Codex
392
+ environments expose the session UUID to the trusted local preview process;
393
+ Artifact Share registers it and uses `codex queue` to send a fixed
394
+ batch-ready notice. End your turn after preview is ready. When the notice
395
+ resumes the session, run `preview next`, fix the whole batch, and report it
396
+ with `preview done`. A `queued` state means Codex accepted the notice, not
397
+ that it started processing. If it remains queued, the session may have
398
+ ended: use `codex resume`, then run `preview next`. Never copy comments into
399
+ a queue message; `preview next` is their source of truth.
400
+ 2. In Claude Code, use the background-wait path only if
401
+ `CLAUDE_CODE_DISABLE_BACKGROUND_TASKS` is neither `1` nor `true`, Bash exposes
402
+ `run_in_background`, and starting `preview next --wait 3600` in the
403
+ background returns a task ID. End your turn. A submitted batch completes the
404
+ command and resumes you; fix the file, report with `preview done`, then arm
405
+ one new background wait. If the wait returns `timed_out: true`, do not
406
+ re-arm it automatically. If background execution is unavailable or
407
+ rejected, use manual pickup and do not describe the session as waiting.
408
+ 3. For an Artifact Share-managed Cursor ACP session, start with
409
+ `npm exec --yes --package=@artifactshare/cli -- artifactshare-preview-cursor <file>`.
410
+ Run one managed launcher per workspace. The launcher creates or loads the
411
+ workspace's managed conversation and sends a fixed batch-ready prompt only
412
+ while that session is idle. Read all comment content with `preview next`;
413
+ never place it in the ACP prompt. Keep the launcher attended and approve
414
+ Cursor tool permissions only after checking the request shown in its
415
+ terminal.
416
+ 4. In the interactive Cursor Agent CLI, start preview with
417
+ `ARTIFACTSHARE_CURSOR_FOREGROUND_WAIT=1`, then block in the foreground on
418
+ `preview next --wait 90` and repeat. Do not use that marker for a normal
419
+ Cursor IDE chat: IDE chats are manual pickup and must not be described as
420
+ automatically resumable.
421
+ 5. Fallback: run `preview next` only when the user tells you a batch is
422
+ ready.
423
+
424
+ If `preview next` immediately returns the same item set as the previous
425
+ call, do not re-arm; report the situation to the user instead.
426
+
427
+ ### Working through a batch
428
+
429
+ ```bash
430
+ npm exec --yes --package=@artifactshare/cli -- artifactshare preview next ./lp.html --wait 90
431
+ npm exec --yes --package=@artifactshare/cli -- artifactshare preview next --session 0123456789abcdef
432
+ ```
433
+
434
+ - Read the whole batch first, then fix everything in one editing pass and
435
+ save once, then report the whole batch with a single `preview done` call.
436
+ - Successful `preview next` and `preview done` results include the same
437
+ sanitized `agent` notification projection as the ready result.
438
+ - Each done item is `{thread, generation, outcome, note}` with outcome
439
+ `fixed` (you changed the file) or `skipped` (`note` explaining why is
440
+ required). The `note` is shown to the user as the thread summary, so
441
+ write it for them.
442
+ - An item whose `anchor.state` is `orphaned` lost its place in the document;
443
+ do not try to re-fix it — report it as `skipped` with a note.
444
+ - `done` is idempotent per generation: each item comes back as `accepted`,
445
+ `stale` (the thread was reopened with a newer generation), or
446
+ `already_reported`, plus `unknown_thread` for ids the session does not
447
+ know.
448
+
449
+ ```bash
450
+ printf '%s' '{"items":[{"thread":"t1","generation":1,"outcome":"fixed","note":"Tightened the headline"}]}' | npm exec --yes --package=@artifactshare/cli -- artifactshare preview done ./lp.html --stdin
451
+ ```
452
+
453
+ Sharing is user-driven: the page's share button opens a separate-origin
454
+ dialog that publishes the snapshot bytes; local annotations are never
455
+ carried into the shared copy.
456
+
343
457
  ## Output contract
344
458
 
345
459
  - Always pass `--json`. Success prints
@@ -353,7 +467,7 @@ npx --yes @artifactshare/cli skills list --json
353
467
 
354
468
  ## First-time setup
355
469
 
356
- `npx --yes @artifactshare/cli init` detects the agent, installs or updates
470
+ `npm exec --yes --package=@artifactshare/cli -- artifactshare init` detects the agent, installs or updates
357
471
  this skill, and reports the next steps (sign in, then share). When you receive
358
472
  a share URL instead, start with `open <artifact-id-or-url> --json`. It ensures
359
473
  this skill is installed or updated, then reads single-file artifacts or returns
@@ -1,10 +1,10 @@
1
1
  ---
2
- description: Share, publish, upload, host, update, open, or read back existing files and Artifact Share URLs.
2
+ description: Share, publish, upload, host, update, open, or read back existing files and Artifact Share URLs; or show a local file in the browser for review before sharing.
3
3
  alwaysApply: false
4
4
  ---
5
5
 
6
6
  <!-- artifactshare-skill
7
- version: 33
7
+ version: 36
8
8
  managed: true
9
9
  -->
10
10
 
@@ -14,8 +14,8 @@ Artifact Share is for the last step after a file already exists: share,
14
14
  publish, upload, or host HTML pages, Markdown documents, folders, and static
15
15
  sites; return a browser link; update the same URL; open or read back an
16
16
  Artifact Share URL; and read or post comments. Use
17
- `npx --yes @artifactshare/cli` from the terminal.
18
- Run `npx --yes @artifactshare/cli <command> --help` before choosing a command.
17
+ `npm exec --yes --package=@artifactshare/cli -- artifactshare` from the terminal.
18
+ Run `npm exec --yes --package=@artifactshare/cli -- artifactshare <command> --help` before choosing a command.
19
19
 
20
20
  Use this rule for Artifact Share, artifactshare, and contextual "as" requests.
21
21
  Japanese requests such as `as でアップして` or `as に上げて` are strong
@@ -33,7 +33,7 @@ the CLI when a coding agent can work in a user-controlled workspace, fetch the
33
33
  package, and connect to Artifact Share, even when MCP is available. Use
34
34
  remote MCP for source text in chat or a temporary sandbox when CLI network
35
35
  access is unavailable or uncertain; a temporary file alone is not enough to
36
- try `npx`. MCP OAuth is separate from CLI authentication: follow the CLI
36
+ try `npm exec`. MCP OAuth is separate from CLI authentication: follow the CLI
37
37
  `auth_required` recovery, then reuse the saved profile.
38
38
  Use `append <target> <path> --json` to append a non-empty UTF-8 file exactly
39
39
  as-is to a single-file artifact. Markdown is appended at source end; HTML is
@@ -49,8 +49,8 @@ contain `$`, spaces, `*`, or `?`; use single quotes such as
49
49
  exactly one of `--link-expires-at <RFC3339 UTC>` or `--no-link-expiry`; omit
50
50
  both to use the workspace default on share or preserve the current expiry on
51
51
  edit. Results expose `link_expires_at` as a UTC timestamp or `null`.
52
- - For an agent with a user present, use `login --preset agent --profile <name> --json` and let the user select one project during browser approval. In unattended CI or scripts without browser approval, ask the user to issue an API token at `https://artifactshare.com/settings/tokens`, then run normal commands with `ARTIFACTSHARE_TOKEN` or `--token`; do not pass API tokens to `login`.
53
- - To save that token as a named profile without TTY or browser login, pipe it on standard input: `printf '%s' "$TOKEN" | npx --yes @artifactshare/cli profiles import-token --profile <name> --json`. Imported API-token profiles are not renewed by the CLI. Bot tokens (`asb_` prefix) import through the same command as rotating refresh credentials; overwriting an existing profile credential needs `--force`, and a rejected bot token reports `bot_token_invalid` (recovery is an admin reissue). Add `--allow-plaintext-token-store` only on a trusted machine without a native token store. That fallback is mode `0600` on POSIX and unavailable on Windows, where saved profiles require Credential Manager.
52
+ - For an attended coding agent on the user's own machine, use `login --preset agent --profile <name> --json`; add `--project <exact-name-or-id>` to confirm a fixed project or omit it to use the browser picker. In CI, issue an API token at `https://artifactshare.com/settings/tokens` and inject it with `ARTIFACTSHARE_TOKEN` or `--token`. A shared agent platform uses a workspace-managed bot credential in a trusted host outside the model sandbox; never expose it to model shell commands. Do not pass tokens to `login`.
53
+ - To save that token as a named profile without TTY or browser login, pipe it on standard input: `printf '%s' "$TOKEN" | npm exec --yes --package=@artifactshare/cli -- artifactshare profiles import-token --profile <name> --json`. Imported API-token profiles are not renewed by the CLI. Bot tokens (`asb_` prefix) import through the same command as rotating refresh credentials; overwriting an existing profile credential needs `--force`, and a rejected bot token reports `bot_token_invalid` (recovery is an admin reissue). Add `--allow-plaintext-token-store` only on a trusted machine without a native token store. That fallback is mode `0600` on POSIX and unavailable on Windows, where saved profiles require Credential Manager.
54
54
  - Use `login --profile <name> --json` when a user is present for browser approval. The pending event on stderr includes `browser_open`. Profiles created by `login` renew expired CLI sessions automatically.
55
55
  - Use `logout --profile <name> --json` to revoke a device-login credential before removing it locally; this keeps profile metadata. API-token profiles are removed locally only and their server token is not revoked.
56
56
  - Switch profiles with `profiles use <name> --json`; list with `profiles list --json`; remove a profile entry and its credential with `profiles delete <name> --json`.
@@ -79,5 +79,6 @@ contain `$`, spaces, `*`, or `?`; use single quotes such as
79
79
  - Manage projects: `projects list --json`, `projects create <name> --json` (uses `default_project_visibility` when saved, otherwise `workspace`; pass `--visibility private` for a confidential project), `projects edit <id>` for name, description, visibility, audience (`--add-email`/`--remove-email`), and archive state (`--archive`/`--unarchive`).
80
80
  - Save a default project with `init --project-id <id> --json`. Preview setup with `init --dry-run --json`.
81
81
  - Manage skills: `skills ensure --tool auto --json` detects Claude Code, Codex, or Cursor and installs or updates user-scope skills; Cursor project scope needs `skills install --tool cursor --scope project --json`. Use `skills install --tool cursor --scope user --json` for the Cursor user-scope skill explicitly. Project scope is opt-in via `skills install --tool <tool> --scope project --json`. `skills update --json` updates installed managed skills; `--force` overwrites unmanaged files on install.
82
+ - Preview a local `.md` / `.html` file with `preview <file> --json` (add `--no-open` to keep the browser closed). It is local and needs no sign-in: one ready JSON line (`url` / `session` / `share_origin` / `reused` / sanitized `agent`) is printed and the process keeps serving; saving the file reloads the page. A preview started inside Codex registers the trusted thread UUID and uses `codex queue` for a fixed batch-ready notice; `queued` means accepted, while `preview next` is the first proof of processing. If it remains queued, reopen the session with `codex resume`. In Claude Code, if background tasks are enabled (`CLAUDE_CODE_DISABLE_BACKGROUND_TASKS` is neither `1` nor `true`), Bash exposes `run_in_background`, and the command returns a task ID, arm one background `preview next --wait 3600`; re-arm after `preview done`, but not after `timed_out: true`. If background execution is disabled or rejected, use manual pickup. In Cursor, keep `preview next --wait 90` in the foreground. The user annotates in the browser and submits batches. Fetch them with `preview next [--wait <sec>] [--session <id>]` — non-claiming long poll where `timed_out` / `session_ended` are normal empty results and `preview_session_not_found` means no live session, `preview_request_failed` means the session is alive and rejected the request, and `preview_session_unverified` means the recorded session went silent — retry, then stop the process before `preview stop <file> --force`. Fix the whole batch in one edit, then pipe `{"items":[{"thread","generation","outcome":"fixed|skipped","note"}]}` to `preview done --stdin` (idempotent per generation; results `accepted|stale|already_reported|unknown_thread`; `skipped` needs a note; items with `anchor.state: "orphaned"` are skipped, not re-fixed; the note becomes the thread summary). `preview reply --thread <id> --body <text>` answers without changing state; `preview stop` ends the session and keeps annotations. Never copy comment content into a provider notification; `preview next` is the source of truth. If `preview next` immediately returns the same items again, stop polling and tell the user. Nothing is uploaded unless the user shares from the page.
82
83
  - Check the current state with `whoami --json` or `doctor --json` for token storage, authentication, destination, network, upload access, and skill update status.
83
- - First-time setup: `npx --yes @artifactshare/cli init --json` detects Claude Code, Codex, or Cursor, installs or updates user-scope skills, and reports the next steps (sign in, then share). For Cursor project scope, run `skills install --tool cursor --scope project --json` explicitly.
84
+ - First-time setup: `npm exec --yes --package=@artifactshare/cli -- artifactshare init --json` detects Claude Code, Codex, or Cursor, installs or updates user-scope skills, and reports the next steps (sign in, then share). For Cursor project scope, run `skills install --tool cursor --scope project --json` explicitly.