claude-artifact-cli 0.2.1__tar.gz → 0.3.1__tar.gz

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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: claude-artifact-cli
3
- Version: 0.2.1
3
+ Version: 0.3.1
4
4
  Summary: Publish, update, list and inspect Claude Artifacts from the terminal, using the Claude Code login already on your machine.
5
5
  Project-URL: Homepage, https://github.com/nikships/claude-artifact-cli
6
6
  Project-URL: Repository, https://github.com/nikships/claude-artifact-cli
@@ -34,7 +34,7 @@ Description-Content-Type: text/markdown
34
34
 
35
35
  # claude-artifact-cli
36
36
 
37
- Publish, update, pull, list and inspect Claude Artifacts from the terminal, using the Claude Code login already on your machine.
37
+ Publish, update, pull and inspect Claude Artifacts from the terminal, and work with their comments, database, assets, types and sharing, using the Claude Code login already on your machine.
38
38
 
39
39
  [![PyPI](https://img.shields.io/pypi/v/claude-artifact-cli?style=for-the-badge)](https://pypi.org/project/claude-artifact-cli/)
40
40
  [![Python](https://img.shields.io/pypi/pyversions/claude-artifact-cli?style=for-the-badge)](https://pypi.org/project/claude-artifact-cli/)
@@ -46,7 +46,7 @@ Publish, update, pull, list and inspect Claude Artifacts from the terminal, usin
46
46
 
47
47
  ## What is this?
48
48
 
49
- `claude-artifact` publishes an HTML page (plus any CSS, JS and images it uses) as a [Claude Artifact](https://claude.ai/code/artifacts) and prints the link, and pulls an artifact's files back down to edit and republish. It talks to the same API the Claude Code `Artifact` tool uses and reuses the claude.ai login from `claude /login`. No API key, no config file, no dependencies beyond Python 3.10+.
49
+ `claude-artifact` publishes an HTML page (plus any CSS, JS and images it uses) as a [Claude Artifact](https://claude.ai/code/artifacts) and prints the link, and pulls an artifact's files back down to edit and republish. It also reads and answers comment threads, reads and writes an artifact's database, manages its uploaded assets, starts artifacts from types (Slides, Docs, Dashboard, …), declares runtime capabilities, and handles sharing, renaming, pinning, history and deletion. It talks to the same API the Claude Code `Artifact` tool uses and reuses the claude.ai login from `claude /login`. No API key, no config file, no dependencies beyond Python 3.10+.
50
50
 
51
51
  Use it where the built-in tool can't reach: other coding agents (Droid, Codex, Cursor, OpenCode), subagents, shell scripts, Makefiles, git hooks and CI jobs.
52
52
 
@@ -80,12 +80,31 @@ claude-artifact list [--scope mine|shared|all] [--limit N]
80
80
  claude-artifact read SLUG_OR_URL [-o FILE] metadata + published file manifest
81
81
  claude-artifact read SLUG_OR_URL --path P [--path P ... --out-dir DIR]
82
82
  a published file's exact bytes
83
+ claude-artifact versions SLUG_OR_URL version history (* marks live)
84
+ claude-artifact rename SLUG_OR_URL TITLE
85
+ claude-artifact pin|unpin SLUG_OR_URL
86
+ claude-artifact delete SLUG_OR_URL --yes delete for everyone; no undo
87
+ claude-artifact share SLUG_OR_URL [--private | --org | --add UUID ... [--access view|comment] | --remove UUID ...]
88
+
89
+ claude-artifact comments list SLUG_OR_URL [--all | --awaiting] [--full]
90
+ claude-artifact comments reply SLUG_OR_URL THREAD TEXT|- [--id UUID]
91
+ claude-artifact comments resolve SLUG_OR_URL THREAD ...
92
+ claude-artifact watch SLUG_OR_URL [--interval S] [--count N] [--no-comments]
93
+
94
+ claude-artifact db whoami|get|list|query|set|update|delete|edit|batch SLUG_OR_URL ...
95
+ claude-artifact assets list|upload|get|delete|copy SLUG_OR_URL ...
96
+
97
+ claude-artifact types list | show TYPE | read TYPE PATH | instances TYPE
98
+ claude-artifact create TYPE [--title T] new artifact from a type (slides, docs, ...)
99
+ claude-artifact contract [VERSION] [--prompt]
100
+ runtime capabilities and the page-author guide
101
+
83
102
  claude-artifact whoami check that auth works
84
103
  claude-artifact update upgrade to the latest release now
85
104
  claude-artifact --version
86
105
  ```
87
106
 
88
- The URL goes to stdout and progress goes to stderr, so `URL=$(claude-artifact publish page.html -q)` captures only the link. Add `--json` to `publish`, `status`, `list` or `read` for raw output. Exit codes: `0` success, `1` API error, `2` auth error, `3` version conflict (HTTP 409), `130` interrupted.
107
+ The URL goes to stdout and progress goes to stderr, so `URL=$(claude-artifact publish page.html -q)` captures only the link. Add `--json` to any command that prints data for raw output. Exit codes: `0` success, `1` API error, `2` auth error, `3` version conflict (HTTP 409: a newer artifact version, or a database document that changed since `--if-version`), `130` interrupted.
89
108
 
90
109
  Wherever a command takes a slug or URL (`SLUG_OR_URL`, `--slug`, `--url`), it accepts any of:
91
110
 
@@ -130,6 +149,12 @@ claude-artifact publish index.html --slug <slug> \
130
149
  | `--mode patch\|replace` | `patch` overlays the manifest onto the base version, so published files you don't pass are kept. Default when updating a page. `replace` makes the manifest the whole artifact, so any published file you leave out is removed. Default for a new artifact and for the first publish of a directory. A directory with `.artifact.json` patches (see below). |
131
150
  | `--base-version` | The version this publish was made against. If a newer version is live, the publish is refused with exit code `3`. Defaults to the version in a directory's `.artifact.json` (when publishing to the slug saved there). Without one, patch uses the live version and replace is not checked, so a concurrent publish goes undetected. |
132
151
  | `--force` | Publish even if a newer version is live, discarding it. |
152
+ | `--capability NAME[=JSON]` | Declare a runtime capability the page uses: `db`, `user`, `assets`, `comments`, `artifact`, `downloads`, … with its config (default `{}`), e.g. `--capability 'db={"rules":[…]}'`. Repeatable. The set you pass replaces the stored declaration; a publish without `--capability` keeps it. Names are checked against the contract. `claude-artifact contract --prompt` documents each one. |
153
+ | `--clear-capabilities` | Drop every declared capability. |
154
+ | `--contract VERSION` | Pin the runtime contract, or `latest` to upgrade. Default: the artifact's stored contract; a declaration on an artifact without one uses the latest. |
155
+ | `--copy SOURCE PUB[=SRC]` | Have the server copy published file `SRC` (default `PUB`) from artifact `SOURCE` into this one at `PUB`. Nothing is downloaded or re-uploaded. Repeatable. The server copies scripts, styles, data, fonts and images, not HTML or XML. |
156
+ | `--note TEXT` | A note recorded with this version; `versions` shows it. |
157
+ | `--thumbnail IMAGE`, `--thumbnail-dark IMAGE` | Gallery thumbnails. |
133
158
  | `-q`, `--quiet` | Print only the URL. |
134
159
 
135
160
  `--json` prints the deploy response with the artifact `url` added: `{"url", "slug", "version", …}`.
@@ -226,8 +251,138 @@ claude-artifact read <slug> --path index.html --path app.css --out-dir ./out #
226
251
 
227
252
  `read --path P` prints the published file's exact bytes to stdout instead, checked against the manifest's sha256. Repeat `--path` with `--out-dir DIR` to save several files under `DIR` at their published paths; it prints each saved path. `--path` doesn't combine with `--json` or `-o`, more than one `--path` needs `--out-dir`, and `--out-dir` needs `--path`.
228
253
 
254
+ `read` also shows the artifact's runtime contract and declared capabilities. `list --pinned` shows only pinned artifacts.
255
+
229
256
  Never WebFetch or curl a `claude.ai` artifact URL: it is a login-walled app shell and returns no page content.
230
257
 
258
+ ### Comments
259
+
260
+ ```bash
261
+ claude-artifact comments list <slug> # open threads, with authors and anchors
262
+ claude-artifact comments list <slug> --awaiting # threads a person sent to Claude that have no answer yet
263
+ claude-artifact comments reply <slug> <thread> "Fixed in the latest version."
264
+ echo "Long answer" | claude-artifact comments reply <slug> <thread> -
265
+ claude-artifact comments resolve <slug> <thread>
266
+ ```
267
+
268
+ `list` shows open threads; `--all` adds resolved ones and `--full` keeps long comments whole. Each thread prints its id, its state (`resolved`, `sent to Claude`, `awaiting Claude`), what it is anchored to, and every comment.
269
+
270
+ `reply` posts **as Claude**, and only on a thread a person sent to Claude ("Send to Claude" on the artifact's page); anything else is refused, as it is for Claude Code's Artifact tool. When the thread is waiting on Claude, the reply marks that request answered. Each reply carries a client id (`--id`, default a fresh UUID); resending the same id posts nothing new, so a retry after a network error is safe. `resolve` works on the same threads. Starting a thread, and replying or resolving as yourself, need a claude.ai browser session: do those on the artifact's page.
271
+
272
+ ### Watch
273
+
274
+ ```bash
275
+ claude-artifact watch <slug> # prints events until Ctrl-C
276
+ claude-artifact watch <slug> --json --count 1 # wait for the next event, print it as JSON, exit
277
+ ```
278
+
279
+ Polls every `--interval` seconds (default 30) and prints one line per new version, new comment (`[to Claude]` when a person sent it to Claude) and resolved thread. `--json` prints one JSON object per line: `{"event": "version", "version", "previous"}`, `{"event": "comment", "thread", "comment", "author", "text", "to_claude", "awaiting_claude"}` or `{"event": "resolved", "thread", "at"}`. `--no-comments` watches versions only. Publishing identical content creates no new version, so it prints nothing.
280
+
281
+ ### Database
282
+
283
+ An artifact's database holds shared and per-person JSON documents its page reads with `claude.use("db")`. The page's published version must declare the capability: `publish … --capability db --capability user`.
284
+
285
+ ```bash
286
+ claude-artifact db set <slug> tasks t1 --data '{"title": "Ship it", "done": false}'
287
+ claude-artifact db update <slug> tasks t1 --data '{"done": true}' --if-version 1
288
+ claude-artifact db get <slug> tasks t1
289
+ claude-artifact db list <slug> tasks --all
290
+ claude-artifact db query <slug> tasks --where done == false --where n '>=' 2 --order-by n:desc
291
+ claude-artifact db edit <slug> notes n1 --field body --old "teh" --new "the" --replace-all
292
+ claude-artifact db delete <slug> tasks t1
293
+ claude-artifact db batch <slug> @writes.json # [{"op":"set","collection":"tasks","doc_id":"t2","data":{…}}, …]
294
+ claude-artifact db whoami <slug> # your id, as in data/users/<id>
295
+ ```
296
+
297
+ | Rule | |
298
+ |------|--|
299
+ | Paths | A collection is 1-15 `/`-separated segments with an odd count (`tasks`, `boards/b1/columns`); a document is collection + doc id. Segments use letters, digits and `_ - . ~ : @ +`. |
300
+ | Per-person data | `data/users/<id>` is private to that person, even from the owner. `me` stands for you: `db get <slug> data/users/me prefs`. |
301
+ | `set` / `update` | `set` replaces the document; `update` merges fields, and `{"__delete__": true}` removes one. `--data` takes JSON, `-` for stdin, or `@FILE`. |
302
+ | `--if-version N` | The write applies only if the document is still at version `N`. Otherwise nothing is written and the command exits `3`. |
303
+ | `edit` | Replaces text inside one string field without resending the document. |
304
+ | `query` | `--where FIELD OP VALUE` with `==` `!=` `<` `<=` `>` `>=` `in` `not-in` `array-contains`. `VALUE` is parsed as JSON when it can be, else taken as a string. |
305
+ | Paging | `list` and `query` print `--cursor` for the next page; `--all` follows every page. |
306
+ | `batch` | 1-50 `set`/`update`/`delete` writes, `{op, collection, doc_id, data?, if_version?}`, each document at most once, up to 1 MiB, in one request. |
307
+
308
+ `get` prints the document's data (stderr has its version); a missing document exits `1`. List and query print `id`, `v<version>` and the data, tab-separated.
309
+
310
+ ### Assets
311
+
312
+ The asset store holds files a page uploads or references by id: images, SVG, video, PDF, fonts, CSS/JS, CSV, Markdown, JSON and text, up to 20 MiB each (SVG 2 MiB, sanitized). Declare `--capability assets` for the page to use them.
313
+
314
+ ```bash
315
+ claude-artifact assets upload <slug> logo.png chart.svg # prints id, url, file
316
+ claude-artifact assets list <slug>
317
+ claude-artifact assets get <slug> <id> -o logo.png # bytes, checked against the sha256
318
+ claude-artifact assets copy <slug> --from <other-slug> <id> ... # 1-10 ids; prints old -> new
319
+ claude-artifact assets delete <slug> <id>
320
+ ```
321
+
322
+ A page serves an asset at `/_blob/<id>`. `--type` overrides the content type taken from the extension.
323
+
324
+ ### Types
325
+
326
+ Artifact types (Slides, Docs, Dashboard, Design, Motion, …) are ready-made pages that take your content as data.
327
+
328
+ ```bash
329
+ claude-artifact types list
330
+ claude-artifact types show slides # release and the files it ships
331
+ claude-artifact types read slides SKILL.md # how to fill one
332
+ claude-artifact create slides --title "Q3 review" # prints the new artifact's URL
333
+ claude-artifact pull <new-slug> ./deck # then add your files, publish ./deck
334
+ ```
335
+
336
+ `TYPE` is a title (case-insensitive), slug or URL. `create` sends an idempotency key (`--idempotency-key` to reuse one), so a retried create doesn't make a second artifact. `types instances TYPE` lists artifacts made from a type.
337
+
338
+ ### Contract and capabilities
339
+
340
+ ```bash
341
+ claude-artifact contract # latest runtime contract and its capability names
342
+ claude-artifact contract --prompt # the guide for page authors: claude.use(...), each capability's config
343
+ ```
344
+
345
+ #### Offering a file download
346
+
347
+ claude.ai blocks a plain `<a href="report.pdf" download>` inside an artifact; the viewer sees "File downloads are not available for this artifact". A page offers a file through the `downloads` capability instead, and `publish` warns when the page has an `<a download>` link and neither this publish nor the artifact's stored declaration includes `downloads`.
348
+
349
+ ```bash
350
+ claude-artifact publish ./site --capability downloads
351
+ ```
352
+
353
+ ```js
354
+ // Ask on the viewer's click; keep the plain link as the fallback outside claude.ai.
355
+ const downloads = await claude.use("downloads"); // null: unavailable
356
+ link.addEventListener("click", async (event) => {
357
+ if (!downloads) return; // let the plain link try
358
+ event.preventDefault();
359
+ const data = await (await fetch("deck.pptx")).blob(); // a file published with the page
360
+ try {
361
+ await downloads.save({ filename: "deck.pptx", data });
362
+ } catch (err) {
363
+ // the viewer cancelled, or the save failed: say so on the page
364
+ }
365
+ });
366
+ ```
367
+
368
+ The viewer confirms each save ("Let this artifact download a file?" with the name and size).
369
+
370
+ ### Sharing and housekeeping
371
+
372
+ ```bash
373
+ claude-artifact share <slug> # audience, people, viewers, commenters
374
+ claude-artifact share <slug> --org # everyone in your organization
375
+ claude-artifact share <slug> --private # only you
376
+ claude-artifact share <slug> --add <account-uuid> --access view
377
+ claude-artifact share <slug> --remove <account-uuid>
378
+ claude-artifact versions <slug>
379
+ claude-artifact rename <slug> "New title" # recorded as a new version
380
+ claude-artifact pin <slug>
381
+ claude-artifact delete <slug> --yes
382
+ ```
383
+
384
+ Sharing is read-modify-write: a change made by someone else in between is refused rather than overwritten. People are named by claude.ai account UUID (`owner_account` in `list --json`, `author.account` in comments for org members); there is no lookup by email. `delete` refuses without `--yes`.
385
+
231
386
  ## Updates
232
387
 
233
388
  A uv tool or pipx install keeps itself current. At most once a day, a command checks PyPI in the background (2-second timeout, never in CI). When a newer release is out, it starts `uv tool upgrade claude-artifact-cli` (or `pipx upgrade claude-artifact-cli`) in a detached process after the command finishes and says so on stderr; `-q` keeps that quiet. The upgrade's output goes to `~/.config/claude-artifact-cli/update.log`. A plain pip install isn't changed behind your back: it prints a notice instead. A failed check or upgrade never changes the command's output or exit code.
@@ -289,6 +444,15 @@ curl -fsSL https://raw.githubusercontent.com/nikships/claude-artifact-cli/main/s
289
444
  | `an artifact made from a type can only be patched` | `--mode replace` on a typed directory. Leave `--mode` off. |
290
445
  | `…/index.html belongs to the artifact's type and can't be published; remove it` | A typed directory holds an `index.html`. Delete it. |
291
446
  | `429 … daily publish cap` | Plan limit. Resets at UTC midnight. |
447
+ | `Claude can only reply on a thread a person sent to Claude` | `comments reply`/`resolve` on a thread without "Send to Claude". Ask the person to send it to Claude, or answer on the page. |
448
+ | `this artifact's published version doesn't declare the db capability` | Republish with `--capability db --capability user`. |
449
+ | `the document changed since --if-version`, exit code `3` | Someone wrote the document since you read it. `db get` it again and redo the write. |
450
+ | `… names a document, not a collection` | A collection path needs an odd number of segments. Split off the last segment as the doc id. |
451
+ | `contract … has no capability …` | A misspelled `--capability`. The error lists the valid names. |
452
+ | `deleting … can't be undone; pass --yes` | `delete` needs `--yes`. |
453
+ | `HTTP 413: Request exceeds the maximum size` on `publish` | 0.3.0 and earlier sent files the server already stored inline, so republishing a directory over ~15 MB failed. Upgrade: `claude-artifact update`. |
454
+ | `warning: the page has <a download> links, which claude.ai blocks …` | See [Offering a file download](#offering-a-file-download). |
455
+ | "File downloads are not available for this artifact" on claude.ai | The page uses a plain download link. See [Offering a file download](#offering-a-file-download). |
292
456
 
293
457
  ## The protocol
294
458
 
@@ -299,15 +463,34 @@ POST /api/frame/deploy/direct publish
299
463
  POST /api/frame/deploy/prepare content-hash preflight (bodies over ~15 MB)
300
464
  POST /api/frame/upload stage blobs the preflight asked for
301
465
  GET /api/frame/{slug}?via=model_read boot: metadata, file manifest, assetToken
302
- GET /api/frame/read/{slug} ownership / sharing status
466
+ GET /api/frame/read/{slug} ownership, stored contract and capabilities
303
467
  GET /api/frame/frames?limit=N list
468
+ GET /api/frame/versions/{slug} version history
469
+ POST /api/frame/retitle/{slug} rename {"title"}
470
+ POST|DELETE /api/frame/favorite/{slug} pin / unpin
471
+ DELETE /api/frame/{slug} delete
472
+ GET|PATCH /api/frame/perm/{slug} sharing (PATCH needs If-Match: <version from GET>)
473
+
474
+ GET /api/frame/comments/{slug}?names=1 threads
475
+ POST /api/frame/comments/{slug}/{thread} reply as Claude
476
+ POST /api/frame/comments/{slug}/{thread}/session-resolve resolve
477
+ POST /api/frame/db/agent database
478
+ POST /api/frame/blob/{slug}/agent-upload|agent-list|agent-copy, /{id}/agent-delete assets
479
+
480
+ GET /api/frame/types[/{slug}[/files/{path}|/instances]] types
481
+ POST /api/frame/types/{slug}/create?idempotency_key=K new artifact from a type
482
+ GET /api/frame/contract/{latest|version}[/prompt] runtime contract
304
483
 
305
484
  GET https://{slug}.frame.claudeusercontent.com/_f/{ver}/_src/{path}?__frame_t=<assetToken>
306
485
  published source bytes (see Reading files)
307
486
  GET https://{slug}.frame.claudeusercontent.com/_f/{ver}/{path}?__frame_t=<assetToken>
308
487
  served copy
488
+ GET https://{slug}.frame.claudeusercontent.com/_f/{ver}/_blob/{id}?__frame_t=<assetToken>
489
+ an uploaded asset
309
490
  ```
310
491
 
492
+ Every route above answers the OAuth bearer directly. Claude Code routes some of them through a relay in cloud sessions; on a local machine it calls them directly too.
493
+
311
494
  Headers on `api.anthropic.com` calls:
312
495
 
313
496
  ```
@@ -345,7 +528,9 @@ A manifest value with `content` inlines the file; one with `sha256` references a
345
528
 
346
529
  **Wire encoding.** These content types go as raw UTF-8 strings; everything else is base64: `text/html`, `text/css`, `text/plain`, `text/markdown`, `text/csv`, `text/javascript`, `application/javascript`, `application/json`, `application/manifest+json`, `application/xml`, `text/xml`, `image/svg+xml`.
347
530
 
348
- Response: `{"slug", "version", "read", "shared", "kind"}`. The page lives at `https://claude.ai/code/artifact/<slug>`.
531
+ Optional deploy fields: `description`, `icon`, `label`, `note`, `thumbnail` and `thumbnail_dark` (base64 images), and `contract` with `capabilities` (`{"db": {}, "user": {}}`). `capabilities` requires `contract` (`HTTP 400: capabilities requires contract`); a deploy without `capabilities` keeps the stored declaration, and `{}` clears it. A patch needs a non-empty manifest.
532
+
533
+ Response: `{"slug", "version", "manifest", "history", "contract", "capabilities", …}`. The page lives at `https://claude.ai/code/artifact/<slug>`.
349
534
 
350
535
  **Modes and conflicts.** `replace` makes the manifest the whole artifact; `patch` overlays it onto `baseVersion`, keeping paths it doesn't name. Both modes honor `baseVersion`: if the live version is newer, the deploy is refused with
351
536
 
@@ -358,7 +543,38 @@ HTTP 409
358
543
 
359
544
  ### Large publishes
360
545
 
361
- Over ~15 MB inline, the client switches to `prepare` → `upload` → `deploy`. `prepare` takes `{slug?, shas:[…]}` and answers `{slug, missing:[…]}`. The missing blobs go to `/upload` in batches of at most 15 MB, and the final deploy references them by `sha256`: the hex sha256 of the raw file bytes.
546
+ Over ~15 MB inline, the client switches to `prepare` → `upload` → `deploy`. `prepare` takes `{slug?, shas:[…]}` and answers `{slug, missing:[…]}`. The missing blobs go to `/upload` in batches of at most 15 MB, and the final deploy references every supporting file by `sha256` (the hex sha256 of the raw file bytes): the ones just uploaded and the ones `prepare` did not list, which the server already stores. The page itself always goes inline. Sending stored files inline instead puts a large republish over the deploy body cap (`HTTP 413: Request exceeds the maximum size`).
547
+
548
+ ### Copying files from another artifact
549
+
550
+ A manifest entry can reference a file another artifact already published. First `POST /api/frame/upload` with `{"slug", "files": [{"path": "<dest>", "from": {"slug", "path", "ver"}}]}` (a new artifact reserves its slug with `/deploy/prepare` first), then deploy with `"<dest>": {"sha256": "<source sha256>", "contentType": "…"}`.
551
+
552
+ ### Comments
553
+
554
+ `GET /comments/{slug}?names=1` answers `{"threads": [...], "names": {account: name}, "viewer"}`. A thread is `{id, created_at, anchor: {path, label, file, file_sha, …}, comments: [...], resolved_at?, resolved_by?, claude_activated_at?}`; a comment is `{id, author: {account, role?}, text, created_at, to_claude_at?}`. `author.role` is set (`"assistant"`) on Claude's comments. `to_claude_at` marks a comment a person sent to Claude.
555
+
556
+ The OAuth token can reply and resolve only on threads with `claude_activated_at` (a person used "Send to Claude"); elsewhere the server answers `403 Claude is not activated on this thread`. A reply is `POST /comments/{slug}/{thread}` with `{"id": "<client uuid>", "text", "answers_summon"?: true}`; it answers `201 {"thread_id", "comment_id", "replayed"?}` and the same `id` again answers `replayed: true` without posting. Resolve is `POST …/session-resolve` with `{"resolved": true}`. Starting a thread (`POST /comments/{slug}`) and `/resolve` answer `403 this comment action requires a claude.ai session`.
557
+
558
+ ### Database
559
+
560
+ `POST /api/frame/db/agent` with `{"slug", "verb", "args"}`:
561
+
562
+ | verb | args |
563
+ |------|------|
564
+ | `whoami` | `{}` → `{"id"}` |
565
+ | `get` | `{"path": "coll/doc"}` → `{exists, data, version, updatedAt}` |
566
+ | `list`, `query` | `{"collection", "limit"?, "cursor"?, "where"?: [{field, op, value}], "orderBy"?: {field, direction}}` → `{docs: [{id, data, version, updatedAt}], nextCursor}` |
567
+ | `set` | `{"path", "data", "replace": true, "ifVersion"?}` |
568
+ | `update` | `{"path", "data", "ifVersion"?}` |
569
+ | `delete` | `{"path", "ifVersion"?}` |
570
+ | `str_replace` | `{"path", "field", "old_str", "new_str", "replace_all"?, "idem": <16 random bytes, base64url>, "ifVersion"?}` |
571
+ | `batch` | `{"ops": [{"op", …the args above}]}` → `{results: [{version?}]}` |
572
+
573
+ `op` is `eq ne lt lte gt gte in not-in array-contains`. Writes answer `{version, usage}`. Errors are `{"error": {"code", "message", …}}`: `404 not_declared` when the published version doesn't declare `db`, `409 version_mismatch` (with the current `version`) when `ifVersion` is stale.
574
+
575
+ ### Assets
576
+
577
+ `agent-upload` takes the raw file bytes with the asset's `Content-Type` and answers `{opaque_id, url: "/_blob/<id>", size_bytes, content_type, sha256}`. `agent-list` takes `{"limit", "after"?}` and answers `{assets, usage, next?}`; `agent-copy` takes `{"from": <slug>, "ids": [...]}`; `/{id}/agent-delete` takes `{}` and answers `{"deleted"}`.
362
578
 
363
579
  ### Reading files
364
580
 
@@ -380,9 +596,10 @@ The `assetToken` is redacted from every output and never written to disk.
380
596
 
381
597
  ### Not supported
382
598
 
383
- - **Delete and pin.** Both go through a relay-only route that isn't reachable on the direct path. Use `/artifacts` in Claude Code, or claude.ai.
384
- - **Capabilities.** Runtime capability declarations (`capabilities`, `contract`) are accepted by the API but not exposed as flags.
385
- - **Comments, watching, thumbnails.**
599
+ - **Starting comment threads, or commenting as yourself.** Those routes need a claude.ai browser session.
600
+ - **Artifacts shared from other organizations in `list`.** `GET /frames/external` needs a browser session.
601
+ - **Push notifications.** Claude Code's watch subscribes a webhook (`/subscribe/{slug}`) minted by its own session; `watch` polls instead.
602
+ - **Sharing by email.** The route takes account UUIDs; Claude Code resolves names on an approval card the CLI has no equivalent of.
386
603
 
387
604
  ## Project Structure
388
605
 
@@ -401,7 +618,8 @@ src/
401
618
  ├── __main__.py python -m claude_artifact_cli
402
619
  ├── api.py frame API client
403
620
  ├── auth.py token lookup
404
- ├── cli.py argparse entry point
621
+ ├── cli.py argparse entry point; publish, read, pull, status
622
+ ├── commands.py comments, db, assets, types, sharing, history, watch
405
623
  └── update.py daily update check, background upgrade, `update`
406
624
  tests/ unit tests (offline; transport mocked)
407
625
  AGENTS.md