@artifactshare/cli 0.9.0 → 0.10.2
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 +14 -0
- package/LICENSE +116 -201
- package/README.md +8 -2
- package/dist/index.d.ts +1 -1
- package/dist/index.js +40 -9
- package/package.json +8 -3
- package/skills/artifactshare/SKILL.md +5 -4
- package/skills/artifactshare/artifactshare.mdc +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,20 @@
|
|
|
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
|
+
## Unreleased
|
|
7
|
+
|
|
8
|
+
## 0.10.2 - 2026-08-09
|
|
9
|
+
|
|
10
|
+
- Rotate device-login refresh credentials after use and revoke their credential family during `logout`; a failed remote revoke now leaves the local credential intact.
|
|
11
|
+
|
|
12
|
+
## 0.10.1 - 2026-08-09
|
|
13
|
+
|
|
14
|
+
- Publish the first npm release covered by the Artifact Share source-available license.
|
|
15
|
+
|
|
16
|
+
## 0.10.0 - 2026-08-07
|
|
17
|
+
|
|
18
|
+
- Switch the repository and CLI license to the source-available license. Version 0.10.0 is not published to npm.
|
|
19
|
+
|
|
6
20
|
## 0.9.0 - 2026-08-05
|
|
7
21
|
|
|
8
22
|
- `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`.
|
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.
|
|
@@ -43,7 +45,7 @@ runs add versions to the same file.
|
|
|
43
45
|
|
|
44
46
|
- **Interactive**: run `npx --yes @artifactshare/cli login`, or run `share`, `update`, or `download` directly — those commands start sign-in for you when unauthenticated (the CLI prints a link and code to open in your browser). Profiles created by `login` renew expired CLI sessions automatically during normal use.
|
|
45
47
|
- **CI / non-interactive**: issue a token at `https://artifactshare.com/settings/tokens`, then set `ARTIFACTSHARE_TOKEN` (or pass `--token`). Without a token, non-interactive runs fail with `error.code: "auth_required"` instead of hanging.
|
|
46
|
-
- Multiple accounts: keep one local profile per account (`profiles list` / `profiles use <name>`). In non-interactive agents, pipe an issued token into `profiles import-token --profile <name> --json` to create a saved API-token profile without browser login; API-token profiles are not renewed by the CLI. Use `logout --profile <name>` to
|
|
48
|
+
- Multiple accounts: keep one local profile per account (`profiles list` / `profiles use <name>`). In non-interactive agents, pipe an issued token into `profiles import-token --profile <name> --json` to create a saved API-token profile without browser login; API-token profiles are not renewed by the CLI. Use `logout --profile <name>` to revoke a device-login credential before removing it locally while keeping profile metadata, or `profiles delete <name>` to remove the profile entry too. API-token profiles are only removed locally.
|
|
47
49
|
|
|
48
50
|
## Commands
|
|
49
51
|
|
|
@@ -61,7 +63,7 @@ runs add versions to the same file.
|
|
|
61
63
|
| `comments list / post / edit / resolve / reopen / delete <target>` | Read, write, edit, resolve, reopen, and permanently delete comments |
|
|
62
64
|
| `projects list / create / edit` | List, create, and edit project destinations and audience |
|
|
63
65
|
| `move <target>` | Move an existing file into a project or back home; `edit` is preferred for new automation |
|
|
64
|
-
| `login` / `logout` / `whoami` | Sign in,
|
|
66
|
+
| `login` / `logout` / `whoami` | Sign in, revoke a device-login credential before removing it locally, and check who you are |
|
|
65
67
|
| `doctor` | Diagnose auth, destination, network, and upload readiness — tells you the next command to run |
|
|
66
68
|
| `changelog` | Show the installed version, this release's notes, and the public updates page |
|
|
67
69
|
| `profiles list / use / import-token / delete` | Switch between local account profiles, import an issued token from stdin, and delete profile entries |
|
|
@@ -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 version 0.10.0 onward, `@artifactshare/cli` is covered by the [source-available license](LICENSE). Version 0.10.0 was intentionally not published; version 0.10.1 is the first npm release under the new license.
|
package/dist/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export {}
|
package/dist/index.js
CHANGED
|
@@ -3,11 +3,11 @@ import { cli, define, lazy } from "gunshi";
|
|
|
3
3
|
import { spawn } from "node:child_process";
|
|
4
4
|
import { appendFile, chmod, lstat, mkdir, mkdtemp, readFile, readdir, realpath, rename, rm, rmdir, stat, writeFile } from "node:fs/promises";
|
|
5
5
|
import { basename, dirname, join, relative, resolve, sep } from "node:path";
|
|
6
|
+
import { createHash, randomUUID } from "node:crypto";
|
|
6
7
|
import { setTimeout as setTimeout$1 } from "node:timers/promises";
|
|
7
8
|
import { homedir } from "node:os";
|
|
8
9
|
import { createReadStream } from "node:fs";
|
|
9
10
|
import { Blob } from "node:buffer";
|
|
10
|
-
import { createHash } from "node:crypto";
|
|
11
11
|
//#region src/constants.ts
|
|
12
12
|
const DEFAULT_BASE_URL = "https://artifactshare.com";
|
|
13
13
|
const DEVICE_CLIENT_ID = "artifactshare-cli";
|
|
@@ -1790,7 +1790,8 @@ function parseStoredProfileCredential(raw) {
|
|
|
1790
1790
|
kind: "session",
|
|
1791
1791
|
session_token: parsed.session_token,
|
|
1792
1792
|
refresh_token: parsed.refresh_token,
|
|
1793
|
-
...parsed.expires_at !== void 0 ? { expires_at: parsed.expires_at } : {}
|
|
1793
|
+
...parsed.expires_at !== void 0 ? { expires_at: parsed.expires_at } : {},
|
|
1794
|
+
...typeof parsed.pending_rotation_id === "string" && parsed.pending_rotation_id ? { pending_rotation_id: parsed.pending_rotation_id } : {}
|
|
1794
1795
|
};
|
|
1795
1796
|
return {
|
|
1796
1797
|
ok: true,
|
|
@@ -2599,12 +2600,27 @@ async function runAuthenticatedApi(credential, options, request) {
|
|
|
2599
2600
|
return await request(refreshed.credential);
|
|
2600
2601
|
}
|
|
2601
2602
|
async function refreshStoredProfileSession(profile, refreshToken, options) {
|
|
2603
|
+
const stored = await readProfileToken(profile, options);
|
|
2604
|
+
if (!stored.ok || stored.credential.kind !== "session") return { ok: false };
|
|
2605
|
+
const rotationRequestId = stored.credential.pending_rotation_id ?? randomUUID();
|
|
2606
|
+
if (!stored.credential.pending_rotation_id) {
|
|
2607
|
+
if (!(await saveProfileSessionCredential(profile, {
|
|
2608
|
+
...stored.credential,
|
|
2609
|
+
pending_rotation_id: rotationRequestId
|
|
2610
|
+
}, options)).ok) return {
|
|
2611
|
+
ok: false,
|
|
2612
|
+
error: tokenStoreUnavailableError(profile)
|
|
2613
|
+
};
|
|
2614
|
+
}
|
|
2602
2615
|
const request = await requestConfig(options);
|
|
2603
2616
|
if (request.error) return {
|
|
2604
2617
|
ok: false,
|
|
2605
2618
|
error: request.error
|
|
2606
2619
|
};
|
|
2607
|
-
const result = await apiPostPublic("/api/cli/auth/refresh", {
|
|
2620
|
+
const result = await apiPostPublic("/api/cli/auth/refresh", {
|
|
2621
|
+
refresh_token: refreshToken,
|
|
2622
|
+
rotation_request_id: rotationRequestId
|
|
2623
|
+
}, options, request.init);
|
|
2608
2624
|
if (result.error) return {
|
|
2609
2625
|
ok: false,
|
|
2610
2626
|
error: result.error
|
|
@@ -2617,14 +2633,14 @@ async function refreshStoredProfileSession(profile, refreshToken, options) {
|
|
|
2617
2633
|
error: mapApiError(response.status, body, { baseUrl: baseUrlOf(options) })
|
|
2618
2634
|
};
|
|
2619
2635
|
}
|
|
2620
|
-
if (typeof body?.access_token !== "string" || body.access_token.length === 0 || body.token_type?.toLowerCase() !== "bearer" || typeof body.expires_at !== "string") return {
|
|
2636
|
+
if (typeof body?.access_token !== "string" || body.access_token.length === 0 || body.token_type?.toLowerCase() !== "bearer" || typeof body.expires_at !== "string" || typeof body.refresh_token !== "string" || !body.refresh_token || typeof body.refresh_token_expires_at !== "string") return {
|
|
2621
2637
|
ok: false,
|
|
2622
2638
|
error: validationError("Refresh response was invalid.", "Run login again. If this repeats, report the response shape.", "service_error")
|
|
2623
2639
|
};
|
|
2624
2640
|
if (!(await saveProfileSessionCredential(profile, {
|
|
2625
2641
|
kind: "session",
|
|
2626
2642
|
session_token: body.access_token,
|
|
2627
|
-
refresh_token:
|
|
2643
|
+
refresh_token: body.refresh_token,
|
|
2628
2644
|
expires_at: body.expires_at
|
|
2629
2645
|
}, options)).ok) return {
|
|
2630
2646
|
ok: false,
|
|
@@ -4435,11 +4451,17 @@ function configData(config, resolved) {
|
|
|
4435
4451
|
//#endregion
|
|
4436
4452
|
//#region src/command-runners/profile-credentials.ts
|
|
4437
4453
|
async function deleteCredentialForProfileEntry(profile, rawEntry, options) {
|
|
4454
|
+
return await deleteProfileCredential(profile, optionsForProfileEntry(rawEntry, options));
|
|
4455
|
+
}
|
|
4456
|
+
async function readCredentialForProfileEntry(profile, rawEntry, options) {
|
|
4457
|
+
return await readProfileToken(profile, optionsForProfileEntry(rawEntry, options));
|
|
4458
|
+
}
|
|
4459
|
+
function optionsForProfileEntry(rawEntry, options) {
|
|
4438
4460
|
const entry = isRecord(rawEntry) ? rawEntry : {};
|
|
4439
|
-
return
|
|
4461
|
+
return {
|
|
4440
4462
|
...options,
|
|
4441
4463
|
baseUrl: nonEmpty(entry.base_url) ?? "https://artifactshare.com"
|
|
4442
|
-
}
|
|
4464
|
+
};
|
|
4443
4465
|
}
|
|
4444
4466
|
//#endregion
|
|
4445
4467
|
//#region src/command-runners/logout.ts
|
|
@@ -4463,6 +4485,15 @@ async function runLogout(parsed, mode) {
|
|
|
4463
4485
|
profile = defaultProfile;
|
|
4464
4486
|
}
|
|
4465
4487
|
const rawEntry = config.profiles?.[profile];
|
|
4488
|
+
const profileOptions = optionsForProfileEntry(rawEntry, parsed.options);
|
|
4489
|
+
const stored = await readCredentialForProfileEntry(profile, rawEntry, parsed.options);
|
|
4490
|
+
if (stored.ok && stored.credential.kind === "session") {
|
|
4491
|
+
const request = await requestConfig(profileOptions);
|
|
4492
|
+
if (request.error) return writeFailure(command, request.error, mode, 1);
|
|
4493
|
+
const revoked = await apiPostPublic("/api/cli/auth/revoke", { refresh_token: stored.credential.refresh_token }, profileOptions, request.init);
|
|
4494
|
+
if (revoked.error) return writeFailure(command, revoked.error, mode, 1);
|
|
4495
|
+
if (!revoked.response.ok && revoked.response.status !== 401) return writeFailure(command, mapApiError(revoked.response.status, revoked.body, { baseUrl: baseUrlOf(profileOptions) }), mode, 1);
|
|
4496
|
+
}
|
|
4466
4497
|
const deleted = await deleteCredentialForProfileEntry(profile, rawEntry, parsed.options);
|
|
4467
4498
|
if (!deleted.ok) return writeFailure(command, tokenStoreUnavailableError(profile), mode, 1);
|
|
4468
4499
|
return writeSuccess(command, {
|
|
@@ -5670,13 +5701,13 @@ Common failures:
|
|
|
5670
5701
|
});
|
|
5671
5702
|
const logoutDefinition = define({
|
|
5672
5703
|
name: "logout",
|
|
5673
|
-
description: "
|
|
5704
|
+
description: "Revoke and remove the saved credential for a CLI profile.",
|
|
5674
5705
|
toKebab: true,
|
|
5675
5706
|
args: commonArgs,
|
|
5676
5707
|
examples: `npx --yes @artifactshare/cli logout --profile client-a --json
|
|
5677
5708
|
npx --yes @artifactshare/cli logout --json
|
|
5678
5709
|
|
|
5679
|
-
logout
|
|
5710
|
+
logout revokes a device-login refresh credential before removing it locally. API-token profiles are removed locally only. Profile metadata stays in config.json for re-login hints.
|
|
5680
5711
|
When no --profile is passed, the global default profile is used.
|
|
5681
5712
|
|
|
5682
5713
|
Common failures:
|
package/package.json
CHANGED
|
@@ -1,9 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@artifactshare/cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.10.2",
|
|
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
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "git+https://github.com/artifactshare/artifactshare.git",
|
|
9
|
+
"directory": "packages/cli"
|
|
10
|
+
},
|
|
11
|
+
"license": "SEE LICENSE IN LICENSE",
|
|
7
12
|
"keywords": [
|
|
8
13
|
"artifact-share",
|
|
9
14
|
"cli",
|
|
@@ -33,7 +38,7 @@
|
|
|
33
38
|
},
|
|
34
39
|
"dependencies": {
|
|
35
40
|
"gunshi": "^0.37.0",
|
|
36
|
-
"undici": "^8.
|
|
41
|
+
"undici": "^8.10.0"
|
|
37
42
|
},
|
|
38
43
|
"devDependencies": {
|
|
39
44
|
"@types/node": "22.20.1",
|
|
@@ -61,7 +61,7 @@ contain `$`, spaces, `*`, or `?`; use single quotes such as
|
|
|
61
61
|
| Create a project | `projects create 'Name' --json` |
|
|
62
62
|
| Find an ID from a title | `resolve <value> --json` |
|
|
63
63
|
| Open a share URL | `open <url> --json` |
|
|
64
|
-
| Log out
|
|
64
|
+
| Log out | `logout --profile <name> --json` |
|
|
65
65
|
|
|
66
66
|
## Authentication
|
|
67
67
|
|
|
@@ -72,9 +72,10 @@ contain `$`, spaces, `*`, or `?`; use single quotes such as
|
|
|
72
72
|
browser for approval. Use it when a user is present; the pending event on
|
|
73
73
|
stderr includes `browser_open`. Do not pass API tokens to `login`.
|
|
74
74
|
Profiles created by `login` renew expired CLI sessions automatically.
|
|
75
|
-
- `logout --profile <name> --json`
|
|
76
|
-
|
|
77
|
-
|
|
75
|
+
- `logout --profile <name> --json` revokes a device-login refresh credential
|
|
76
|
+
before removing it locally and leaves profile metadata in `config.json`.
|
|
77
|
+
If remote revoke fails, the local credential is kept and logout fails.
|
|
78
|
+
API-token profiles are removed locally only and are not revoked on the server.
|
|
78
79
|
- To keep using an issued token as a named profile without TTY or browser
|
|
79
80
|
login, pipe it on standard input:
|
|
80
81
|
`printf '%s' "$TOKEN" | npx --yes @artifactshare/cli profiles import-token --profile <name> --json`.
|
|
@@ -52,7 +52,7 @@ contain `$`, spaces, `*`, or `?`; use single quotes such as
|
|
|
52
52
|
- 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`.
|
|
53
53
|
- 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`. Imported API-token profiles are not renewed by the CLI. Add `--allow-plaintext-token-store` only on a trusted machine without a native token store.
|
|
54
54
|
- Use `login --profile <name> --json` when a user is present for browser approval. The pending event on stderr includes `browser_open`. Profiles created by `login` renew expired CLI sessions automatically.
|
|
55
|
-
-
|
|
55
|
+
- Use `logout --profile <name> --json` to revoke a device-login credential before removing it locally; this keeps profile metadata. API-token profiles are removed locally only and their server token is not revoked.
|
|
56
56
|
- Switch profiles with `profiles use <name> --json`; list with `profiles list --json`; remove a profile entry and its credential with `profiles delete <name> --json`.
|
|
57
57
|
- When the user gives an Artifact Share URL, start with `open <artifact-id-or-url> --json`. It ensures this rule is installed or updated, then reads single-file artifacts or returns a `download` next command for static sites and multi-file artifacts.
|
|
58
58
|
- Share with `share <path> --json`. In JSON output, give the user `data.artifact.url`; the artifact ID is `data.artifact.id`. Do not rerun `share` just to inspect the JSON shape: without `--key`, each successful run creates a new artifact. Posting to a project delivers to the audience defined by that project. Pick it with `--project-id <id>` or `--project <name>` (by exact name), or use the saved default. With no destination, share posts to home. Choose `home_audience` by purpose: use `config set home_audience private --scope user --json` for a personal safe default in this CLI environment, use `--scope repository` only for a policy agreed by all participants, and use `--visibility private|workspace|link` for one home post. For link sharing, pass exactly one of `--link-expires-at <RFC3339 UTC>` or `--no-link-expiry`; omit both to use the workspace default. Confirm the resolved audience with `config get home_audience --scope effective --json`; `--grant-email` does not change the resolved default.
|