@artifactshare/cli 0.8.4 → 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +7 -0
- package/README.md +1 -1
- package/dist/index.js +250 -2
- package/package.json +1 -1
- package/skills/artifactshare/SKILL.md +20 -2
- package/skills/artifactshare/artifactshare.mdc +3 -2
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,13 @@
|
|
|
3
3
|
All notable changes to `@artifactshare/cli` are documented here.
|
|
4
4
|
For user-facing announcements, see https://artifactshare.com/updates?product=cli.
|
|
5
5
|
|
|
6
|
+
## 0.9.0 - 2026-08-05
|
|
7
|
+
|
|
8
|
+
- `artifacts list --project-id` now lists every artifact you can view in the project, including other members' uploads, with `owner_email`; continue past 50 items with `--cursor`.
|
|
9
|
+
- Add `download --project-id <id> --output <dir>` to save a whole project locally, one directory per artifact plus an `index.json` summary.
|
|
10
|
+
- Re-running the project download against the same output directory is an incremental sync: unchanged versions are skipped and reported as `unchanged`.
|
|
11
|
+
- Add `share --no-slack-notify` to skip the Slack channel announcement for a single post when the destination project has notifications configured.
|
|
12
|
+
|
|
6
13
|
## 0.8.4 - 2026-07-27
|
|
7
14
|
|
|
8
15
|
- Route capable coding agents to the CLI even when MCP is available; use remote MCP for chat and temporary sandboxes with uncertain CLI network access.
|
package/README.md
CHANGED
|
@@ -83,7 +83,7 @@ npx --yes @artifactshare/cli share ./report.html --visibility private --json
|
|
|
83
83
|
npx --yes @artifactshare/cli config get home_audience --scope effective --json
|
|
84
84
|
```
|
|
85
85
|
|
|
86
|
-
Use `--scope repository` only for a policy agreed by all repository participants, and pass `--visibility private|workspace|link` for a one-time home override. For link sharing, pass exactly one of `--link-expires-at <RFC3339 UTC>` or `--no-link-expiry`; omit both to use the workspace default. For project creation, pass `projects create <name> --visibility private|workspace`; persistent project defaults are documented in `projects create --help`.
|
|
86
|
+
Use `--scope repository` only for a policy agreed by all repository participants, and pass `--visibility private|workspace|link` for a one-time home override. For link sharing, pass exactly one of `--link-expires-at <RFC3339 UTC>` or `--no-link-expiry`; omit both to use the workspace default. For project creation, pass `projects create <name> --visibility private|workspace`; persistent project defaults are documented in `projects create --help`. Pass `--no-slack-notify` to suppress the project Slack notification for one post.
|
|
87
87
|
|
|
88
88
|
Link sharing is available on Plus and Team. A workspace policy may allow a finite expiry from 1 to 365 days or no expiration; the initial default is 30 days and the initial maximum is 90 days. Share and edit results include the confirmed `link_expires_at` UTC timestamp or `null`. If a link command fails, use `link_sharing_plan_required` to explain the plan limit, `link_sharing_disabled` to ask a Team owner or admin to enable the workspace setting, or `link_expiry_invalid` to correct the timestamp or choose `--no-link-expiry` when allowed. Follow `error.recovery` instead of retrying unchanged input.
|
|
89
89
|
|
package/dist/index.js
CHANGED
|
@@ -43,6 +43,7 @@ const VALUE_FLAGS = /* @__PURE__ */ new Set([
|
|
|
43
43
|
"agent",
|
|
44
44
|
"base-url",
|
|
45
45
|
"body",
|
|
46
|
+
"cursor",
|
|
46
47
|
"description",
|
|
47
48
|
"grant-email",
|
|
48
49
|
"include",
|
|
@@ -1101,6 +1102,7 @@ function humanSuccess(command, data) {
|
|
|
1101
1102
|
if (command === "doctor") return doctorHumanOutput(data);
|
|
1102
1103
|
if (command === "open") return openHumanOutput(data);
|
|
1103
1104
|
if (command === "init") return initHumanOutput(data);
|
|
1105
|
+
if (command === "artifacts list" && isRecord(data) && data.has_more === true && typeof data.next_cursor === "string") return `${JSON.stringify(data, null, 2)}\nContinue with --cursor ${data.next_cursor}\n`;
|
|
1104
1106
|
if (command === "changelog") return changelogHumanOutput(data);
|
|
1105
1107
|
const output = `${JSON.stringify(data, null, 2)}\n`;
|
|
1106
1108
|
return suffix ? `${output}${suffix}` : output;
|
|
@@ -1214,7 +1216,7 @@ function artifactsListSuccessFields(data) {
|
|
|
1214
1216
|
if (!isRecord(data)) return false;
|
|
1215
1217
|
return Array.isArray(data.artifacts) && data.artifacts.every((item) => {
|
|
1216
1218
|
if (!isRecord(item)) return false;
|
|
1217
|
-
return typeof item.id === "string" && typeof item.title === "string" && typeof item.share_url === "string" && typeof item.visibility === "string" && (item.link_expires_at === void 0 || typeof item.link_expires_at === "string" || item.link_expires_at === null) && typeof item.updated_at === "string" && (typeof item.project_id === "string" || item.project_id === null);
|
|
1219
|
+
return typeof item.id === "string" && typeof item.title === "string" && typeof item.share_url === "string" && typeof item.visibility === "string" && (item.link_expires_at === void 0 || typeof item.link_expires_at === "string" || item.link_expires_at === null) && typeof item.updated_at === "string" && (typeof item.project_id === "string" || item.project_id === null) && (item.owner_email === void 0 || typeof item.owner_email === "string") && (item.artifact_kind === void 0 || typeof item.artifact_kind === "string");
|
|
1218
1220
|
}) && typeof data.limit === "number" && typeof data.has_more === "boolean" && (typeof data.next_cursor === "string" || data.next_cursor === null);
|
|
1219
1221
|
}
|
|
1220
1222
|
function deleteSuccessFields(data) {
|
|
@@ -1223,7 +1225,7 @@ function deleteSuccessFields(data) {
|
|
|
1223
1225
|
}
|
|
1224
1226
|
function downloadManifestFields(data) {
|
|
1225
1227
|
if (!isRecord(data)) return false;
|
|
1226
|
-
return typeof data.id === "string" && typeof data.share_url === "string" && typeof data.version_id === "string" && typeof data.artifact_kind === "string" && Array.isArray(data.files) && data.files.every(downloadManifestFileFields) && typeof data.total_size_bytes === "number";
|
|
1228
|
+
return typeof data.id === "string" && typeof data.share_url === "string" && typeof data.version_id === "string" && typeof data.artifact_kind === "string" && Array.isArray(data.files) && data.files.every(downloadManifestFileFields) && typeof data.total_size_bytes === "number" && (data.project_id === void 0 || typeof data.project_id === "string" || data.project_id === null);
|
|
1227
1229
|
}
|
|
1228
1230
|
function downloadManifestFileFields(data) {
|
|
1229
1231
|
if (!isRecord(data)) return false;
|
|
@@ -2736,6 +2738,7 @@ async function runArtifactsList(parsed, mode) {
|
|
|
2736
2738
|
if (home) url.searchParams.set("project_id", "");
|
|
2737
2739
|
else if (projectId) url.searchParams.set("project_id", projectId);
|
|
2738
2740
|
if (query) url.searchParams.set("query", query);
|
|
2741
|
+
if (parsed.options.cursor?.trim()) url.searchParams.set("cursor", parsed.options.cursor.trim());
|
|
2739
2742
|
const result = await runAuthenticatedApi(credential, parsed.options, async (current) => {
|
|
2740
2743
|
const response = await cliFetch(url, {
|
|
2741
2744
|
headers: { Authorization: `Bearer ${current.token}` },
|
|
@@ -3862,8 +3865,29 @@ function artifactKindForFile(path) {
|
|
|
3862
3865
|
}
|
|
3863
3866
|
//#endregion
|
|
3864
3867
|
//#region src/command-runners/download.ts
|
|
3868
|
+
async function readPreviousVersions(output) {
|
|
3869
|
+
try {
|
|
3870
|
+
const parsed = JSON.parse(await readFile(join(output, "index.json"), "utf8"));
|
|
3871
|
+
if (!Array.isArray(parsed.artifacts)) return /* @__PURE__ */ new Map();
|
|
3872
|
+
const previous = /* @__PURE__ */ new Map();
|
|
3873
|
+
for (const entry of parsed.artifacts) {
|
|
3874
|
+
if (entry === null || typeof entry !== "object") return /* @__PURE__ */ new Map();
|
|
3875
|
+
const { id, version_id } = entry;
|
|
3876
|
+
if (typeof id !== "string") return /* @__PURE__ */ new Map();
|
|
3877
|
+
if (typeof version_id === "string") previous.set(id, version_id);
|
|
3878
|
+
}
|
|
3879
|
+
return previous;
|
|
3880
|
+
} catch {
|
|
3881
|
+
return /* @__PURE__ */ new Map();
|
|
3882
|
+
}
|
|
3883
|
+
}
|
|
3865
3884
|
async function runDownload(parsed, mode, isRetry = false) {
|
|
3866
3885
|
const command = "download";
|
|
3886
|
+
const projectId = parsed.options.projectId?.trim();
|
|
3887
|
+
if (projectId !== void 0 || parsed.positionals.length === 0) {
|
|
3888
|
+
if (!projectId || parsed.positionals.length > 0 || !parsed.options.output?.trim()) return writeFailure(command, validationError("Invalid project download arguments.", "Use download <target> or download --project-id <id> --output <dir>."), mode, 1);
|
|
3889
|
+
return runProjectDownload(parsed, mode, projectId, isRetry);
|
|
3890
|
+
}
|
|
3867
3891
|
const target = parseArtifactTarget(parsed.positionals[0], "download", "Pass an artifact ID or share URL to download.");
|
|
3868
3892
|
if (target.error) return writeFailure(command, target.error, mode, 1);
|
|
3869
3893
|
const artifactId = target.artifactId;
|
|
@@ -3945,6 +3969,210 @@ async function runDownload(parsed, mode, isRetry = false) {
|
|
|
3945
3969
|
}
|
|
3946
3970
|
}, mode);
|
|
3947
3971
|
}
|
|
3972
|
+
async function runProjectDownload(parsed, mode, projectId, isRetry = false) {
|
|
3973
|
+
const command = "download";
|
|
3974
|
+
const resolved = await resolveCredential(parsed.options, await resolveProjectConfig());
|
|
3975
|
+
if (!resolved.ok) return handleCredentialFailure(command, resolved, parsed.options, mode, () => runDownload(parsed, mode, true), isRetry);
|
|
3976
|
+
const request = await requestConfig(parsed.options);
|
|
3977
|
+
if (request.error) return writeFailure(command, request.error, mode, 1);
|
|
3978
|
+
const baseUrl = baseUrlOf(parsed.options);
|
|
3979
|
+
let credential = resolved;
|
|
3980
|
+
let refreshAttempted = false;
|
|
3981
|
+
const authFetch = async (url) => {
|
|
3982
|
+
const response = await cliFetch(url, {
|
|
3983
|
+
headers: { Authorization: `Bearer ${credential.token}` },
|
|
3984
|
+
...request.init
|
|
3985
|
+
});
|
|
3986
|
+
if ("networkError" in response || response.status !== 401) return response;
|
|
3987
|
+
if (refreshAttempted) return response;
|
|
3988
|
+
refreshAttempted = true;
|
|
3989
|
+
const body = await readJson(response.clone());
|
|
3990
|
+
const refreshed = await refreshAuthenticatedCredential(mapApiError(response.status, body, {
|
|
3991
|
+
authenticated: true,
|
|
3992
|
+
baseUrl,
|
|
3993
|
+
artifactTarget: true,
|
|
3994
|
+
credentialSource: credential.source,
|
|
3995
|
+
profile: credential.profile,
|
|
3996
|
+
profileCredentialKind: credential.profileCredentialKind
|
|
3997
|
+
}), credential, parsed.options, isRetry);
|
|
3998
|
+
if (!refreshed.ok) return response;
|
|
3999
|
+
credential = {
|
|
4000
|
+
...credential,
|
|
4001
|
+
...refreshed.credential,
|
|
4002
|
+
ok: true
|
|
4003
|
+
};
|
|
4004
|
+
return await cliFetch(url, {
|
|
4005
|
+
headers: { Authorization: `Bearer ${credential.token}` },
|
|
4006
|
+
...request.init
|
|
4007
|
+
});
|
|
4008
|
+
};
|
|
4009
|
+
const output = parsed.options.output.trim();
|
|
4010
|
+
const list = async (cursor) => {
|
|
4011
|
+
const url = apiUrl("/api/cli/artifacts", baseUrl);
|
|
4012
|
+
url.searchParams.set("project_id", projectId);
|
|
4013
|
+
if (cursor) url.searchParams.set("cursor", cursor);
|
|
4014
|
+
const response = await authFetch(url);
|
|
4015
|
+
if ("networkError" in response) return { error: networkError(response.networkError) };
|
|
4016
|
+
const body = await readJson(response);
|
|
4017
|
+
if (!response.ok) return {
|
|
4018
|
+
error: mapApiError(response.status, body, {
|
|
4019
|
+
authenticated: true,
|
|
4020
|
+
baseUrl,
|
|
4021
|
+
artifactTarget: true,
|
|
4022
|
+
credentialSource: credential.source,
|
|
4023
|
+
profile: credential.profile,
|
|
4024
|
+
profileCredentialKind: credential.profileCredentialKind
|
|
4025
|
+
}),
|
|
4026
|
+
authFailure: response.status === 401
|
|
4027
|
+
};
|
|
4028
|
+
if (!body || !Array.isArray(body.artifacts) || typeof body.has_more !== "boolean") return { error: serviceError("Artifact list response was invalid.") };
|
|
4029
|
+
return { data: body };
|
|
4030
|
+
};
|
|
4031
|
+
const entries = [];
|
|
4032
|
+
let cursor;
|
|
4033
|
+
let first = true;
|
|
4034
|
+
let listError;
|
|
4035
|
+
do {
|
|
4036
|
+
const page = await list(cursor);
|
|
4037
|
+
if (page.error) {
|
|
4038
|
+
if (first && page.authFailure) return handleCredentialFailure(command, {
|
|
4039
|
+
ok: false,
|
|
4040
|
+
source: credential.source,
|
|
4041
|
+
...credential.profile ? { profile: credential.profile } : {},
|
|
4042
|
+
error: page.error
|
|
4043
|
+
}, parsed.options, mode, () => runDownload(parsed, mode, true), isRetry);
|
|
4044
|
+
listError = page.error;
|
|
4045
|
+
break;
|
|
4046
|
+
}
|
|
4047
|
+
entries.push(...page.data.artifacts);
|
|
4048
|
+
first = false;
|
|
4049
|
+
cursor = page.data.has_more && page.data.next_cursor ? page.data.next_cursor : void 0;
|
|
4050
|
+
} while (cursor);
|
|
4051
|
+
if (listError && first) return writeFailure(command, listError, mode, 1);
|
|
4052
|
+
if ((await lstat(output).catch(() => null))?.isSymbolicLink()) return writeFailure(command, validationError("Output path must not be a symbolic link.", "Choose a regular directory path and retry."), mode, 1);
|
|
4053
|
+
const previousVersions = await readPreviousVersions(output);
|
|
4054
|
+
await mkdir(output, { recursive: true });
|
|
4055
|
+
const results = entries.map((item) => ({
|
|
4056
|
+
id: String(item.id),
|
|
4057
|
+
title: String(item.title ?? ""),
|
|
4058
|
+
...typeof item.owner_email === "string" ? { owner_email: item.owner_email } : {},
|
|
4059
|
+
updated_at: String(item.updated_at ?? ""),
|
|
4060
|
+
share_url: String(item.share_url ?? ""),
|
|
4061
|
+
status: "failed",
|
|
4062
|
+
reason: listError ? "list interrupted" : "download failed"
|
|
4063
|
+
}));
|
|
4064
|
+
if (!listError) for (let i = 0; i < entries.length; i++) {
|
|
4065
|
+
const item = entries[i];
|
|
4066
|
+
const result = results[i];
|
|
4067
|
+
if (item.artifact_kind === "spa" || item.artifact_kind === "workspace_app") {
|
|
4068
|
+
result.status = "skipped";
|
|
4069
|
+
result.reason = "unsupported-kind";
|
|
4070
|
+
continue;
|
|
4071
|
+
}
|
|
4072
|
+
const root = join(output, result.id);
|
|
4073
|
+
const rootStat = await lstat(root).catch(() => null);
|
|
4074
|
+
const rootExists = rootStat !== null;
|
|
4075
|
+
const response = await authFetch(apiUrl(`/api/cli/artifacts/${encodeURIComponent(result.id)}/download`, baseUrl));
|
|
4076
|
+
if ("networkError" in response) {
|
|
4077
|
+
result.reason = "network failed";
|
|
4078
|
+
continue;
|
|
4079
|
+
}
|
|
4080
|
+
if (!response.ok) {
|
|
4081
|
+
const body = await readJson(response);
|
|
4082
|
+
if (mapApiError(response.status, body, {
|
|
4083
|
+
authenticated: true,
|
|
4084
|
+
baseUrl,
|
|
4085
|
+
artifactTarget: true
|
|
4086
|
+
}).code === "unsupported_kind") {
|
|
4087
|
+
result.status = "skipped";
|
|
4088
|
+
result.reason = "unsupported-kind";
|
|
4089
|
+
} else result.reason = `download failed (${response.status})`;
|
|
4090
|
+
continue;
|
|
4091
|
+
}
|
|
4092
|
+
const body = await readJson(response);
|
|
4093
|
+
if (!downloadManifestFields(body)) {
|
|
4094
|
+
result.reason = "invalid download manifest";
|
|
4095
|
+
continue;
|
|
4096
|
+
}
|
|
4097
|
+
if (!parsed.options.force && rootStat?.isDirectory() && previousVersions.get(result.id) === body.version_id) {
|
|
4098
|
+
result.status = "unchanged";
|
|
4099
|
+
result.version_id = body.version_id;
|
|
4100
|
+
result.path = root;
|
|
4101
|
+
delete result.reason;
|
|
4102
|
+
continue;
|
|
4103
|
+
}
|
|
4104
|
+
if (rootExists && !parsed.options.force) {
|
|
4105
|
+
result.reason = "artifact output already exists";
|
|
4106
|
+
continue;
|
|
4107
|
+
}
|
|
4108
|
+
const plan = await prepareDownloadPlan(body, root, Boolean(parsed.options.force));
|
|
4109
|
+
if (plan.error) {
|
|
4110
|
+
result.reason = plan.error.message;
|
|
4111
|
+
continue;
|
|
4112
|
+
}
|
|
4113
|
+
try {
|
|
4114
|
+
for (const file of plan.value.files) {
|
|
4115
|
+
const fileResponse = await authFetch(downloadFileUrl(baseUrl, result.id, file.path));
|
|
4116
|
+
if ("networkError" in fileResponse) throw new Error("network failed");
|
|
4117
|
+
if (!fileResponse.ok) throw new Error(`file download failed (${fileResponse.status})`);
|
|
4118
|
+
const bytes = Buffer.from(await fileResponse.arrayBuffer());
|
|
4119
|
+
const verified = verifyDownloadedBytes(file, bytes);
|
|
4120
|
+
if (verified.error) throw new Error(verified.error.message);
|
|
4121
|
+
await mkdir(dirname(file.targetPath), { recursive: true });
|
|
4122
|
+
await writeFile(file.targetPath, bytes);
|
|
4123
|
+
}
|
|
4124
|
+
let backupRoot = null;
|
|
4125
|
+
try {
|
|
4126
|
+
if (plan.value.replaceExisting) {
|
|
4127
|
+
backupRoot = backupPathFor(plan.value.root);
|
|
4128
|
+
await rename(plan.value.root, backupRoot);
|
|
4129
|
+
}
|
|
4130
|
+
await rename(plan.value.tempRoot, plan.value.root);
|
|
4131
|
+
} catch (error) {
|
|
4132
|
+
if (backupRoot && !await pathExists(plan.value.root) && await pathExists(backupRoot)) await rename(backupRoot, plan.value.root).catch(() => {});
|
|
4133
|
+
throw error;
|
|
4134
|
+
}
|
|
4135
|
+
if (backupRoot) await rm(backupRoot, {
|
|
4136
|
+
recursive: true,
|
|
4137
|
+
force: true
|
|
4138
|
+
}).catch(() => {});
|
|
4139
|
+
result.status = "ok";
|
|
4140
|
+
result.version_id = body.version_id;
|
|
4141
|
+
result.path = root;
|
|
4142
|
+
delete result.reason;
|
|
4143
|
+
} catch (error) {
|
|
4144
|
+
result.reason = error instanceof Error ? error.message : "download failed";
|
|
4145
|
+
await rm(plan.value.tempRoot, {
|
|
4146
|
+
recursive: true,
|
|
4147
|
+
force: true
|
|
4148
|
+
}).catch(() => {});
|
|
4149
|
+
}
|
|
4150
|
+
}
|
|
4151
|
+
try {
|
|
4152
|
+
await writeFile(join(output, "index.json"), JSON.stringify({
|
|
4153
|
+
project_id: projectId,
|
|
4154
|
+
artifacts: results
|
|
4155
|
+
}, null, 2) + "\n");
|
|
4156
|
+
} catch (error) {
|
|
4157
|
+
return writeFailure(command, downloadFileSystemError(error), mode, 1);
|
|
4158
|
+
}
|
|
4159
|
+
const counts = {
|
|
4160
|
+
ok: results.filter((r) => r.status === "ok").length,
|
|
4161
|
+
unchanged: results.filter((r) => r.status === "unchanged").length,
|
|
4162
|
+
skipped: results.filter((r) => r.status === "skipped").length,
|
|
4163
|
+
failed: results.filter((r) => r.status === "failed").length
|
|
4164
|
+
};
|
|
4165
|
+
process.exitCode = counts.failed > 0 ? 1 : 0;
|
|
4166
|
+
return writeSuccess(command, {
|
|
4167
|
+
project_id: projectId,
|
|
4168
|
+
...counts,
|
|
4169
|
+
failures: results.filter((r) => r.status === "failed").map((r) => ({
|
|
4170
|
+
id: r.id,
|
|
4171
|
+
reason: r.reason
|
|
4172
|
+
})),
|
|
4173
|
+
artifacts: results
|
|
4174
|
+
}, mode);
|
|
4175
|
+
}
|
|
3948
4176
|
//#endregion
|
|
3949
4177
|
//#region src/command-runners/edit.ts
|
|
3950
4178
|
async function runEdit(parsed, mode) {
|
|
@@ -4651,6 +4879,7 @@ async function runShare(parsed, mode, isRetry = false) {
|
|
|
4651
4879
|
if (destination.containerId) initialForm.set("container_id", destination.containerId);
|
|
4652
4880
|
if (parsed.options.linkExpiresAt !== void 0) initialForm.set("link_expires_at", parsed.options.linkExpiresAt);
|
|
4653
4881
|
else if (parsed.options.noLinkExpiry === true) initialForm.set("link_expires_at", "null");
|
|
4882
|
+
if (parsed.options.noSlackNotify === true) initialForm.set("slack_notify", "false");
|
|
4654
4883
|
const uploadUrl = apiUrl("/api/shareables/uploads", baseUrl);
|
|
4655
4884
|
if (shareKey !== null) uploadUrl.searchParams.set("publish_key", shareKey);
|
|
4656
4885
|
const upload = await prepareUploadPayload(targetPath, fileStat, initialForm);
|
|
@@ -5495,6 +5724,11 @@ const shareDefinition = define({
|
|
|
5495
5724
|
toKebab: true,
|
|
5496
5725
|
description: "Set link sharing to unlimited expiry"
|
|
5497
5726
|
},
|
|
5727
|
+
noSlackNotify: {
|
|
5728
|
+
type: "boolean",
|
|
5729
|
+
toKebab: true,
|
|
5730
|
+
description: "Do not notify the project Slack channel for this post"
|
|
5731
|
+
},
|
|
5498
5732
|
grantEmail: {
|
|
5499
5733
|
type: "string",
|
|
5500
5734
|
multiple: true,
|
|
@@ -5519,6 +5753,7 @@ With no destination, share posts to home. Choose the setting by purpose:
|
|
|
5519
5753
|
One-time audience for a single post: pass --visibility private|workspace|link.
|
|
5520
5754
|
Link sharing accepts --link-expires-at <RFC3339 UTC> or --no-link-expiry;
|
|
5521
5755
|
these expiry options are mutually exclusive.
|
|
5756
|
+
Pass --no-slack-notify to suppress the project Slack notification for this post.
|
|
5522
5757
|
Check the resolved audience before posting:
|
|
5523
5758
|
npx --yes @artifactshare/cli config get home_audience --scope effective --json
|
|
5524
5759
|
|
|
@@ -5707,8 +5942,14 @@ const downloadDefinition = define({
|
|
|
5707
5942
|
artifactIdOrUrl: {
|
|
5708
5943
|
type: "positional",
|
|
5709
5944
|
toKebab: true,
|
|
5945
|
+
required: false,
|
|
5710
5946
|
description: "Artifact ID, /a/<id> share URL, or <id>.sandbox.* URL"
|
|
5711
5947
|
},
|
|
5948
|
+
projectId: {
|
|
5949
|
+
type: "string",
|
|
5950
|
+
toKebab: true,
|
|
5951
|
+
description: "Download every visible artifact in this project"
|
|
5952
|
+
},
|
|
5712
5953
|
output: {
|
|
5713
5954
|
type: "string",
|
|
5714
5955
|
toKebab: true,
|
|
@@ -5721,6 +5962,7 @@ const downloadDefinition = define({
|
|
|
5721
5962
|
}
|
|
5722
5963
|
},
|
|
5723
5964
|
examples: `npx --yes @artifactshare/cli download abc123def4 --json
|
|
5965
|
+
npx --yes @artifactshare/cli download --project-id <id> --output ./project-download --json
|
|
5724
5966
|
${agentDownloadCommand("https://artifactshare.com/a/abc123def4")}
|
|
5725
5967
|
|
|
5726
5968
|
Use resolve first when a user gives a title or project name, then pass the id here.
|
|
@@ -5859,11 +6101,17 @@ const artifactsDefinition = define({
|
|
|
5859
6101
|
type: "string",
|
|
5860
6102
|
toKebab: true,
|
|
5861
6103
|
description: "Only artifacts whose title contains this text"
|
|
6104
|
+
},
|
|
6105
|
+
cursor: {
|
|
6106
|
+
type: "string",
|
|
6107
|
+
toKebab: true,
|
|
6108
|
+
description: "Continue listing from the cursor returned by the previous page"
|
|
5862
6109
|
}
|
|
5863
6110
|
},
|
|
5864
6111
|
examples: `npx --yes @artifactshare/cli artifacts list --json
|
|
5865
6112
|
npx --yes @artifactshare/cli artifacts list --project-id <id> --json
|
|
5866
6113
|
npx --yes @artifactshare/cli artifacts list --home --query report --json
|
|
6114
|
+
npx --yes @artifactshare/cli artifacts list --project-id <id> --cursor <token> --json
|
|
5867
6115
|
|
|
5868
6116
|
Use an id from this list with update, edit, move, delete, artifacts get, or comments list.
|
|
5869
6117
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@artifactshare/cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.9.0",
|
|
4
4
|
"description": "Upload and share HTML, Markdown, folders, and static sites from terminals, AI agents, automation, and CI.",
|
|
5
5
|
"homepage": "https://artifactshare.com/connect",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -4,7 +4,7 @@ description: Share, publish, upload, host, update, open, or read back existing f
|
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
<!-- artifactshare-skill
|
|
7
|
-
version:
|
|
7
|
+
version: 33
|
|
8
8
|
managed: true
|
|
9
9
|
-->
|
|
10
10
|
|
|
@@ -52,6 +52,7 @@ contain `$`, spaces, `*`, or `?`; use single quotes such as
|
|
|
52
52
|
| Append to same URL | `append <target> <path> --json` |
|
|
53
53
|
| Read back source | `artifacts get <target> --json` |
|
|
54
54
|
| Download a site bundle | `download <target> --output ./out --json` |
|
|
55
|
+
| Download a whole project | `download --project-id <id> --output ./out --json` |
|
|
55
56
|
| List your artifacts | `artifacts list --json` |
|
|
56
57
|
| Post a comment | `comments post <target> --body '<text>' --json` |
|
|
57
58
|
| Read comments | `comments list <target> --json` |
|
|
@@ -115,6 +116,8 @@ npx --yes @artifactshare/cli share ./site-dir --project-id <id> --json
|
|
|
115
116
|
default visibility.
|
|
116
117
|
- For link sharing, pass exactly one of `--link-expires-at <RFC3339 UTC>` or
|
|
117
118
|
`--no-link-expiry`. Omit both to use the workspace default.
|
|
119
|
+
- Pass `--no-slack-notify` only when the user explicitly does not want the
|
|
120
|
+
project Slack notification for this post.
|
|
118
121
|
- A workspace policy may allow a finite expiry from 1 to 365 days or unlimited
|
|
119
122
|
expiry. The initial default is 30 days and the initial maximum is 90 days.
|
|
120
123
|
`link_expires_at` in the result is the confirmed UTC timestamp or `null`.
|
|
@@ -176,6 +179,7 @@ Use `artifacts get` for single-file sources. Use `download` for static sites.
|
|
|
176
179
|
npx --yes @artifactshare/cli artifacts get <artifact-id-or-url> --json
|
|
177
180
|
npx --yes @artifactshare/cli artifacts get <artifact-id-or-url> --include versions --include comments --json
|
|
178
181
|
npx --yes @artifactshare/cli download <artifact-id-or-url> --output ./out --json
|
|
182
|
+
npx --yes @artifactshare/cli download --project-id <id> --output ./out --json
|
|
179
183
|
```
|
|
180
184
|
|
|
181
185
|
- In the successful JSON response, read the source from `data.content` and the current version from `data.version_id`.
|
|
@@ -185,8 +189,22 @@ npx --yes @artifactshare/cli download <artifact-id-or-url> --output ./out --json
|
|
|
185
189
|
inline comments in one call.
|
|
186
190
|
- `download` saves static-site bundles. Pass `--force` to overwrite an existing
|
|
187
191
|
output directory.
|
|
192
|
+
- To fetch every document in a project (for example to feed a whole project
|
|
193
|
+
into an editor as context), run
|
|
194
|
+
`download --project-id <id> --output <dir> --json`. It saves each artifact
|
|
195
|
+
under `<dir>/<artifactId>/` and writes `<dir>/index.json` mapping ids to
|
|
196
|
+
titles, owners, and statuses. The listing covers all artifacts you can view
|
|
197
|
+
in the project, including ones uploaded by other members; `spa` and
|
|
198
|
+
`workspace_app` artifacts are skipped. Pass `--force` to replace previously
|
|
199
|
+
downloaded artifact directories. A partial failure prints `ok: true` with
|
|
200
|
+
the failure list on stdout and exits 1 — check both `index.json` and the
|
|
201
|
+
exit code. Re-running against the same `<dir>` is an incremental sync:
|
|
202
|
+
artifacts whose version is unchanged are reported as `unchanged` and not
|
|
203
|
+
fetched again.
|
|
188
204
|
- Find artifact IDs with `artifacts list --json`. Filter with `--project-id`,
|
|
189
|
-
`--home`, or `--query <text>`.
|
|
205
|
+
`--home`, or `--query <text>`. With `--project-id`, the list includes other
|
|
206
|
+
members' artifacts you can view (with `owner_email`); when `has_more` is
|
|
207
|
+
true, continue with `--cursor <next_cursor>`.
|
|
190
208
|
- When the user gives a title, project name, or URL instead of an ID, run
|
|
191
209
|
`resolve <value> --json` first and use the returned ID.
|
|
192
210
|
- Run `artifacts get --help` or `download --help` for all flags.
|
|
@@ -4,7 +4,7 @@ alwaysApply: false
|
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
<!-- artifactshare-skill
|
|
7
|
-
version:
|
|
7
|
+
version: 33
|
|
8
8
|
managed: true
|
|
9
9
|
-->
|
|
10
10
|
|
|
@@ -62,7 +62,8 @@ contain `$`, spaces, `*`, or `?`; use single quotes such as
|
|
|
62
62
|
- Read back with `artifacts get <target> --json`. Pass `--include versions` or `--include comments` to fetch history or comments in one call. If truncated, call again with `--offset` set to `next_offset`.
|
|
63
63
|
- In the successful JSON response, read the source from `data.content` and the current version from `data.version_id`. See `artifacts get --help` for the complete contract and continuation example.
|
|
64
64
|
- Download static-site bundles with `download <target> --output ./out --json`. Pass `--force` to overwrite an existing output directory.
|
|
65
|
-
-
|
|
65
|
+
- Fetch every document in a project with `download --project-id <id> --output <dir> --json`. Each artifact lands in `<dir>/<artifactId>/` and `<dir>/index.json` maps ids to titles, owners, and statuses. The listing includes other members' artifacts you can view; `spa` and `workspace_app` artifacts are skipped. Pass `--force` to replace previously downloaded artifact directories. A partial failure prints `ok: true` with the failure list on stdout and exits 1 — check both `index.json` and the exit code. Re-running against the same `<dir>` is an incremental sync: artifacts whose version is unchanged are reported as `unchanged` and not fetched again.
|
|
66
|
+
- Find artifact IDs with `artifacts list --json`; filter with `--project-id <id>`, `--home`, or `--query <text>`. With `--project-id`, the list includes other members' artifacts you can view (with `owner_email`); when `has_more` is true, continue with `--cursor <next_cursor>`. Resolve titles, project names, and URLs to IDs with `resolve <value> --json`.
|
|
66
67
|
- Comment with `comments post <target> --body '<text>' --json`. Reply with `--reply-to <thread-id>`. Anchor to quoted text with `--quote '<text>'`; add `--quote-before`/`--quote-after` to disambiguate. Declare the posting agent with `--agent '<name>'` (e.g. `Claude`); omit for no badge. `comments list` returns an `agent` field on agent-posted messages.
|
|
67
68
|
- Edit, resolve, reopen, and delete comments with `comments edit`, `comments resolve`, `comments reopen`, and `comments delete` using IDs from `comments list`. Comment deletion cannot be undone; omit `--message-id` from `comments delete` only when the user wants the whole thread deleted.
|
|
68
69
|
- Change post-share settings with `edit <target>`: `--title`, `--visibility private|workspace|link`, `--link-expires-at <RFC3339 UTC>`, `--no-link-expiry`, `--grant-email`, `--revoke-email`, `--project-id`, `--home`. The expiry options are mutually exclusive; omit both to preserve an existing link expiry. Moving a `project` visibility file home makes it `private`. `move` remains for placement-only automation; prefer `edit`.
|