@yargote/artifacts-cli 0.1.0-beta.1 → 0.1.0-beta.10
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 +150 -19
- package/package.json +9 -4
- package/skills/artifacts-cli/SKILL.md +78 -0
- package/skills/artifacts-cli/references/commands.md +240 -0
- package/skills/artifacts-cli/references/verify-retained.md +119 -0
- package/skills/artifacts-cli/scripts/prepare-retained.mjs +149 -0
- package/skills/artifacts-design/SKILL.md +92 -0
- package/skills/artifacts-design/THIRD-PARTY-NOTICES.md +155 -0
- package/skills/artifacts-design/fonts/OFL.txt +96 -0
- package/skills/artifacts-design/fonts/bricolage-grotesque.woff2 +0 -0
- package/skills/artifacts-design/fonts/jetbrains-mono.woff2 +0 -0
- package/skills/artifacts-design/fonts/newsreader-italic.woff2 +0 -0
- package/skills/artifacts-design/fonts/newsreader.woff2 +0 -0
- package/skills/artifacts-design/fonts/public-sans-italic.woff2 +0 -0
- package/skills/artifacts-design/fonts/public-sans.woff2 +0 -0
- package/skills/artifacts-design/references/canvas.md +100 -0
- package/skills/artifacts-design/references/catppuccin.md +38 -0
- package/skills/artifacts-design/references/interface-checks.md +60 -0
- package/skills/artifacts-design/references/local-checks.md +70 -0
- package/skills/artifacts-design/references/visual-explanations.md +13 -0
- package/skills/artifacts-design/scripts/embed-fonts.mjs +246 -0
- package/skills/artifacts-design/scripts/verify-local.mjs +333 -0
- package/skills/artifacts-design/templates/starter.html +170 -0
- package/src/auth.d.ts +4 -1
- package/src/auth.js +184 -45
- package/src/credentials.d.ts +2 -0
- package/src/credentials.js +22 -0
- package/src/index.js +121 -20
- package/src/operations.d.ts +68 -38
- package/src/operations.js +9 -1
- package/src/skills.d.ts +9 -0
- package/src/skills.js +181 -0
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Artifacts CLI reference
|
|
2
2
|
|
|
3
|
-
The `artifacts` Node CLI reads and writes retained artifacts through REST. It prints JSON results to stdout and diagnostics to stderr. Node 24 or later is required. Its private credential database uses Node's experimental built-in SQLite API.
|
|
3
|
+
The `artifacts` Node CLI reads and writes retained artifacts through REST. It prints JSON results to stdout and diagnostics to stderr. Offline skills commands print plain text. Node 24 or later is required. Its private credential database uses Node's experimental built-in SQLite API.
|
|
4
4
|
|
|
5
5
|
The `@yargote/artifacts-cli` package exposes the `artifacts` binary as compiled ESM JavaScript. Its client and contracts dependencies install automatically. Repository development uses `pnpm artifacts` with the same command syntax.
|
|
6
6
|
|
|
@@ -11,9 +11,9 @@ Use Node 24 or later. The beta targets macOS and Linux. Windows has not been ver
|
|
|
11
11
|
Choose one persistent installation:
|
|
12
12
|
|
|
13
13
|
```sh
|
|
14
|
-
npm install --global @yargote/artifacts-cli@0.1.0-beta.
|
|
14
|
+
npm install --global @yargote/artifacts-cli@0.1.0-beta.10
|
|
15
15
|
# Or, with pnpm and an existing global bin directory on PATH:
|
|
16
|
-
pnpm add --global @yargote/artifacts-cli@0.1.0-beta.
|
|
16
|
+
pnpm add --global @yargote/artifacts-cli@0.1.0-beta.10
|
|
17
17
|
artifacts --version
|
|
18
18
|
```
|
|
19
19
|
|
|
@@ -22,23 +22,26 @@ If pnpm reports that no global bin directory exists, run `pnpm setup` and reopen
|
|
|
22
22
|
For one-off execution, pin the same version:
|
|
23
23
|
|
|
24
24
|
```sh
|
|
25
|
-
npx --yes @yargote/artifacts-cli@0.1.0-beta.
|
|
26
|
-
pnpm dlx @yargote/artifacts-cli@0.1.0-beta.
|
|
25
|
+
npx --yes @yargote/artifacts-cli@0.1.0-beta.10 --help
|
|
26
|
+
pnpm dlx @yargote/artifacts-cli@0.1.0-beta.10 --help
|
|
27
27
|
```
|
|
28
28
|
|
|
29
29
|
`@beta` follows future prereleases. Exact versions remain reproducible. No stable `latest` release is part of this beta. An organization's pnpm minimum release age or trust policy can delay a new release. Follow that policy rather than disabling it globally.
|
|
30
30
|
|
|
31
31
|
## Complete first use
|
|
32
32
|
|
|
33
|
-
|
|
33
|
+
Check `artifacts --help` for saved-connection support. With an older package that requires a server on every command, keep `ARTIFACTS_SERVER` set to the selected REST resource.
|
|
34
|
+
|
|
35
|
+
An existing Artifacts account is required. Select the REST OAuth resource, which is the API origin without `/mcp`. When upgrading an older deployment, complete the [API migration](../../docs/deployment.md#migrate-the-api-hostname) before using the address below.
|
|
34
36
|
|
|
35
37
|
```sh
|
|
36
|
-
|
|
37
|
-
artifacts login
|
|
38
|
+
artifacts login --server 'https://artifacts-api.yersonargotev.workers.dev'
|
|
38
39
|
artifacts whoami
|
|
39
40
|
```
|
|
40
41
|
|
|
41
|
-
Login opens browser authorization. After you approve access
|
|
42
|
+
Login opens browser authorization. After you approve access and the CLI verifies your identity, it saves the resolved REST resource in private state. A new terminal can run `artifacts whoami` without a server option or environment variable. It prints JSON with your user ID and scopes.
|
|
43
|
+
|
|
44
|
+
Use `artifacts login --no-browser` to open the printed authorization URL yourself on the same machine. This manual flow saves the connection only after identity verification succeeds.
|
|
42
45
|
|
|
43
46
|
Create `snapshot.json`:
|
|
44
47
|
|
|
@@ -64,7 +67,7 @@ artifacts export ARTIFACT_ID --revision REVISION_ID --out artifact.zip
|
|
|
64
67
|
artifacts logout
|
|
65
68
|
```
|
|
66
69
|
|
|
67
|
-
|
|
70
|
+
A publication URL requires sign-in. It opens for the owner and for a user whose verified email equals an email share of the artifact. That user sees only the published revision and its attachments. A retained request ID appears on stderr before each mutation. If the response is lost, run `artifacts retry REQUEST_ID` with the same server and state directory. Keep that state directory when upgrading, reinstalling, or switching between global and one-off execution.
|
|
68
71
|
|
|
69
72
|
## Upgrade or uninstall
|
|
70
73
|
|
|
@@ -80,19 +83,35 @@ Run `artifacts logout` before uninstalling if you want to clear credentials. Uni
|
|
|
80
83
|
|
|
81
84
|
## Server and local state
|
|
82
85
|
|
|
83
|
-
|
|
86
|
+
Skills, help, and version commands work without a server or login. Skills commands do not read credentials or create private state. They accept and ignore global `--server` and `--state-dir` values, including their environment defaults.
|
|
87
|
+
|
|
88
|
+
`--server RESOURCE` overrides `ARTIFACTS_SERVER`, which overrides the connection saved by the last successful login in the selected state directory.
|
|
89
|
+
|
|
90
|
+
An ordinary command override applies to that command and does not replace the saved connection. A later successful login replaces it with the verified canonical REST resource. A failed login to another server preserves the previous selection and its credentials.
|
|
91
|
+
|
|
92
|
+
Login also accepts an MCP resource that advertises its REST resource. Use the configured `API_URL` origin to call REST under `/v1`.
|
|
93
|
+
|
|
94
|
+
Without an override or saved connection, run `artifacts login --server RESOURCE` first. The CLI has no production default and does not rewrite the supplied URL. Existing installations keep their exact-resource credentials, but must complete a successful login to save a connection.
|
|
95
|
+
|
|
96
|
+
Older deployments without `API_URL` still use their complete MCP resource and routes under `/mcp/v1`.
|
|
84
97
|
|
|
85
|
-
|
|
98
|
+
A hostname change requires a new `artifacts login --server RESOURCE`. Credentials and retained operations remain bound to their exact original resource. Do not move an old operation file to the new resource or redirect its bearer requests.
|
|
99
|
+
|
|
100
|
+
`--state-dir DIR` overrides `ARTIFACTS_STATE_DIR`. The default is `~/.local/state/artifacts`. The state directory must be private and owned by the current user. Each state directory has its own saved connection and credential profiles. Credentials and the saved connection share one private database, separate from operation files. Profiles bind credentials to the exact resource. Retained operation paths hash the resource and request ID, so request IDs cannot select filesystem paths.
|
|
86
101
|
|
|
87
102
|
HTTPS is required except for HTTP on the exact loopback hosts `localhost`, `127.0.0.1`, and `[::1]`. Server URLs cannot contain credentials, a query, or a fragment.
|
|
88
103
|
|
|
89
104
|
## Authentication
|
|
90
105
|
|
|
91
|
-
`artifacts login --server RESOURCE` verifies protected-resource metadata
|
|
106
|
+
`artifacts login --server RESOURCE` verifies protected-resource metadata. If a resource advertises `artifacts_rest_resource`, the relation may name the same resource or one distinct REST resource. Login verifies metadata for a distinct resource and prints its REST URL to stderr. The distinct resource may omit the relation or name itself, but cannot name another resource. After identity verification, login saves that REST URL for later commands. An existing `ARTIFACTS_SERVER` still overrides it. Unset the variable to use the saved connection. Login anonymously checks `<resource>/v1/identity` before registering a public native OAuth client and opening browser authorization with PKCE. This check confirms REST compatibility. Login verifies your identity again with the received token before atomically saving credentials and the connection.
|
|
107
|
+
|
|
108
|
+
Errors identify the phase, method, endpoint, and HTTP status when a response exists. Network failures have no HTTP status. If the compatibility check fails, confirm the configured REST URL with your service administrator. A valid MCP metadata document alone does not establish REST compatibility.
|
|
109
|
+
|
|
110
|
+
`--no-browser` runs the same checks and prints the authorization URL for manual navigation. The loopback callback listener starts before browser navigation. Login requests read, write, and publication scopes. Client registration is reused for the profile.
|
|
92
111
|
|
|
93
112
|
`artifacts whoami` returns the verified user, session, OAuth client, and scopes.
|
|
94
113
|
|
|
95
|
-
`artifacts logout` clears local credentials and attempts to revoke the refresh token. Its JSON contains `signedOut: true` and `remoteRevocation` with `confirmed`, `unconfirmed`, or `not-needed`. Issued access JWTs can remain valid until expiry or central-session revocation.
|
|
114
|
+
`artifacts logout` clears local credentials and attempts to revoke the refresh token. It preserves the saved connection, so `artifacts login` can reuse the server without another URL. Its JSON contains `signedOut: true` and `remoteRevocation` with `confirmed`, `unconfirmed`, or `not-needed`. Issued access JWTs can remain valid until expiry or central-session revocation.
|
|
96
115
|
|
|
97
116
|
`ARTIFACTS_ACCESS_TOKEN` supplies an access token for automation. It does not require local login. Tokens are never command arguments or retained operation fields.
|
|
98
117
|
|
|
@@ -106,10 +125,15 @@ The private `credentials.sqlite` file stores credentials. The separate `credenti
|
|
|
106
125
|
artifacts login [--no-browser]
|
|
107
126
|
artifacts logout
|
|
108
127
|
artifacts whoami
|
|
109
|
-
artifacts create --snapshot FILE [--
|
|
128
|
+
artifacts create --snapshot FILE [--project NAME] [--slug SLUG] [--request-id ID]
|
|
129
|
+
[--response full|compact]
|
|
110
130
|
artifacts create --command FILE
|
|
111
|
-
artifacts list [--limit N] [--cursor CURSOR]
|
|
112
|
-
artifacts
|
|
131
|
+
artifacts list [--limit N] [--cursor CURSOR] [--project NAME]
|
|
132
|
+
artifacts projects
|
|
133
|
+
artifacts search QUERY [--project NAME] [--limit N] [--cursor CURSOR]
|
|
134
|
+
artifacts read ID [--revision REV] [--response full|compact] [--out FILE [--quiet]]
|
|
135
|
+
artifacts read --slug SLUG [--project NAME] [--revision REV] [--response full|compact]
|
|
136
|
+
[--out FILE [--quiet]]
|
|
113
137
|
artifacts update ID --snapshot FILE --expected-revision REV [--request-id ID]
|
|
114
138
|
[--response full|compact]
|
|
115
139
|
artifacts update [ID] --command FILE
|
|
@@ -118,11 +142,47 @@ artifacts history ID [--limit N] [--before-sequence N] [--summary]
|
|
|
118
142
|
artifacts publish ID --revision REV --expected-version N [--request-id ID]
|
|
119
143
|
artifacts publish [ID] --command FILE
|
|
120
144
|
artifacts export ID --revision REV --out FILE
|
|
145
|
+
artifacts move ID [--project NAME | --no-project] [--slug SLUG | --no-slug] [--request-id ID]
|
|
146
|
+
artifacts share ID --email EMAIL [--notify] [--request-id ID]
|
|
147
|
+
artifacts shares ID
|
|
148
|
+
artifacts unshare ID SHARE_ID [--request-id ID]
|
|
121
149
|
artifacts retry REQUEST_ID
|
|
150
|
+
artifacts skills [list]
|
|
151
|
+
artifacts skills get NAME [--full]
|
|
152
|
+
artifacts skills get --all [--full]
|
|
153
|
+
artifacts skills path [NAME]
|
|
154
|
+
artifacts skills install [NAME] [--agent claude] [--global] [--force]
|
|
122
155
|
```
|
|
123
156
|
|
|
124
157
|
Global `--server RESOURCE` and `--state-dir DIR` options can appear before or after the command. Options cannot be repeated. Unknown options and options for another command fail before submission.
|
|
125
158
|
|
|
159
|
+
## Bundled skills
|
|
160
|
+
|
|
161
|
+
Check `artifacts --help` for `skills` support. The published `0.1.0-beta.1` package predates this command group. These commands describe the current source and packages built from it.
|
|
162
|
+
|
|
163
|
+
`artifacts skills` and `artifacts skills list` print each bundled skill's name and description, separated by a tab. The catalog contains `artifacts-cli` and `artifacts-design`, which owns HTML design, bundled fonts, and the font embedding script. Their complete source directories are bundled with the CLI, so the instructions match the installed version and work offline.
|
|
164
|
+
|
|
165
|
+
`artifacts skills get artifacts-cli` prints the complete `SKILL.md` without headers or changes to its bytes. `--full` includes every bundled reference and template. Binary files such as fonts appear as a marker with their size, for example `=== artifacts-design/fonts/public-sans.woff2 (binary, 26636 bytes) ===`; read them from `artifacts skills path artifacts-design`. Each file starts with a catalog-relative marker such as `=== artifacts-cli/references/commands.md ===`. `artifacts skills get --all` prints every `SKILL.md` with these markers. Add `--full` to include every skill's support files.
|
|
166
|
+
|
|
167
|
+
`artifacts skills path` prints the absolute bundled catalog directory. Add a skill name to print that skill's directory. These paths belong to the CLI package and do not depend on the current directory.
|
|
168
|
+
|
|
169
|
+
Install a discovery skill for an agent with one of these commands.
|
|
170
|
+
|
|
171
|
+
| Command | Destination |
|
|
172
|
+
| --- | --- |
|
|
173
|
+
| `artifacts skills install` | `./.agents/skills/artifacts-cli/SKILL.md` |
|
|
174
|
+
| `artifacts skills install --agent claude` | `./.claude/skills/artifacts-cli/SKILL.md` |
|
|
175
|
+
| `artifacts skills install --global` | `~/.agents/skills/artifacts-cli/SKILL.md` |
|
|
176
|
+
| `artifacts skills install --agent claude --global` | `~/.claude/skills/artifacts-cli/SKILL.md` |
|
|
177
|
+
|
|
178
|
+
The optional name defaults to `artifacts-cli`. The default destination always uses `.agents`, even if `.claude` already exists. Only explicit `--agent claude` selects `.claude`. Local paths resolve from the current directory. Global paths resolve from the user's home directory.
|
|
179
|
+
|
|
180
|
+
The command prints the absolute destination. It leaves identical files unchanged, including their modification time. A differing file requires `--force`. Forced installation replaces only `SKILL.md` and preserves neighboring files. A directory or symbolic link at `SKILL.md` is rejected.
|
|
181
|
+
|
|
182
|
+
The discovery file instructs the agent to run `artifacts skills get artifacts-cli --full` and follow the returned instructions. It contains no copied workflow or fixed package path. After a CLI upgrade, the same discovery command loads that installed version's skill.
|
|
183
|
+
|
|
184
|
+
## Artifact input and output
|
|
185
|
+
|
|
126
186
|
Create and update snapshot files contain the complete domain snapshot.
|
|
127
187
|
|
|
128
188
|
```json
|
|
@@ -133,10 +193,81 @@ Create and update snapshot files contain the complete domain snapshot.
|
|
|
133
193
|
}
|
|
134
194
|
```
|
|
135
195
|
|
|
136
|
-
`read --out FILE` saves the returned artifact JSON and also prints it to stdout.
|
|
196
|
+
`read --out FILE` saves the returned artifact JSON and also prints it to stdout. Add `--quiet` to suppress successful stdout while saving the same bytes for the selected response mode. `--quiet` is available only for `read` and requires a nonempty `--out FILE`. Errors still go to stderr and exit with code `1`.
|
|
197
|
+
|
|
198
|
+
Check installed help for `--quiet` support. Version `0.1.0-beta.1` predates this option. With that version, `artifacts read ARTIFACT_ID --out saved.json > /dev/null` suppresses stdout while preserving stderr and the exit status.
|
|
199
|
+
|
|
200
|
+
A default full read contains the complete snapshot under `revision.snapshot`. `export --out FILE` saves the exact ZIP and prints its filename, local path, media type, SHA-256, and byte count. Output files use exclusive creation and never overwrite an existing path.
|
|
137
201
|
|
|
138
202
|
History defaults to complete revisions. `--summary` returns revision metadata and attachment summaries. `--before-sequence` continues a page. `list --cursor` continues an artifact list.
|
|
139
203
|
|
|
204
|
+
## Projects
|
|
205
|
+
|
|
206
|
+
A project groups artifacts by name. `create --snapshot FILE --project NAME` files the new artifact under that project. A name that matches an existing project regardless of letter case reuses its stored spelling, so `--project alpha` joins `Alpha`. Names are trimmed and NFC-normalized, contain 1 to 80 characters, and cannot contain control characters. A complete create command file can include the same optional `project` field.
|
|
207
|
+
|
|
208
|
+
```sh
|
|
209
|
+
artifacts create --snapshot snapshot.json --project Alpha
|
|
210
|
+
artifacts list --project alpha
|
|
211
|
+
artifacts projects
|
|
212
|
+
artifacts move ARTIFACT_ID --project Beta
|
|
213
|
+
artifacts move ARTIFACT_ID --no-project
|
|
214
|
+
```
|
|
215
|
+
|
|
216
|
+
Every artifact read and list item includes `project`, a name or null. `projects` prints `{ "items": [{ "name": "Alpha", "artifactCount": 1 }] }`, ordered by name without regard to letter case. A project exists only while it contains an artifact.
|
|
217
|
+
|
|
218
|
+
`move ID` requires at least one of `--project NAME`, `--no-project`, `--slug SLUG`, or `--no-slug`, and accepts at most one from each pair. An option left out keeps that value. It prints `{ "artifactId": "...", "project": "Beta" }` with the stored spelling, or `null` after `--no-project`. Move never creates a revision or changes the publication. Moving to the current project succeeds without change. Move is a retained mutation like the others, so `retry` recovers a lost response.
|
|
219
|
+
|
|
220
|
+
Version `0.1.0-beta.4` and earlier parse artifact responses strictly and fail with `invalid_response` against a server that returns `project`. Upgrade the CLI together with the server.
|
|
221
|
+
|
|
222
|
+
## Slugs
|
|
223
|
+
|
|
224
|
+
A slug names a page within its project, so `read` can find it without its ID. `create --slug SLUG` sets it. A slug contains 1 to 160 characters of lowercase ASCII kebab-case segments separated by `/`, such as `concepts/rag` or `index`. It is never normalized, and a trailing `.md` is rejected with a hint to remove it. A complete create command file can include the same optional `slug` field.
|
|
225
|
+
|
|
226
|
+
```sh
|
|
227
|
+
artifacts create --snapshot snapshot.json --project Mi-Wiki --slug concepts/rag
|
|
228
|
+
artifacts read --project mi-wiki --slug concepts/rag
|
|
229
|
+
artifacts read --slug index
|
|
230
|
+
artifacts move ARTIFACT_ID --slug concepts/retrieval
|
|
231
|
+
artifacts move ARTIFACT_ID --no-slug
|
|
232
|
+
```
|
|
233
|
+
|
|
234
|
+
A slug is unique within the owner's project, matched by the project's stored spelling. Artifacts without a project share one unfiled namespace, which `read --slug` reads without `--project`. `read` takes exactly one of an ID or `--slug`, and `--project` applies only with `--slug`. A used slug fails `create` with `slug_conflict`, status 409, and the holder's `artifactId`. A locator with no artifact fails with `not_found`. Every artifact read and list item includes `slug`, a name or null. Version `0.1.0-beta.7` and earlier reject responses that include `slug` with `invalid_response`.
|
|
235
|
+
|
|
236
|
+
`move ID --slug SLUG` renames a page in its project, and `move ID --no-slug` clears the slug. A move to another project keeps the slug. A move fails with `slug_conflict`, status 409, and the holder's `artifactId` when the target project already uses the target slug, and then changes nothing. A slug change creates no revision. Verify the new slug with `read`. The move result is unchanged, so published CLI versions keep working against this server.
|
|
237
|
+
|
|
238
|
+
## Search pages
|
|
239
|
+
|
|
240
|
+
`search QUERY` finds owned Markdown and text artifacts whose title, description, or content at the head revision contains every term of `QUERY`. Quote a query that contains spaces.
|
|
241
|
+
|
|
242
|
+
```sh
|
|
243
|
+
artifacts search envigado
|
|
244
|
+
artifacts search "tarde envigado" --project mi-wiki
|
|
245
|
+
artifacts search envigado --limit 5 --cursor 5
|
|
246
|
+
```
|
|
247
|
+
|
|
248
|
+
The query is plain text of 1 to 256 characters. Every whitespace-separated term must match, letter case and accents are ignored, and operators or punctuation in the query are treated as text, so input such as `"foo" OR NEAR(` never fails with a syntax error. HTML and design artifacts, older revisions, and artifacts shared with the caller are not searched. `--project NAME` limits results to one project, matched regardless of letter case. `--limit` is 1 to 25 and defaults to 10. The command prints `{ "items": [...], "nextCursor": "10" }`; pass `nextCursor` as `--cursor` for the next page, and `null` means there are no more results. Items are `{ artifactId, project, slug, title, snippet, rank }`, ordered by `rank` and then `artifactId`. `rank` is the FTS5 `bm25` score, where lower is more relevant, and `snippet` is an excerpt with each match wrapped in `**`. Search requires `artifacts:read`.
|
|
249
|
+
|
|
250
|
+
## Share publication access
|
|
251
|
+
|
|
252
|
+
These commands are available from `0.1.0-beta.6`. Check installed help for support.
|
|
253
|
+
|
|
254
|
+
```sh
|
|
255
|
+
artifacts share ARTIFACT_ID --email ana@example.com --request-id share-ana-001
|
|
256
|
+
artifacts shares ARTIFACT_ID
|
|
257
|
+
artifacts unshare ARTIFACT_ID SHARE_ID --request-id unshare-ana-001
|
|
258
|
+
artifacts retry share-ana-001
|
|
259
|
+
```
|
|
260
|
+
|
|
261
|
+
`share` trims and lowercases the email and prints one share as JSON with `shareId`, `artifactId`, `kind: "email"`, `value`, and `createdAt`. `shares` prints `{ "items": [...] }` with current grants and retains no operation. Take `SHARE_ID` from that output. `unshare` and a successful retry of an unshare exit zero with empty stdout. All three commands require the owner's `artifacts:publish` scope.
|
|
262
|
+
|
|
263
|
+
A signed-in user whose verified email matches a share can view the published revision and its attachments. History, export, edits, and project moves remain owner-only. Shares created before first publication remain stored, but the URL opens only after publication. Add `--notify` to request one invitation email. Invited people can sign in with an email code when the server enables email.
|
|
264
|
+
|
|
265
|
+
Share and unshare retain the complete normalized command before submission. Recover an uncertain result with `retry REQUEST_ID`. A replay confirms the original operation, so a historical share replay does not restore a revoked grant. An old unshare replay leaves a deliberate new share intact. Run `shares ARTIFACT_ID` to verify current grants.
|
|
266
|
+
|
|
267
|
+
Share with `--notify` to request one email attempt. Access succeeds when mail is disabled or the owner has used the daily allowance. The JSON result adds `notification.status` as `requested` or `skipped`, with `disabled` or `rate_limited` as the skip reason. `requested` does not confirm delivery. A crash after commit can lose the message. An exact retry preserves the captured flag and never sends a second email. Use a new deliberate command to request another attempt for existing access.
|
|
268
|
+
|
|
269
|
+
Owners can reserve 100 invitations per UTC day. Revoke, deletion, and failed delivery do not refund reservations. New access is limited to 100 people per artifact and 1000 grants per owner. Existing access remains listable and revocable.
|
|
270
|
+
|
|
140
271
|
## Complete commands and edits
|
|
141
272
|
|
|
142
273
|
`--command FILE` accepts a complete create, update, or publish command. It cannot be combined with other mutation options. For update and publish, an optional positional artifact ID must equal the command's `artifactId`. Every field, including the omission of `response`, is retained.
|
|
@@ -168,7 +299,7 @@ Publish always selects an immutable revision. `--expected-version 0` expects no
|
|
|
168
299
|
|
|
169
300
|
Each invocation resolves one access token for its reads, owner check, and submission. A concurrent login cannot change the command owner between these requests. Every mutation verifies the owner and retains an exclusive private operation file before submission. Missing request IDs default to random UUIDs. The operation stores its exact command, owner, and resource. It contains no credentials. Existing operation files require explicit `retry` and are never replaced by another preparation.
|
|
170
301
|
|
|
171
|
-
`retry REQUEST_ID` verifies the current resource and owner, then sends the unchanged command once. Retry does not read a new head, change expected versions, add a response projection, or rebase a conflict. Its diagnostic identifies the
|
|
302
|
+
`retry REQUEST_ID` verifies the current resource and owner, then sends the unchanged command once. Retry does not read a new head, change expected versions, add a response projection, or rebase a conflict. Its diagnostic identifies replay of the original operation and warns that replay does not establish current state. A fresh `read` or `shares` returns current state.
|
|
172
303
|
|
|
173
304
|
If a response is lost after commit, retry recovers the original receipt. If a conflict occurs, the retained operation remains available for inspection. A new read and a deliberate new command with a new request ID are required to incorporate another writer's changes.
|
|
174
305
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yargote/artifacts-cli",
|
|
3
|
-
"version": "0.1.0-beta.
|
|
3
|
+
"version": "0.1.0-beta.10",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"description": "Command-line client for the Artifacts REST API.",
|
|
@@ -23,14 +23,19 @@
|
|
|
23
23
|
"files": [
|
|
24
24
|
"src",
|
|
25
25
|
"README.md",
|
|
26
|
-
"LICENSE"
|
|
26
|
+
"LICENSE",
|
|
27
|
+
"skills"
|
|
27
28
|
],
|
|
28
29
|
"dependencies": {
|
|
29
|
-
"@yargote/artifacts-contracts": "0.1.0-beta.
|
|
30
|
-
"@yargote/artifacts-client": "0.1.0-beta.
|
|
30
|
+
"@yargote/artifacts-contracts": "0.1.0-beta.10",
|
|
31
|
+
"@yargote/artifacts-client": "0.1.0-beta.10",
|
|
31
32
|
"openid-client": "6.8.8",
|
|
32
33
|
"zod": "4.6.5"
|
|
33
34
|
},
|
|
35
|
+
"artifactsSkills": [
|
|
36
|
+
"artifacts-cli",
|
|
37
|
+
"artifacts-design"
|
|
38
|
+
],
|
|
34
39
|
"publishConfig": {
|
|
35
40
|
"access": "public",
|
|
36
41
|
"tag": "beta",
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: artifacts-cli
|
|
3
|
+
description: Create, revise, inspect, publish, and export retained Artifacts through the artifacts CLI and REST API. Use when the user chooses the CLI or a terminal workflow for Artifacts. Exclude generic build artifacts and unrelated local files.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Manage retained Artifacts with the CLI
|
|
7
|
+
|
|
8
|
+
Use the installed `artifacts` executable. Run `artifacts --help` and read [the command workflow](references/commands.md) before the first operation. With bundled skills support, `artifacts skills get artifacts-cli --full` returns this skill and its complete command reference. If the executable is unavailable, report that prerequisite. Do not substitute database writes or invent CLI results.
|
|
9
|
+
|
|
10
|
+
## Select the account and resource
|
|
11
|
+
|
|
12
|
+
Use the resource selected by the user. Service commands select `--server RESOURCE` before `ARTIFACTS_SERVER`, then the connection saved by a successful login in the selected private state directory. Ordinary command overrides do not replace that connection. Skills, help, and version commands work offline without a server or login. Check installed help for saved-connection support. A resource is the canonical OAuth URL, such as `https://artifacts.example.test/mcp`. REST routes are below that resource at `/v1`. Do not infer a production connection from an example or silently switch to a local server.
|
|
13
|
+
|
|
14
|
+
Run `artifacts whoami` before the first mutation when the current identity is not established. Keep the selected resource and owner consistent throughout one operation. If login is needed, use `artifacts login --server RESOURCE`. The user authenticates in the browser. Do not collect their password or read another application's credentials. Never put tokens in command arguments, operation files, logs, or the final reply.
|
|
15
|
+
|
|
16
|
+
## Prepare retained content
|
|
17
|
+
|
|
18
|
+
A revision is a complete snapshot with `metadata`, `content`, and `files`. The command reference contains its JSON shape. Use the requested title, language, content, and attachments. Do not include unrelated files or credentials.
|
|
19
|
+
|
|
20
|
+
Use self-contained HTML for interactive content. For several HTML boards in one canvas, use `design` and follow the design skill's `references/canvas.md`. Inline styles and scripts and embed required assets as data URLs. External requests, CDN dependencies, relative executable assets, forms, browser storage, and multi-file websites are unsupported. Attachments are downloads, not importable website resources. Markdown and text display inertly.
|
|
21
|
+
|
|
22
|
+
Keep the whole revision within 1 MiB of decoded content, metadata, attachment paths, media types, and attachment bytes. At most 32 attachments are accepted. Base64 changes wire size, not the decoded limit. If required content exceeds a limit, explain the constraint without silently removing it.
|
|
23
|
+
|
|
24
|
+
Before writing or restyling HTML or design boards, run `artifacts skills get artifacts-design --full` and follow it. It owns typography, embedded fonts, color, layout, and the rendered checks. Finish those checks before saving when browser tools are available. A successful CLI write proves persistence, not visual quality or browser compatibility. Interactive HTML follows the server's Chrome policy; do not promise it in every browser.
|
|
25
|
+
|
|
26
|
+
## Create or revise
|
|
27
|
+
|
|
28
|
+
Create a draft when the user asks to save new content. Use a complete snapshot file and retain the CLI's request ID and operation record until the result is verified.
|
|
29
|
+
|
|
30
|
+
Resolve an existing artifact by its supplied ID, an observed publication URL, or a paginated list. If several results match, ask which one the user means. Read its current full snapshot before editing. Preserve metadata, custom JSON, content fields, and attachments the user did not ask to change.
|
|
31
|
+
|
|
32
|
+
Use `edit` for partial changes that preserve omitted fields. Use `update` for a complete next snapshot with the observed `headRevisionId` as its expected revision. Changing the attachment list replaces that inventory; an empty list removes all attachments. An update creates a retained revision and does not change the published revision.
|
|
33
|
+
|
|
34
|
+
## Organize projects
|
|
35
|
+
|
|
36
|
+
When the user names a project for new content, add `--project NAME` to `create`. Run `artifacts projects` first when an existing project may already fit. A name matching an existing project regardless of letter case joins it and keeps the stored spelling. Do not invent a project the user did not ask for. Use `list --project NAME` to find artifacts in a project.
|
|
37
|
+
|
|
38
|
+
When the user names a page, add `--slug SLUG` such as `concepts/rag` to `create`, and read it later with `read --project NAME --slug SLUG`, or `read --slug SLUG` for an unfiled page, instead of listing for its ID. Omit the `.md` suffix. A `slug_conflict` error names the `artifactId` that already holds the slug in that project. Rename a page with `move ID --slug SLUG` and clear its slug with `move ID --no-slug`. A move to another project keeps the slug, and a move into a used slug fails with `slug_conflict` without changing anything.
|
|
39
|
+
|
|
40
|
+
To find a page by what it says, run `artifacts search QUERY`, optionally with `--project NAME`, instead of listing and reading every artifact. Every term must match, and letter case and accents are ignored. Read a hit by its `artifactId`, or by `--project` and `--slug` when it has a slug. Search covers only owned Markdown and text artifacts at their head revision.
|
|
41
|
+
|
|
42
|
+
Use `move ID --project NAME` to file an existing artifact under a project and `move ID --no-project` to remove it from one. A move changes only the project. It creates no revision and leaves the publication unchanged. It is a retained mutation, so recover an uncertain move with `retry`. Verify it with `read` or `list --project NAME`. A project disappears when its last artifact leaves it.
|
|
43
|
+
|
|
44
|
+
## Publish deliberately
|
|
45
|
+
|
|
46
|
+
Publish when the user requests publication, a shareable artifact URL, or a change to the live artifact. Use the exact saved revision selected by the user or returned by the edit. Read the current publication version before preparing publication. Use zero only when the artifact is unpublished.
|
|
47
|
+
|
|
48
|
+
A published URL requires sign-in by the owner or a user whose verified email matches a current share. Publishing a historical revision leaves the draft head unchanged. Report the returned protected URL only after the publication succeeds and its current state is verified.
|
|
49
|
+
|
|
50
|
+
## Share publication access
|
|
51
|
+
|
|
52
|
+
Check installed help for `share`, `shares`, and `unshare` support. These commands are available from `0.1.0-beta.6`. Share only when the user requests access for an exact email. Use `share ARTIFACT_ID --email EMAIL`, then verify the normalized email with `shares ARTIFACT_ID`. Use the observed `shareId` with `unshare ARTIFACT_ID SHARE_ID` to revoke it. Unshare and its successful retry exit zero with empty stdout.
|
|
53
|
+
|
|
54
|
+
A matching signed-in user must have a verified email. Access covers the published revision and its attachments. History, export, editing, and project moves stay owner-only. A share before first publication remains stored and waits for publication. Add `--notify` when the user asks for an invitation email. Invited people can sign in with an email code when the server enables email.
|
|
55
|
+
|
|
56
|
+
Recover uncertain share or unshare results with `retry REQUEST_ID`. Replay confirms the original operation and does not establish current grants. An old share replay does not restore revoked access. An old unshare replay does not remove a deliberate new share. Verify current grants with `shares ARTIFACT_ID`.
|
|
57
|
+
|
|
58
|
+
When the user asks to notify an invited person, add `--notify` to `artifacts share`. Preserve that flag in the retained command and use `artifacts retry` after an uncertain response. Report `requested` as an invitation request, never as confirmed delivery. A skipped notification still grants access. A new deliberate share command can request another attempt for existing access, subject to the owner's daily allowance.
|
|
59
|
+
|
|
60
|
+
## Recover an uncertain write
|
|
61
|
+
|
|
62
|
+
The CLI retains complete mutations before sending them. After a connection failure or uncertain result, use `retry` with that retained request ID once. Keep the same resource, owner, request ID, response mode, snapshot, and expected versions. Do not rerun a convenience edit or generate a new ID to repeat an operation whose outcome is unknown.
|
|
63
|
+
|
|
64
|
+
If the retry remains unavailable, report the uncertainty and retain the recovery record. A conflict stops the failed operation. Read the current state and report the concurrent change. Do not replace expected versions to force a write. A changed operation needs a deliberate new command and request ID.
|
|
65
|
+
|
|
66
|
+
A `request_conflict` means the ID was used with different arguments. Do not describe it as success. Authentication, validation, missing-artifact, and service failures likewise remain failures.
|
|
67
|
+
|
|
68
|
+
## Verify and deliver
|
|
69
|
+
|
|
70
|
+
Retain successful create, update, or edit stdout in a private receipt file. After create or update, read the explicit returned revision. Use `read ARTIFACT_ID --revision REVISION_ID --out FILE --quiet` to retain the full response without printing its snapshot. Check that the installed `--help` supports `--quiet` first. For older versions, use the command workflow's stdout redirection fallback. Compare the saved complete metadata, content, and decoded attachment bytes with the intended snapshot. For an update, check that its parent is the head used for preparation. Compact responses cannot verify omitted content.
|
|
71
|
+
|
|
72
|
+
After publication, read current publication and compare revision, version, and URL with the committed result. A replayed receipt describes the original commit; another writer may have changed the current publication afterward. Report that difference.
|
|
73
|
+
|
|
74
|
+
For real panel and requested protected-publication checks, follow [the exact saved revision recipe](references/verify-retained.md). It prepares the existing verifier inputs from the write receipt and independent full read. It also gives an installed-browser route when the complete verifier runtime is unavailable. Report persistence, local rendering, panel rendering, and protected publication separately. Input preparation is not a browser pass.
|
|
75
|
+
|
|
76
|
+
Follow list and history cursors when the request needs more than the first page. Export an explicit retained revision to the requested destination. The CLI checks the archive digest. Confirm that the file exists and inspect its manifest and relevant content before linking it.
|
|
77
|
+
|
|
78
|
+
Report the title, saved revision, and draft or published state in the user's language. Link the actual export or returned protected publication URL. Distinguish persistence from any visual or browser checks that did not run. Keep local credential and session identifiers private.
|