@artifactshare/cli 0.1.4 → 0.1.5
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 +19 -16
- package/dist/index.js +202 -14
- package/package.json +1 -1
- package/skills/artifactshare/SKILL.md +16 -7
- package/skills/artifactshare/artifactshare.mdc +5 -4
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Artifact Share CLI
|
|
2
2
|
|
|
3
|
-
The official CLI to upload and share files, folders, and static sites on [Artifact Share](https://artifactshare.com) from terminals, AI agents, and automation. Publish HTML, Markdown, and exported sites to stable share URLs, update existing
|
|
3
|
+
The official CLI to upload and share files, folders, and static sites on [Artifact Share](https://artifactshare.com) from terminals, AI agents, and automation. Publish HTML, Markdown, and exported sites to stable share URLs, update existing files, and emit `--json` for scripts and agents.
|
|
4
4
|
|
|
5
5
|
Artifact Share hosts AI-built reports, documents, and static sites so you can share them with teammates and clients. This CLI publishes a single file or a whole folder (HTML, Markdown, exported SPAs, images included), updates versions, reads content and comments back, and works the same for humans, terminal agents (Claude Code, Codex, Cursor Agent), and automation.
|
|
6
6
|
|
|
@@ -18,6 +18,8 @@ On the first run in an interactive terminal, the CLI prints a sign-in link — o
|
|
|
18
18
|
|
|
19
19
|
```sh
|
|
20
20
|
npx --yes @artifactshare/cli publish ./dist --project "Weekly Reports"
|
|
21
|
+
npx --yes @artifactshare/cli projects create "Client reports" --json
|
|
22
|
+
npx --yes @artifactshare/cli move <artifact-id-or-url> --project-id <id> --json
|
|
21
23
|
npx --yes @artifactshare/cli update <artifact-id-or-url> ./dist
|
|
22
24
|
```
|
|
23
25
|
|
|
@@ -29,21 +31,22 @@ npx --yes @artifactshare/cli update <artifact-id-or-url> ./dist
|
|
|
29
31
|
|
|
30
32
|
## Commands
|
|
31
33
|
|
|
32
|
-
| Command | What it does
|
|
33
|
-
| ----------------------------------------- |
|
|
34
|
-
| `publish <path>` | Publish a file or folder as a new
|
|
35
|
-
| `update <target> <path>` | Add a new version to an existing
|
|
36
|
-
| `resolve <value>` | Find
|
|
37
|
-
| `artifacts get <target>` | Read
|
|
38
|
-
| `download <target>` | Save a file or a whole static site locally
|
|
39
|
-
| `comments list / post <target>` | Read and write comments, including inline quotes and replies
|
|
40
|
-
| `projects list`
|
|
41
|
-
| `
|
|
42
|
-
| `
|
|
43
|
-
| `
|
|
44
|
-
| `
|
|
45
|
-
| `
|
|
46
|
-
| `
|
|
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 |
|
|
47
50
|
|
|
48
51
|
## For AI agents
|
|
49
52
|
|
package/dist/index.js
CHANGED
|
@@ -36,6 +36,7 @@ const BOOLEAN_FLAGS = new Set([
|
|
|
36
36
|
const VALUE_FLAGS = new Set([
|
|
37
37
|
"base-url",
|
|
38
38
|
"body",
|
|
39
|
+
"description",
|
|
39
40
|
"grant-email",
|
|
40
41
|
"include",
|
|
41
42
|
"key",
|
|
@@ -60,6 +61,7 @@ const COMMAND_NAMES = new Set([
|
|
|
60
61
|
"update",
|
|
61
62
|
"resolve",
|
|
62
63
|
"download",
|
|
64
|
+
"move",
|
|
63
65
|
"artifacts",
|
|
64
66
|
"comments",
|
|
65
67
|
"request-access",
|
|
@@ -78,7 +80,7 @@ const SUBCOMMANDS = {
|
|
|
78
80
|
"use",
|
|
79
81
|
"import-token"
|
|
80
82
|
],
|
|
81
|
-
projects: ["list"],
|
|
83
|
+
projects: ["list", "create"],
|
|
82
84
|
skills: [
|
|
83
85
|
"install",
|
|
84
86
|
"list",
|
|
@@ -282,6 +284,18 @@ function mapApiError(status, body, options = {}) {
|
|
|
282
284
|
requiresHuman: false,
|
|
283
285
|
recovery: { kind: "retry_later" }
|
|
284
286
|
});
|
|
287
|
+
if (apiCode === "invalid-destination") return cliError({
|
|
288
|
+
code: "invalid_destination",
|
|
289
|
+
message: apiMessage ?? "The move destination is invalid.",
|
|
290
|
+
why: "The destination project does not exist, is archived, or is not available in this workspace.",
|
|
291
|
+
hint: `Run ${PROJECTS_LIST_COMMAND}, then retry with --project-id <id> or --home.`,
|
|
292
|
+
agentRecoverable: true,
|
|
293
|
+
requiresHuman: false,
|
|
294
|
+
recovery: {
|
|
295
|
+
kind: "run_command",
|
|
296
|
+
command: PROJECTS_LIST_COMMAND
|
|
297
|
+
}
|
|
298
|
+
});
|
|
285
299
|
if (apiCode !== null && [
|
|
286
300
|
"unsupported-type",
|
|
287
301
|
"invalid-key",
|
|
@@ -632,7 +646,8 @@ const TARGET_COMMAND_LABELS = {
|
|
|
632
646
|
"artifacts get": "Artifacts get",
|
|
633
647
|
download: "Download",
|
|
634
648
|
"comments list": "Comments list",
|
|
635
|
-
"comments post": "Comments post"
|
|
649
|
+
"comments post": "Comments post",
|
|
650
|
+
move: "Move"
|
|
636
651
|
};
|
|
637
652
|
function targetResolutionError(input, command) {
|
|
638
653
|
return cliError({
|
|
@@ -2379,6 +2394,66 @@ function initData(written, config, resolved) {
|
|
|
2379
2394
|
};
|
|
2380
2395
|
}
|
|
2381
2396
|
//#endregion
|
|
2397
|
+
//#region src/command-runners/move.ts
|
|
2398
|
+
async function runMove(parsed, mode) {
|
|
2399
|
+
const command = "move";
|
|
2400
|
+
const target = parseArtifactTarget(parsed.positionals[0], command, "Pass an artifact ID or share URL to move.");
|
|
2401
|
+
if (target.error) return writeFailure(command, target.error, mode, 1);
|
|
2402
|
+
const hasProjectId = parsed.options.projectId !== void 0;
|
|
2403
|
+
const projectId = parsed.options.projectId?.trim() ?? "";
|
|
2404
|
+
const home = Boolean(parsed.options.home);
|
|
2405
|
+
if (hasProjectId && home || !projectId && !home) return writeFailure(command, validationError("Move destination is required.", "Choose exactly one destination: --project-id <id> or --home.", hasProjectId && home ? "destination_conflict" : "invalid_destination"), mode, 1);
|
|
2406
|
+
const credential = await resolveCredential(parsed.options, await resolveProjectConfig());
|
|
2407
|
+
if (!credential.ok) return writeFailure(command, credential.error, mode, 1);
|
|
2408
|
+
const request = await requestConfig(parsed.options);
|
|
2409
|
+
if (request.error) return writeFailure(command, request.error, mode, 1);
|
|
2410
|
+
const result = await apiPost(`/api/cli/shareables/${encodeURIComponent(target.artifactId)}/move`, credential.token, { destination: home ? "home" : { project_id: projectId } }, parsed.options, request.init, { artifactTarget: true });
|
|
2411
|
+
if (result.error) return writeFailure(command, result.error, mode, 1);
|
|
2412
|
+
const data = parseMoveData(result.body);
|
|
2413
|
+
if (!data) return writeFailure(command, serviceError("Move succeeded but the response did not include move data."), mode, 1);
|
|
2414
|
+
writeSuccess(command, data, mode);
|
|
2415
|
+
}
|
|
2416
|
+
function parseMoveData(body) {
|
|
2417
|
+
if (!isRecord(body)) return null;
|
|
2418
|
+
const artifact = body.artifact;
|
|
2419
|
+
const destination = body.destination;
|
|
2420
|
+
const share = body.share;
|
|
2421
|
+
if (!isRecord(artifact) || !isRecord(destination) || !isRecord(share)) return null;
|
|
2422
|
+
if (typeof artifact.id !== "string" || typeof destination.type !== "string" || typeof share.visibility !== "string" || typeof share.project_audience_may_change !== "boolean") return null;
|
|
2423
|
+
if (destination.type === "project") {
|
|
2424
|
+
if (typeof destination.project_id !== "string") return null;
|
|
2425
|
+
return {
|
|
2426
|
+
artifact: {
|
|
2427
|
+
id: artifact.id,
|
|
2428
|
+
url: typeof artifact.url === "string" ? artifact.url : null
|
|
2429
|
+
},
|
|
2430
|
+
destination: {
|
|
2431
|
+
type: "project",
|
|
2432
|
+
project_id: destination.project_id
|
|
2433
|
+
},
|
|
2434
|
+
share: {
|
|
2435
|
+
visibility: share.visibility,
|
|
2436
|
+
project_audience_may_change: share.project_audience_may_change
|
|
2437
|
+
}
|
|
2438
|
+
};
|
|
2439
|
+
}
|
|
2440
|
+
if (destination.type === "home" && destination.project_id === null) return {
|
|
2441
|
+
artifact: {
|
|
2442
|
+
id: artifact.id,
|
|
2443
|
+
url: typeof artifact.url === "string" ? artifact.url : null
|
|
2444
|
+
},
|
|
2445
|
+
destination: {
|
|
2446
|
+
type: "home",
|
|
2447
|
+
project_id: null
|
|
2448
|
+
},
|
|
2449
|
+
share: {
|
|
2450
|
+
visibility: share.visibility,
|
|
2451
|
+
project_audience_may_change: share.project_audience_may_change
|
|
2452
|
+
}
|
|
2453
|
+
};
|
|
2454
|
+
return null;
|
|
2455
|
+
}
|
|
2456
|
+
//#endregion
|
|
2382
2457
|
//#region src/command-runners/profiles.ts
|
|
2383
2458
|
async function readStdinToken() {
|
|
2384
2459
|
if (process.stdin.isTTY === true) return "";
|
|
@@ -2495,6 +2570,36 @@ async function runProjectsList(parsed, mode) {
|
|
|
2495
2570
|
}, mode);
|
|
2496
2571
|
if (!mode.json && projects.length === 0) writeText("No projects yet. Create one on the web, then publish with --project-id.\n");
|
|
2497
2572
|
}
|
|
2573
|
+
async function runProjectsCreate(parsed, mode) {
|
|
2574
|
+
const command = "projects create";
|
|
2575
|
+
const name = parsed.positionals[0]?.trim();
|
|
2576
|
+
if (!name) return writeFailure(command, validationError("Project name is required.", "Pass a project name: projects create <name>."), mode, 1);
|
|
2577
|
+
const visibility = parsed.options.visibility;
|
|
2578
|
+
if (visibility !== void 0 && visibility !== "workspace" && visibility !== "private") return writeFailure(command, validationError("--visibility must be workspace or private.", "Retry with --visibility workspace or --visibility private."), mode, 1);
|
|
2579
|
+
const projectConfig = await resolveProjectConfig();
|
|
2580
|
+
const credential = await resolveCredential(parsed.options, projectConfig);
|
|
2581
|
+
if (!credential.ok) return writeFailure(command, credential.error, mode, 1);
|
|
2582
|
+
const request = await requestConfig(parsed.options);
|
|
2583
|
+
if (request.error) return writeFailure(command, request.error, mode, 1);
|
|
2584
|
+
const result = await apiPost("/api/cli/projects", credential.token, {
|
|
2585
|
+
name,
|
|
2586
|
+
description: parsed.options.description ?? null,
|
|
2587
|
+
base_visibility: visibility ?? null
|
|
2588
|
+
}, parsed.options, request.init);
|
|
2589
|
+
if (result.error) return writeFailure(command, result.error, mode, 1);
|
|
2590
|
+
const project = isRecord(result.body?.project) ? result.body.project : null;
|
|
2591
|
+
const id = configString(project?.id);
|
|
2592
|
+
if (!id) return writeFailure(command, serviceError("Project create succeeded but no project id was returned."), mode, 1);
|
|
2593
|
+
writeSuccess(command, {
|
|
2594
|
+
project: {
|
|
2595
|
+
id,
|
|
2596
|
+
name: configString(project?.name),
|
|
2597
|
+
description: configString(project?.description),
|
|
2598
|
+
base_visibility: configString(project?.base_visibility)
|
|
2599
|
+
},
|
|
2600
|
+
next_command: `npx --yes @artifactshare/cli publish <path> --project-id ${id} --json`
|
|
2601
|
+
}, mode);
|
|
2602
|
+
}
|
|
2498
2603
|
//#endregion
|
|
2499
2604
|
//#region src/command-runners/publish.ts
|
|
2500
2605
|
const MAX_PUBLISH_KEY_LENGTH = 128;
|
|
@@ -2989,6 +3094,10 @@ async function downloadRunner(ctx) {
|
|
|
2989
3094
|
const parsed = parsedArgsFromContext("download", ctx);
|
|
2990
3095
|
return await runDownload(parsed, outputMode(parsed.options));
|
|
2991
3096
|
}
|
|
3097
|
+
async function moveRunner(ctx) {
|
|
3098
|
+
const parsed = parsedArgsFromContext("move", ctx);
|
|
3099
|
+
return await runMove(parsed, outputMode(parsed.options));
|
|
3100
|
+
}
|
|
2992
3101
|
async function artifactsGetRunner(ctx) {
|
|
2993
3102
|
const parsed = parsedArgsFromContext("artifacts get", ctx);
|
|
2994
3103
|
return await runArtifactsGet(parsed, outputMode(parsed.options));
|
|
@@ -3026,6 +3135,10 @@ async function projectsListRunner(ctx) {
|
|
|
3026
3135
|
const parsed = parsedArgsFromContext("projects list", ctx);
|
|
3027
3136
|
return await runProjectsList(parsed, outputMode(parsed.options));
|
|
3028
3137
|
}
|
|
3138
|
+
async function projectsCreateRunner(ctx) {
|
|
3139
|
+
const parsed = parsedArgsFromContext("projects create", ctx);
|
|
3140
|
+
return await runProjectsCreate(parsed, outputMode(parsed.options));
|
|
3141
|
+
}
|
|
3029
3142
|
async function initRunner(ctx) {
|
|
3030
3143
|
const parsed = parsedArgsFromContext("init", ctx);
|
|
3031
3144
|
return await runInit(parsed, outputMode(parsed.options));
|
|
@@ -3101,6 +3214,7 @@ async function runGunshi(argv) {
|
|
|
3101
3214
|
update: lazyCommand(updateDefinition, updateRunner),
|
|
3102
3215
|
resolve: lazyCommand(resolveDefinition, resolveRunner),
|
|
3103
3216
|
download: lazyCommand(downloadDefinition, downloadRunner),
|
|
3217
|
+
move: lazyCommand(moveDefinition, moveRunner),
|
|
3104
3218
|
artifacts: artifactsDefinition,
|
|
3105
3219
|
comments: commentsDefinition,
|
|
3106
3220
|
"request-access": lazyCommand(requestAccessDefinition, requestAccessRunner),
|
|
@@ -3159,6 +3273,8 @@ const entryCommand = define({
|
|
|
3159
3273
|
examples: `npx --yes @artifactshare/cli publish <path> --project-id <id> --json
|
|
3160
3274
|
npx --yes @artifactshare/cli update <artifact-id-or-url> <path> --json
|
|
3161
3275
|
npx --yes @artifactshare/cli resolve <url-id-or-title> --json
|
|
3276
|
+
npx --yes @artifactshare/cli projects create "Launch review" --json
|
|
3277
|
+
npx --yes @artifactshare/cli move <artifact-id-or-url> --project-id <id> --json
|
|
3162
3278
|
npx --yes @artifactshare/cli artifacts get <artifact-id-or-url> --json
|
|
3163
3279
|
npx --yes @artifactshare/cli comments list <artifact-id-or-url> --json
|
|
3164
3280
|
npx --yes @artifactshare/cli comments post <artifact-id-or-url> --body "<text>" --json
|
|
@@ -3182,6 +3298,7 @@ Authentication:
|
|
|
3182
3298
|
Common failures:
|
|
3183
3299
|
auth_required Use ${TOKEN_ENV_VAR} or ${TOKEN_OPTION}; tokens are issued at ${DEFAULT_BASE_URL}/settings/tokens
|
|
3184
3300
|
destination_required Add --project-id, configure .artifactshare/config.json, or pass --home
|
|
3301
|
+
invalid_destination Choose --project-id <id> or --home
|
|
3185
3302
|
target_not_found Use an artifact ID, share URL, or sandbox URL
|
|
3186
3303
|
upload_not_allowed Upload access is limited; run request-access to join the waitlist`,
|
|
3187
3304
|
run: () => {}
|
|
@@ -3225,7 +3342,7 @@ const publishDefinition = define({
|
|
|
3225
3342
|
home: {
|
|
3226
3343
|
type: "boolean",
|
|
3227
3344
|
toKebab: true,
|
|
3228
|
-
description: "Publish
|
|
3345
|
+
description: "Publish to home instead of a project"
|
|
3229
3346
|
},
|
|
3230
3347
|
visibility: {
|
|
3231
3348
|
type: "string",
|
|
@@ -3339,6 +3456,41 @@ Common failures:
|
|
|
3339
3456
|
output_exists Choose another --output path or pass --force
|
|
3340
3457
|
validation_failed Check --output and downloaded file paths`
|
|
3341
3458
|
});
|
|
3459
|
+
const moveDefinition = define({
|
|
3460
|
+
name: "move",
|
|
3461
|
+
description: "Move an artifact into a project or back home.",
|
|
3462
|
+
toKebab: true,
|
|
3463
|
+
args: {
|
|
3464
|
+
...commonArgs,
|
|
3465
|
+
artifactIdOrUrl: {
|
|
3466
|
+
type: "positional",
|
|
3467
|
+
toKebab: true,
|
|
3468
|
+
description: "Artifact ID or /a/<id> share URL"
|
|
3469
|
+
},
|
|
3470
|
+
projectId: {
|
|
3471
|
+
type: "string",
|
|
3472
|
+
toKebab: true,
|
|
3473
|
+
description: "Move into this project"
|
|
3474
|
+
},
|
|
3475
|
+
home: {
|
|
3476
|
+
type: "boolean",
|
|
3477
|
+
toKebab: true,
|
|
3478
|
+
description: "Move back to the owner home area"
|
|
3479
|
+
}
|
|
3480
|
+
},
|
|
3481
|
+
examples: `npx --yes @artifactshare/cli move abc123def4 --project-id prj123 --json
|
|
3482
|
+
npx --yes @artifactshare/cli move https://artifactshare.com/a/abc123def4 --home --json
|
|
3483
|
+
|
|
3484
|
+
Move changes the artifact destination. It does not add grants. Project visibility
|
|
3485
|
+
artifacts may change audience when moved between projects; the JSON response
|
|
3486
|
+
reports project_audience_may_change.
|
|
3487
|
+
|
|
3488
|
+
Common failures:
|
|
3489
|
+
auth_required Set ARTIFACTSHARE_TOKEN before move
|
|
3490
|
+
target_not_found Retry with an artifact ID or share URL
|
|
3491
|
+
destination_conflict Choose either --project-id or --home
|
|
3492
|
+
invalid_destination Use an active project id from projects list, or --home`
|
|
3493
|
+
});
|
|
3342
3494
|
const artifactsDefinition = define({
|
|
3343
3495
|
name: "artifacts",
|
|
3344
3496
|
description: "Read Artifact Share artifacts.",
|
|
@@ -3531,22 +3683,58 @@ npx --yes @artifactshare/cli profiles use client-a --json
|
|
|
3531
3683
|
printf '%s' "$TOKEN" | npx --yes @artifactshare/cli profiles import-token --profile client-a --json`,
|
|
3532
3684
|
run: parentCommandRunner("profiles")
|
|
3533
3685
|
});
|
|
3534
|
-
const
|
|
3535
|
-
name: "
|
|
3536
|
-
description: "
|
|
3686
|
+
const projectsListDefinition = define({
|
|
3687
|
+
name: "list",
|
|
3688
|
+
description: "List projects you can publish into.",
|
|
3537
3689
|
toKebab: true,
|
|
3538
3690
|
args: commonArgs,
|
|
3539
|
-
|
|
3540
|
-
name: "list",
|
|
3541
|
-
description: "List projects you can publish into.",
|
|
3542
|
-
toKebab: true,
|
|
3543
|
-
args: commonArgs,
|
|
3544
|
-
examples: `npx --yes @artifactshare/cli projects list --json
|
|
3691
|
+
examples: `npx --yes @artifactshare/cli projects list --json
|
|
3545
3692
|
|
|
3546
3693
|
is_default marks the working-directory default project from .artifactshare/config.json.
|
|
3547
3694
|
Use a project id with publish --project-id or init --project-id.`
|
|
3548
|
-
|
|
3549
|
-
|
|
3695
|
+
});
|
|
3696
|
+
const projectsCreateDefinition = define({
|
|
3697
|
+
name: "create",
|
|
3698
|
+
description: "Create a project you can publish into.",
|
|
3699
|
+
toKebab: true,
|
|
3700
|
+
args: {
|
|
3701
|
+
...commonArgs,
|
|
3702
|
+
name: {
|
|
3703
|
+
type: "positional",
|
|
3704
|
+
description: "Project name"
|
|
3705
|
+
},
|
|
3706
|
+
description: {
|
|
3707
|
+
type: "string",
|
|
3708
|
+
toKebab: true,
|
|
3709
|
+
description: "Project description"
|
|
3710
|
+
},
|
|
3711
|
+
visibility: {
|
|
3712
|
+
type: "string",
|
|
3713
|
+
toKebab: true,
|
|
3714
|
+
description: "workspace or private (default: workspace)"
|
|
3715
|
+
}
|
|
3716
|
+
},
|
|
3717
|
+
examples: `npx --yes @artifactshare/cli projects create "Launch review" --json
|
|
3718
|
+
npx --yes @artifactshare/cli projects create "Client" --description "Weekly reports" --visibility private --json
|
|
3719
|
+
|
|
3720
|
+
The response includes project.id and next_command for publish --project-id.
|
|
3721
|
+
|
|
3722
|
+
Common failures:
|
|
3723
|
+
auth_required Set ARTIFACTSHARE_TOKEN before projects create
|
|
3724
|
+
upload_not_allowed Your account cannot publish yet; request access from an operator
|
|
3725
|
+
validation_failed Pass a non-empty name and valid --visibility`
|
|
3726
|
+
});
|
|
3727
|
+
const projectsDefinition = define({
|
|
3728
|
+
name: "projects",
|
|
3729
|
+
description: "Create and find publish destinations.",
|
|
3730
|
+
toKebab: true,
|
|
3731
|
+
args: commonArgs,
|
|
3732
|
+
subCommands: {
|
|
3733
|
+
list: lazyCommand(projectsListDefinition, projectsListRunner),
|
|
3734
|
+
create: lazyCommand(projectsCreateDefinition, projectsCreateRunner)
|
|
3735
|
+
},
|
|
3736
|
+
examples: `npx --yes @artifactshare/cli projects list --json
|
|
3737
|
+
npx --yes @artifactshare/cli projects create "Launch review" --json`,
|
|
3550
3738
|
run: parentCommandRunner("projects")
|
|
3551
3739
|
});
|
|
3552
3740
|
const skillsToolArgs = {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@artifactshare/cli",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.5",
|
|
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
|
"license": "Apache-2.0",
|
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: artifactshare
|
|
3
|
-
description: Publish, update, and read back shared
|
|
3
|
+
description: Publish, update, and read back shared files with the Artifact Share CLI. Use when the user asks to share an HTML/Markdown report, a static site, or other generated file, or to read back or comment on a shared file.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
<!-- artifactshare-skill
|
|
7
|
-
version:
|
|
7
|
+
version: 7
|
|
8
8
|
managed: true
|
|
9
9
|
-->
|
|
10
10
|
|
|
11
11
|
# Artifact Share CLI
|
|
12
12
|
|
|
13
|
-
Artifact Share hosts shared
|
|
13
|
+
Artifact Share hosts shared files (HTML pages, Markdown documents, static
|
|
14
14
|
sites) with versions and comments. The CLI publishes from the terminal and is
|
|
15
15
|
designed for agents: every command supports `--json` with a stable contract.
|
|
16
16
|
|
|
17
17
|
Run commands with `npx --yes @artifactshare/cli`. When unsure about a
|
|
18
18
|
command or flag, read `npx --yes @artifactshare/cli --help` first.
|
|
19
19
|
|
|
20
|
-
Use the CLI whenever the
|
|
20
|
+
Use the CLI whenever the file already exists locally as a file or folder.
|
|
21
21
|
The remote MCP tools accept HTML or Markdown source strings; they cannot read
|
|
22
22
|
paths like `/Users/.../report.html` from the user's filesystem.
|
|
23
23
|
|
|
@@ -43,14 +43,23 @@ paths like `/Users/.../report.html` from the user's filesystem.
|
|
|
43
43
|
## Choosing the destination
|
|
44
44
|
|
|
45
45
|
1. `projects list --json` shows the projects this account can publish into; `is_default` marks the working-directory default.
|
|
46
|
-
2. `
|
|
47
|
-
3. `
|
|
46
|
+
2. `projects create <name> --json` creates a project and returns `project.id` plus a `next_command` using `publish --project-id <id>`.
|
|
47
|
+
3. `init --project-id <id> --json` saves a default project for the working directory.
|
|
48
|
+
4. `publish` resolves the destination from `--project-id`, then the saved default, then `--home` (the home destination for files not placed in a project). Without any of these it fails with `destination_required`.
|
|
49
|
+
5. `move <artifact-id-or-url> --project-id <id> --json` moves an existing file into a project; `move <artifact-id-or-url> --home --json` moves it back home.
|
|
50
|
+
|
|
51
|
+
`move` does not add grants. For `project` visibility artifacts, moving between
|
|
52
|
+
projects may change the live project audience; the response reports
|
|
53
|
+
`share.project_audience_may_change`. Moving a `project` visibility artifact
|
|
54
|
+
home makes it `private`, because home has no project audience.
|
|
48
55
|
|
|
49
56
|
## Core commands
|
|
50
57
|
|
|
51
58
|
```bash
|
|
52
59
|
npx --yes @artifactshare/cli publish ./report.html --json
|
|
53
60
|
npx --yes @artifactshare/cli publish ./site-dir --project-id <id> --json
|
|
61
|
+
npx --yes @artifactshare/cli projects create "Client reports" --json
|
|
62
|
+
npx --yes @artifactshare/cli move <artifact-id-or-url> --project-id <id> --json
|
|
54
63
|
npx --yes @artifactshare/cli update <artifact-id-or-url> ./report.html --json
|
|
55
64
|
npx --yes @artifactshare/cli artifacts get <artifact-id-or-url> --json
|
|
56
65
|
npx --yes @artifactshare/cli download <artifact-id-or-url> --output ./out --json
|
|
@@ -59,7 +68,7 @@ npx --yes @artifactshare/cli comments post <artifact-id-or-url> --body "<text>"
|
|
|
59
68
|
```
|
|
60
69
|
|
|
61
70
|
- `publish` accepts a single `.html` / `.md` file or a static-site directory. The returned `share_url` is the link to give the user.
|
|
62
|
-
- `update` adds a new version to an existing
|
|
71
|
+
- `update` adds a new version to an existing file; pass the same kind of input (single file vs directory) it was created with.
|
|
63
72
|
- When the user gives a title, project name, or URL instead of an ID, run `resolve <value> --json` first and use the returned ID.
|
|
64
73
|
- `artifacts get` reads back single-file sources (use `--offset` to continue truncated reads); `download` saves static-site bundles.
|
|
65
74
|
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
---
|
|
2
|
-
description: Use the Artifact Share CLI to publish, update, and read back shared
|
|
2
|
+
description: Use the Artifact Share CLI to publish, update, and read back shared files.
|
|
3
3
|
alwaysApply: false
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
<!-- artifactshare-skill
|
|
7
|
-
version:
|
|
7
|
+
version: 7
|
|
8
8
|
managed: true
|
|
9
9
|
-->
|
|
10
10
|
|
|
11
11
|
# Artifact Share CLI
|
|
12
12
|
|
|
13
|
-
Artifact Share hosts shared
|
|
13
|
+
Artifact Share hosts shared files (HTML pages, Markdown documents, static
|
|
14
14
|
sites) with versions and comments. Use `npx --yes @artifactshare/cli` to
|
|
15
15
|
publish from the terminal, and read
|
|
16
16
|
`npx --yes @artifactshare/cli --help` before choosing a command.
|
|
@@ -23,7 +23,8 @@ from the user's filesystem.
|
|
|
23
23
|
- In agents, CI, or scripts, 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`.
|
|
24
24
|
- 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`. Add `--allow-plaintext-token-store` only on a trusted machine without a native token store.
|
|
25
25
|
- Use `login --profile <name>` only in an interactive terminal where the user can approve the browser device flow.
|
|
26
|
-
- Pick the destination with `projects list --json`, `init --project-id <id>`, or `--project-id`.
|
|
26
|
+
- Pick the destination with `projects list --json`, `projects create <name> --json`, `init --project-id <id>`, or `--project-id`.
|
|
27
|
+
- Move existing files with `move <artifact-id-or-url> --project-id <id> --json` or `move <artifact-id-or-url> --home --json`. `move` does not add grants; for `project` visibility files, moving between projects may change the project audience, and moving home makes the file `private`.
|
|
27
28
|
- Publish with `publish <path> --json`; add a version with `update <artifact-id-or-url> <path> --json`.
|
|
28
29
|
- Resolve titles, project names, and URLs to IDs with `resolve <value> --json` before writing.
|
|
29
30
|
- Read back with `artifacts get` / `download`; comment with `comments list` / `comments post`.
|