@artifactshare/cli 0.1.5 → 0.1.7

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
@@ -19,44 +19,66 @@ On the first run in an interactive terminal, the CLI prints a sign-in link — o
19
19
  ```sh
20
20
  npx --yes @artifactshare/cli publish ./dist --project "Weekly Reports"
21
21
  npx --yes @artifactshare/cli projects create "Client reports" --json
22
- npx --yes @artifactshare/cli move <artifact-id-or-url> --project-id <id> --json
22
+ npx --yes @artifactshare/cli projects edit <id> --add-email viewer@example.com --json
23
+ npx --yes @artifactshare/cli edit <artifact-id-or-url> --project-id <id> --json
24
+ npx --yes @artifactshare/cli edit <artifact-id-or-url> --visibility private --grant-email viewer@example.com --json
23
25
  npx --yes @artifactshare/cli update <artifact-id-or-url> ./dist
26
+ npx --yes @artifactshare/cli delete <artifact-id-or-url> --json
24
27
  ```
25
28
 
29
+ To keep an existing share URL, update it with
30
+ `npx --yes @artifactshare/cli update <artifact-id-or-url> <path>` instead of
31
+ publishing again. For CI, scheduled reports, or other repeat jobs, use
32
+ `publish <path> --key <key>`: the first run creates the shared file, and later
33
+ runs add versions to the same file.
34
+
26
35
  ## Authentication
27
36
 
28
- - **Interactive**: run `npx --yes @artifactshare/cli login`, or just run any command — unauthenticated `publish` / `update` / `download` start the sign-in for you (the CLI prints a link and code to open in your browser).
37
+ - **Interactive**: run `npx --yes @artifactshare/cli login`, or run `publish`, `update`, or `download` directly — those commands start sign-in for you when unauthenticated (the CLI prints a link and code to open in your browser).
29
38
  - **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.
30
39
  - 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 profile without browser login.
31
40
 
32
41
  ## Commands
33
42
 
34
- | Command | What it does |
35
- | ----------------------------------------- | ---------------------------------------------------------------------------------------------- |
36
- | `publish <path>` | Publish a file or folder as a new shared file (`--project`, `--home`, `--visibility`, `--key`) |
37
- | `update <target> <path>` | Add a new version to an existing file (ID or share URL) |
38
- | `resolve <value>` | Find files by URL, ID, title, or project name |
39
- | `artifacts get <target>` | Read a file's content and metadata back |
40
- | `download <target>` | Save a file or a whole static site locally |
41
- | `comments list / post <target>` | Read and write comments, including inline quotes and replies |
42
- | `projects list / create` | List projects you can publish to, or create a new project |
43
- | `move <target>` | Move an existing file into a project or back home |
44
- | `request-access` | Join the waitlist when publishing is not enabled yet |
45
- | `login` / `whoami` | Sign in and check who you are |
46
- | `doctor` | Diagnose auth, destination, network, and upload readiness — tells you the next command to run |
47
- | `profiles list / use / import-token` | Switch between local account profiles and import an issued token from stdin |
48
- | `init` | Save a default project for the current directory |
49
- | `skills install / list / update / remove` | Install the bundled usage guide into your AI agent's skills |
43
+ | Command | What it does |
44
+ | ------------------------------------------------------------------ | ---------------------------------------------------------------------------------------------- |
45
+ | `publish <path>` | Publish a file or folder as a new shared file (`--project`, `--home`, `--visibility`, `--key`) |
46
+ | `update <target> <path>` | Add a new version to an existing file (ID or share URL) |
47
+ | `edit <target>` | Change title, sharing, explicit viewers, or project placement |
48
+ | `delete <target>` | Permanently delete a file you published |
49
+ | `resolve <value>` | Find files by URL, ID, title, or project name |
50
+ | `agent open <target>` | First command for agents opening a shared URL; ensures skills, then reads or suggests download |
51
+ | `artifacts get <target>` | Read a file's content and metadata back |
52
+ | `download <target>` | Save a file or a whole static site locally |
53
+ | `comments list / post / edit / resolve / reopen / delete <target>` | Read, write, edit, resolve, reopen, and permanently delete comments |
54
+ | `projects list / create / edit` | List, create, and edit project destinations and audience |
55
+ | `move <target>` | Move an existing file into a project or back home; `edit` is preferred for new automation |
56
+ | `request-access` | Join the waitlist when publishing is not enabled yet |
57
+ | `login` / `whoami` | Sign in and check who you are |
58
+ | `doctor` | Diagnose auth, destination, network, and upload readiness — tells you the next command to run |
59
+ | `profiles list / use / import-token` | Switch between local account profiles and import an issued token from stdin |
60
+ | `init` | Save a default project for the current directory |
61
+ | `skills ensure / install / list / update / remove` | Install or update the bundled usage guide in your AI agent's skills |
50
62
 
51
63
  ## For AI agents
52
64
 
53
- Teach your agent how to use Artifact Share once:
65
+ When an agent receives an Artifact Share URL, start here:
54
66
 
55
67
  ```sh
56
- npx --yes @artifactshare/cli skills install
68
+ npx --yes @artifactshare/cli agent open <artifact-id-or-url> --json
57
69
  ```
58
70
 
59
- This installs a skill (for Claude Code, Codex, and Cursor) that covers publishing, updating, and reading comments.
71
+ This installs or updates the local skill first, then reads single-file artifacts. Static sites and multi-file artifacts return a `download` next command.
72
+
73
+ To prepare the local skills without opening a URL:
74
+
75
+ ```sh
76
+ npx --yes @artifactshare/cli skills ensure --tool auto --scope project --json
77
+ ```
78
+
79
+ `skills ensure --tool auto` detects Claude Code, Codex, and Cursor project markers. Use `skills install --tool <codex|claude|cursor>` only when you want to target a specific tool manually.
80
+
81
+ Comment deletion is permanent. Use `comments delete <target> --thread-id <id> --message-id <id> --json` for one message, or omit `--message-id` only when deleting the whole thread.
60
82
 
61
83
  All commands emit stable JSON when run non-interactively, piped, or with `--json`: success on stdout as `{ "schema_version": 1, "ok": true, "command": ..., "data": ... }`, failures on stderr as `{ "schema_version": 1, "ok": false, "command": ..., "error": ... }` with exit code 1. The `error` object carries a machine-readable `code`, a `hint`, and a structured `recovery` field (for example `{ "kind": "run_command", ... }`), so agents and scripts can branch and recover without parsing prose.
62
84