@artifactshare/cli 0.8.4 → 0.10.1
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 +15 -0
- package/LICENSE +116 -201
- package/README.md +7 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +250 -2
- package/package.json +3 -3
- package/skills/artifactshare/SKILL.md +20 -2
- package/skills/artifactshare/artifactshare.mdc +3 -2
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,21 @@
|
|
|
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.10.1 - 2026-08-09
|
|
7
|
+
|
|
8
|
+
- Publish the first npm release covered by the Artifact Share source-available license.
|
|
9
|
+
|
|
10
|
+
## 0.10.0 - 2026-08-07
|
|
11
|
+
|
|
12
|
+
- Switch the repository and CLI license to the source-available license. Version 0.10.0 is not published to npm.
|
|
13
|
+
|
|
14
|
+
## 0.9.0 - 2026-08-05
|
|
15
|
+
|
|
16
|
+
- `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`.
|
|
17
|
+
- Add `download --project-id <id> --output <dir>` to save a whole project locally, one directory per artifact plus an `index.json` summary.
|
|
18
|
+
- Re-running the project download against the same output directory is an incremental sync: unchanged versions are skipped and reported as `unchanged`.
|
|
19
|
+
- Add `share --no-slack-notify` to skip the Slack channel announcement for a single post when the destination project has notifications configured.
|
|
20
|
+
|
|
6
21
|
## 0.8.4 - 2026-07-27
|
|
7
22
|
|
|
8
23
|
- 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/LICENSE
CHANGED
|
@@ -1,202 +1,117 @@
|
|
|
1
|
+
# Artifact Share Source-Available License
|
|
1
2
|
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
of the NOTICE file are for informational purposes only and
|
|
118
|
-
do not modify the License. You may add Your own attribution
|
|
119
|
-
notices within Derivative Works that You distribute, alongside
|
|
120
|
-
or as an addendum to the NOTICE text from the Work, provided
|
|
121
|
-
that such additional attribution notices cannot be construed
|
|
122
|
-
as modifying the License.
|
|
123
|
-
|
|
124
|
-
You may add Your own copyright statement to Your modifications and
|
|
125
|
-
may provide additional or different license terms and conditions
|
|
126
|
-
for use, reproduction, or distribution of Your modifications, or
|
|
127
|
-
for any such Derivative Works as a whole, provided Your use,
|
|
128
|
-
reproduction, and distribution of the Work otherwise complies with
|
|
129
|
-
the conditions stated in this License.
|
|
130
|
-
|
|
131
|
-
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
132
|
-
any Contribution intentionally submitted for inclusion in the Work
|
|
133
|
-
by You to the Licensor shall be under the terms and conditions of
|
|
134
|
-
this License, without any additional terms or conditions.
|
|
135
|
-
Notwithstanding the above, nothing herein shall supersede or modify
|
|
136
|
-
the terms of any separate license agreement you may have executed
|
|
137
|
-
with Licensor regarding such Contributions.
|
|
138
|
-
|
|
139
|
-
6. Trademarks. This License does not grant permission to use the trade
|
|
140
|
-
names, trademarks, service marks, or product names of the Licensor,
|
|
141
|
-
except as required for reasonable and customary use in describing the
|
|
142
|
-
origin of the Work and reproducing the content of the NOTICE file.
|
|
143
|
-
|
|
144
|
-
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
145
|
-
agreed to in writing, Licensor provides the Work (and each
|
|
146
|
-
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
147
|
-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
148
|
-
implied, including, without limitation, any warranties or conditions
|
|
149
|
-
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
150
|
-
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
151
|
-
appropriateness of using or redistributing the Work and assume any
|
|
152
|
-
risks associated with Your exercise of permissions under this License.
|
|
153
|
-
|
|
154
|
-
8. Limitation of Liability. In no event and under no legal theory,
|
|
155
|
-
whether in tort (including negligence), contract, or otherwise,
|
|
156
|
-
unless required by applicable law (such as deliberate and grossly
|
|
157
|
-
negligent acts) or agreed to in writing, shall any Contributor be
|
|
158
|
-
liable to You for damages, including any direct, indirect, special,
|
|
159
|
-
incidental, or consequential damages of any character arising as a
|
|
160
|
-
result of this License or out of the use or inability to use the
|
|
161
|
-
Work (including but not limited to damages for loss of goodwill,
|
|
162
|
-
work stoppage, computer failure or malfunction, or any and all
|
|
163
|
-
other commercial damages or losses), even if such Contributor
|
|
164
|
-
has been advised of the possibility of such damages.
|
|
165
|
-
|
|
166
|
-
9. Accepting Warranty or Additional Liability. While redistributing
|
|
167
|
-
the Work or Derivative Works thereof, You may choose to offer,
|
|
168
|
-
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
169
|
-
or other liability obligations and/or rights consistent with this
|
|
170
|
-
License. However, in accepting such obligations, You may act only
|
|
171
|
-
on Your own behalf and on Your sole responsibility, not on behalf
|
|
172
|
-
of any other Contributor, and only if You agree to indemnify,
|
|
173
|
-
defend, and hold each Contributor harmless for any liability
|
|
174
|
-
incurred by, or claims asserted against, such Contributor by reason
|
|
175
|
-
of your accepting any such warranty or additional liability.
|
|
176
|
-
|
|
177
|
-
END OF TERMS AND CONDITIONS
|
|
178
|
-
|
|
179
|
-
APPENDIX: How to apply the Apache License to your work.
|
|
180
|
-
|
|
181
|
-
To apply the Apache License to your work, attach the following
|
|
182
|
-
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
183
|
-
replaced with your own identifying information. (Don't include
|
|
184
|
-
the brackets!) The text should be enclosed in the appropriate
|
|
185
|
-
comment syntax for the file format. We also recommend that a
|
|
186
|
-
file or class name and description of purpose be included on the
|
|
187
|
-
same "printed page" as the copyright notice for easier
|
|
188
|
-
identification within third-party archives.
|
|
189
|
-
|
|
190
|
-
Copyright [yyyy] [name of copyright owner]
|
|
191
|
-
|
|
192
|
-
Licensed under the Apache License, Version 2.0 (the "License");
|
|
193
|
-
you may not use this file except in compliance with the License.
|
|
194
|
-
You may obtain a copy of the License at
|
|
195
|
-
|
|
196
|
-
http://www.apache.org/licenses/LICENSE-2.0
|
|
197
|
-
|
|
198
|
-
Unless required by applicable law or agreed to in writing, software
|
|
199
|
-
distributed under the License is distributed on an "AS IS" BASIS,
|
|
200
|
-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
201
|
-
See the License for the specific language governing permissions and
|
|
202
|
-
limitations under the License.
|
|
3
|
+
Copyright © 2026 TechTalk, Inc.
|
|
4
|
+
|
|
5
|
+
日本語版を正本とし、後半の英語版は参考訳です。
|
|
6
|
+
|
|
7
|
+
## 日本語版(正本)
|
|
8
|
+
|
|
9
|
+
### 1. 定義と適用範囲
|
|
10
|
+
|
|
11
|
+
「本ソフトウェア」とは、このライセンスが添付された Artifact Share のソフトウェアおよび関連文書をいいます。`packages/cli/` 配下の `@artifactshare/cli` を含みます。
|
|
12
|
+
|
|
13
|
+
「ライセンサー」とは TechTalk, Inc. をいいます。「利用者」とは、本ソフトウェアのコピーを取得し、本ライセンスに基づく権利を行使する個人または法人をいいます。
|
|
14
|
+
|
|
15
|
+
### 2. 許諾
|
|
16
|
+
|
|
17
|
+
本ライセンスの条件に従うことを条件として、本ソフトウェアを無償で使用、複製、改変、統合、公開、配布、サブライセンス、および販売し、また、本ソフトウェアを提供された者にこれらを許可する権利を、利用者に付与します。
|
|
18
|
+
|
|
19
|
+
### 3. 表示の保持
|
|
20
|
+
|
|
21
|
+
上記の著作権表示および本ライセンスの全文を、本ソフトウェアのすべてのコピーまたは重要な部分に含めなければなりません。
|
|
22
|
+
|
|
23
|
+
### 4. 競合サービスとしての提供の制限
|
|
24
|
+
|
|
25
|
+
利用者および下流の受領者は、本ソフトウェアの機能そのものを主な価値とし、ライセンサーと直接競合するホスト型、マネージド型、SaaS、またはクラウドサービスとして、本ソフトウェア(改変版や派生版を含みます)を第三者へ提供してはなりません。第2条のサブライセンスまたは販売の許諾は、この制限を回避する権利を与えるものではありません。
|
|
26
|
+
|
|
27
|
+
次の利用は、この条項だけを理由として禁止されません。
|
|
28
|
+
|
|
29
|
+
- 組織が自らの業務のために運用する self-hosting
|
|
30
|
+
- ベンダーが単一の顧客専用環境を導入し、保守すること。ただし、そのベンダーが自ら複数の顧客向けに競合サービスを提供しない場合に限ります
|
|
31
|
+
- Artifact Share の機能そのものが主な価値ではない別の製品またはサービスへの組み込み
|
|
32
|
+
|
|
33
|
+
本条で制限される用途については、`support@artifactshare.com` へ商用ライセンスをお問い合わせください。
|
|
34
|
+
|
|
35
|
+
### 5. 名称および商標
|
|
36
|
+
|
|
37
|
+
本ライセンスは、Artifact Share の名称、ロゴ、サービスマークその他の商標に関する権利を付与しません。出所を事実に即して説明するため、または本ソフトウェアに同梱された未改変のブランド資産を本ソフトウェアとともに再配布するために必要な範囲でのみ、これらを使用できます。公式版、ライセンサーによる承認、提携、または後援があるとの誤認を招く使用はできません。
|
|
38
|
+
|
|
39
|
+
### 6. Proposal および Contribution
|
|
40
|
+
|
|
41
|
+
proposal その他の投稿物の著作権は投稿者に留保されます。投稿者は、ライセンサーおよび本ソフトウェアの maintainer に対し、投稿物を評価、採択、本ソフトウェアへ組み込み、改変、複製、公開、および配布するために必要な、全世界的、非独占的、無償かつサブライセンス可能な許諾を付与します。
|
|
42
|
+
|
|
43
|
+
この条項は、現在 code contribution を募集するものではありません。将来 code contribution を受け付ける場合の許諾条件や contributor agreement は、別途定めます。
|
|
44
|
+
|
|
45
|
+
### 7. 終了
|
|
46
|
+
|
|
47
|
+
利用者が本ライセンスの条件に違反した場合、本ライセンスに基づく権利は終了します。違反を知ってから30日以内に違反をすべて是正した場合、権利は最初の違反について自動的に回復します。回復しない場合や違反が繰り返された場合に権利を回復するには、ライセンサーの書面による承諾が必要です。
|
|
48
|
+
|
|
49
|
+
### 8. 無保証
|
|
50
|
+
|
|
51
|
+
本ソフトウェアは「現状のまま」提供されます。商品性、特定目的への適合性および非侵害についての保証を含め、明示または黙示を問わず、いかなる保証もありません。
|
|
52
|
+
|
|
53
|
+
### 9. 責任の制限
|
|
54
|
+
|
|
55
|
+
適用法令が許す最大限の範囲で、著作者および著作権者は、契約、不法行為その他の原因を問わず、本ソフトウェアまたはその使用その他の取引から生じ、またはこれらに関連する請求、損害その他の責任を負いません。この制限は、適用される強行法規により排除または制限できない責任には適用されません。
|
|
56
|
+
|
|
57
|
+
### 10. 準拠法および管轄
|
|
58
|
+
|
|
59
|
+
本ライセンスは日本法に準拠し、日本法に従って解釈されます。本ライセンスに関する紛争については、東京地方裁判所を第一審の専属的合意管轄裁判所とします。
|
|
60
|
+
|
|
61
|
+
---
|
|
62
|
+
|
|
63
|
+
## English Reference Translation
|
|
64
|
+
|
|
65
|
+
The Japanese version above is authoritative. This English version is provided for reference only.
|
|
66
|
+
|
|
67
|
+
### 1. Definitions and Scope
|
|
68
|
+
|
|
69
|
+
“Software” means the Artifact Share software and associated documentation to which this license is attached, including `@artifactshare/cli` under `packages/cli/`.
|
|
70
|
+
|
|
71
|
+
“Licensor” means TechTalk, Inc. “You” means an individual or legal entity that obtains a copy of the Software and exercises rights under this license.
|
|
72
|
+
|
|
73
|
+
### 2. Permission Grant
|
|
74
|
+
|
|
75
|
+
Subject to the terms of this license, You are granted, free of charge, the rights to use, copy, modify, merge, publish, distribute, sublicense, and sell the Software, and to permit persons to whom the Software is furnished to do the same.
|
|
76
|
+
|
|
77
|
+
### 3. Preservation of Notices
|
|
78
|
+
|
|
79
|
+
The copyright notice above and the complete text of this license must be included in all copies or substantial portions of the Software.
|
|
80
|
+
|
|
81
|
+
### 4. Restriction on Offering a Competing Service
|
|
82
|
+
|
|
83
|
+
You and downstream recipients must not offer the Software, including modified or derivative versions, to third parties as a hosted, managed, Software-as-a-Service, or cloud service that directly competes with the Licensor and whose primary value is the functionality of the Software itself. The permission to sublicense or sell under Section 2 does not grant a right to circumvent this restriction.
|
|
84
|
+
|
|
85
|
+
The following uses are not prohibited solely by this Section:
|
|
86
|
+
|
|
87
|
+
- self-hosting operated by an organization for its own business use;
|
|
88
|
+
- deployment and maintenance by a vendor in an environment dedicated to one customer, provided that the vendor does not itself offer a competing service to multiple customers; and
|
|
89
|
+
- incorporation into another product or service whose primary value is not the functionality of Artifact Share itself.
|
|
90
|
+
|
|
91
|
+
For a commercial license covering a use restricted by this Section, contact `support@artifactshare.com`.
|
|
92
|
+
|
|
93
|
+
### 5. Names and Trademarks
|
|
94
|
+
|
|
95
|
+
This license grants no rights in the Artifact Share name, logos, service marks, or other trademarks. You may use them only as necessary to describe origin accurately or to redistribute unmodified brand assets included with the Software together with the Software. You must not use them in a way that is likely to imply an official version, approval, affiliation, or sponsorship by the Licensor.
|
|
96
|
+
|
|
97
|
+
### 6. Proposals and Contributions
|
|
98
|
+
|
|
99
|
+
Contributors retain copyright in proposals and other submissions. A contributor grants the Licensor and the maintainers of the Software a worldwide, non-exclusive, royalty-free, sublicensable license to evaluate, accept, incorporate into the Software, modify, reproduce, publish, and distribute the submission.
|
|
100
|
+
|
|
101
|
+
This Section is not an invitation for code contributions at this time. If code contributions are accepted in the future, their inbound license terms and any contributor agreement will be stated separately.
|
|
102
|
+
|
|
103
|
+
### 7. Termination
|
|
104
|
+
|
|
105
|
+
Your rights under this license terminate if You violate its terms. If You cure all violations within 30 days after becoming aware of them, Your rights are automatically reinstated for the first violation. Reinstatement after an uncured or repeated violation requires the Licensor's written consent.
|
|
106
|
+
|
|
107
|
+
### 8. Disclaimer of Warranty
|
|
108
|
+
|
|
109
|
+
THE SOFTWARE IS PROVIDED “AS IS,” WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NONINFRINGEMENT.
|
|
110
|
+
|
|
111
|
+
### 9. Limitation of Liability
|
|
112
|
+
|
|
113
|
+
TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, THE AUTHORS AND COPYRIGHT HOLDERS SHALL NOT BE LIABLE FOR ANY CLAIM, DAMAGES, OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT, OR OTHERWISE, ARISING FROM OR RELATED TO THE SOFTWARE OR ITS USE OR OTHER DEALINGS. THIS LIMITATION DOES NOT APPLY TO LIABILITY THAT CANNOT BE EXCLUDED OR LIMITED UNDER MANDATORY APPLICABLE LAW.
|
|
114
|
+
|
|
115
|
+
### 10. Governing Law and Jurisdiction
|
|
116
|
+
|
|
117
|
+
This license is governed by and construed in accordance with the laws of Japan. The Tokyo District Court has exclusive jurisdiction as the court of first instance over disputes relating to this license.
|
package/README.md
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
# Artifact Share CLI
|
|
2
2
|
|
|
3
|
+
Copyright © TechTalk, Inc.
|
|
4
|
+
|
|
3
5
|
The official CLI to open, share, and update files, folders, and static sites on [Artifact Share](https://artifactshare.com) from terminals, AI agents, and automation. Share HTML, Markdown, and exported sites to stable URLs, update existing files, and emit `--json` for scripts and agents.
|
|
4
6
|
|
|
5
7
|
Artifact Share hosts AI-built reports, documents, and static sites so you can share them with teammates and clients. This CLI shares a single file or a whole folder (HTML, Markdown, exported SPAs, images included), updates versions, opens shared URLs for agents, reads content and comments back, and works the same for humans, terminal agents (Claude Code, Codex, Cursor Agent), and automation.
|
|
@@ -83,7 +85,7 @@ npx --yes @artifactshare/cli share ./report.html --visibility private --json
|
|
|
83
85
|
npx --yes @artifactshare/cli config get home_audience --scope effective --json
|
|
84
86
|
```
|
|
85
87
|
|
|
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`.
|
|
88
|
+
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
89
|
|
|
88
90
|
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
91
|
|
|
@@ -124,3 +126,7 @@ Quote paths and free-form text before passing them through a shell. Artifact Sha
|
|
|
124
126
|
- Setup guide for AI tools and terminals: https://artifactshare.com/connect
|
|
125
127
|
- Public updates (Web, CLI, Agent, MCP): https://artifactshare.com/updates
|
|
126
128
|
- Artifact Share: https://artifactshare.com
|
|
129
|
+
|
|
130
|
+
## License
|
|
131
|
+
|
|
132
|
+
The npm package through version 0.9.0 is licensed under the [Apache License 2.0](https://www.apache.org/licenses/LICENSE-2.0). From the repository and version 0.10.0 onward, `@artifactshare/cli` is covered by the [source-available license](LICENSE). Version 0.10.0 is not published to npm.
|
package/dist/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export {}
|
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,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@artifactshare/cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.10.1",
|
|
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
|
-
"license": "
|
|
6
|
+
"license": "SEE LICENSE IN LICENSE",
|
|
7
7
|
"keywords": [
|
|
8
8
|
"artifact-share",
|
|
9
9
|
"cli",
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
35
|
"gunshi": "^0.37.0",
|
|
36
|
-
"undici": "^8.
|
|
36
|
+
"undici": "^8.10.0"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
39
|
"@types/node": "22.20.1",
|
|
@@ -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`.
|