@akshatowo/artifacts 0.0.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/README.md +156 -0
- package/dist/index.js +32851 -0
- package/package.json +34 -0
package/README.md
ADDED
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
# Artifacts CLI
|
|
2
|
+
|
|
3
|
+
Command-line tools for uploading, listing, and opening Artifacts.
|
|
4
|
+
|
|
5
|
+
## Requirements
|
|
6
|
+
|
|
7
|
+
The npm package ships a Bun-targeted executable script. Install Bun before using
|
|
8
|
+
the CLI:
|
|
9
|
+
|
|
10
|
+
```sh
|
|
11
|
+
curl -fsSL https://bun.sh/install | bash
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
## Installation
|
|
15
|
+
|
|
16
|
+
Install the CLI globally with npm:
|
|
17
|
+
|
|
18
|
+
```sh
|
|
19
|
+
npm i -g @akshatowo/artifacts
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
Then verify the command is available:
|
|
23
|
+
|
|
24
|
+
```sh
|
|
25
|
+
artifacts --help
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## Authentication
|
|
29
|
+
|
|
30
|
+
Sign in with the device-code flow:
|
|
31
|
+
|
|
32
|
+
```sh
|
|
33
|
+
artifacts auth login
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
The CLI prints a verification URL and a one-time code. Open the URL, sign in,
|
|
37
|
+
enter the code, and wait for the CLI to finish.
|
|
38
|
+
|
|
39
|
+
Check the current signed-in user:
|
|
40
|
+
|
|
41
|
+
```sh
|
|
42
|
+
artifacts auth whoami
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
Sign out:
|
|
46
|
+
|
|
47
|
+
```sh
|
|
48
|
+
artifacts auth logout
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
Authentication is stored locally in:
|
|
52
|
+
|
|
53
|
+
- macOS/Linux: `~/.config/artifacts/auth.json`
|
|
54
|
+
- Windows: `%APPDATA%\artifacts\auth.json`
|
|
55
|
+
|
|
56
|
+
## Upload An Artifact
|
|
57
|
+
|
|
58
|
+
Upload an HTML artifact:
|
|
59
|
+
|
|
60
|
+
```sh
|
|
61
|
+
artifacts upload ./path/to/artifact.html
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
On success, the CLI prints the public artifact URL.
|
|
65
|
+
|
|
66
|
+
If you omit the path, the CLI prompts for a file:
|
|
67
|
+
|
|
68
|
+
```sh
|
|
69
|
+
artifacts upload
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
## List Artifacts
|
|
73
|
+
|
|
74
|
+
List artifacts owned by the signed-in user:
|
|
75
|
+
|
|
76
|
+
```sh
|
|
77
|
+
artifacts ls
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
The output includes the artifact ID, name, creation time, and update time.
|
|
81
|
+
|
|
82
|
+
## Get An Artifact URL
|
|
83
|
+
|
|
84
|
+
Print the URL for an artifact by ID:
|
|
85
|
+
|
|
86
|
+
```sh
|
|
87
|
+
artifacts get <artifact-id>
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
Example:
|
|
91
|
+
|
|
92
|
+
```sh
|
|
93
|
+
artifacts get 0192f2c2-8f0e-7000-9c41-68aaf2f4fd21
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
## Configuration
|
|
97
|
+
|
|
98
|
+
By default, production builds use:
|
|
99
|
+
|
|
100
|
+
```txt
|
|
101
|
+
https://artifacts.4kshat.dev
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
Override the API base URL with `BASE_URL`:
|
|
105
|
+
|
|
106
|
+
```sh
|
|
107
|
+
BASE_URL=http://localhost:3000 artifacts ls
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
The auth device client ID defaults to `artifacts-cli`. Override it with
|
|
111
|
+
`AUTH_CLIENT_ID`:
|
|
112
|
+
|
|
113
|
+
```sh
|
|
114
|
+
AUTH_CLIENT_ID=my-client artifacts auth login
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
## Development
|
|
118
|
+
|
|
119
|
+
Build the distributable CLI:
|
|
120
|
+
|
|
121
|
+
```sh
|
|
122
|
+
bun run build
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
Run type checking:
|
|
126
|
+
|
|
127
|
+
```sh
|
|
128
|
+
bun run check-types
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
Test the built binary locally:
|
|
132
|
+
|
|
133
|
+
```sh
|
|
134
|
+
./dist/index.js --help
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
Preview the npm package contents:
|
|
138
|
+
|
|
139
|
+
```sh
|
|
140
|
+
npm pack --dry-run
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
## Publishing
|
|
144
|
+
|
|
145
|
+
Before publishing, build and type-check:
|
|
146
|
+
|
|
147
|
+
```sh
|
|
148
|
+
bun run build
|
|
149
|
+
bun run check-types
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
Publish from this package directory:
|
|
153
|
+
|
|
154
|
+
```sh
|
|
155
|
+
npm publish
|
|
156
|
+
```
|