@abruncloud/cli 0.1.0 → 0.1.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 +133 -184
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,261 +1,210 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Abrun CLI
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Command line tools for managing Abrun projects, apps, deployments, databases, and tokens.
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
The CLI is flow-first.
|
|
8
|
-
|
|
9
|
-
There is no separate command action layer. A command is an ordered onion stack:
|
|
10
|
-
|
|
11
|
-
```text
|
|
12
|
-
input -> resolve auth -> resolve user -> resolve project -> resolve resource -> perform operation -> render output
|
|
5
|
+
```sh
|
|
6
|
+
npm install -g @abruncloud/cli
|
|
13
7
|
```
|
|
14
8
|
|
|
15
|
-
|
|
9
|
+
After installation, the `abrun` command is available globally:
|
|
16
10
|
|
|
17
|
-
```
|
|
18
|
-
abrun
|
|
19
|
-
=> [withState, login]
|
|
20
|
-
|
|
21
|
-
abrun app create <name>
|
|
22
|
-
=> [withState, withSelectedAuth, withProject, createApp, printCreatedApp]
|
|
23
|
-
|
|
24
|
-
abrun app domain add <app> <hostname>
|
|
25
|
-
=> [withState, withSelectedAuth, withProject, withApp, addDomain, printDomain]
|
|
11
|
+
```sh
|
|
12
|
+
abrun --help
|
|
26
13
|
```
|
|
27
14
|
|
|
28
|
-
|
|
29
|
-
Terminal onions use verbs like `createApp`, `restartApp`, `verifyDomain`, or `printCreatedApp`.
|
|
30
|
-
The runtime API client is also an onion now, so flows explicitly add `withClient` where they need an authenticated or project-scoped client instance.
|
|
31
|
-
|
|
32
|
-
## SDK
|
|
33
|
-
|
|
34
|
-
The /api SDK is generated from `docs/openapi.yaml` into `apps/sdk/src/api-client`.
|
|
15
|
+
## Login
|
|
35
16
|
|
|
36
|
-
|
|
17
|
+
Start with browser-based login:
|
|
37
18
|
|
|
38
|
-
```
|
|
39
|
-
|
|
19
|
+
```sh
|
|
20
|
+
abrun login
|
|
40
21
|
```
|
|
41
22
|
|
|
42
|
-
|
|
23
|
+
You can also use an API token for automation:
|
|
43
24
|
|
|
44
|
-
```
|
|
45
|
-
|
|
25
|
+
```sh
|
|
26
|
+
ABRUN_TOKEN=abrn_... abrun apps
|
|
46
27
|
```
|
|
47
28
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
## Current Commands
|
|
29
|
+
Useful auth commands:
|
|
51
30
|
|
|
52
|
-
```
|
|
53
|
-
abrun login
|
|
54
|
-
abrun logout
|
|
31
|
+
```sh
|
|
55
32
|
abrun whoami
|
|
56
|
-
|
|
33
|
+
abrun logout
|
|
57
34
|
abrun auth list
|
|
58
35
|
abrun auth use <auth>
|
|
59
36
|
abrun auth remove <auth>
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
## Projects
|
|
60
40
|
|
|
41
|
+
Select the project you want commands to use by default:
|
|
42
|
+
|
|
43
|
+
```sh
|
|
61
44
|
abrun project list
|
|
62
45
|
abrun project use <project>
|
|
63
46
|
abrun project current
|
|
47
|
+
```
|
|
64
48
|
|
|
65
|
-
|
|
66
|
-
|
|
49
|
+
You can override the selected project per command:
|
|
50
|
+
|
|
51
|
+
```sh
|
|
52
|
+
abrun --project <project> apps
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
## Apps
|
|
56
|
+
|
|
57
|
+
Create and manage applications:
|
|
58
|
+
|
|
59
|
+
```sh
|
|
67
60
|
abrun app create <name>
|
|
68
|
-
abrun
|
|
69
|
-
abrun app
|
|
61
|
+
abrun apps
|
|
62
|
+
abrun app inspect <app>
|
|
70
63
|
abrun app start <app>
|
|
71
64
|
abrun app stop <app>
|
|
72
65
|
abrun app restart <app>
|
|
73
|
-
abrun app
|
|
74
|
-
abrun app logs <app> [--follow]
|
|
66
|
+
abrun app logs <app> --follow
|
|
75
67
|
abrun app shell <app>
|
|
76
|
-
abrun app
|
|
77
|
-
abrun deploy <app> [path]
|
|
78
|
-
|
|
79
|
-
abrun app disk list <app>
|
|
80
|
-
abrun app disk inspect <app> <disk>
|
|
81
|
-
abrun app disk create <app> <name> --size <gb>
|
|
82
|
-
abrun app disk mount <app> <disk> <mountPath>
|
|
83
|
-
abrun app disk unmount <app> <disk>
|
|
84
|
-
abrun app disk expand <app> <disk> --size <gb>
|
|
85
|
-
abrun app disk delete <app> <disk>
|
|
86
|
-
|
|
87
|
-
abrun app env list <app>
|
|
88
|
-
abrun app env set <app> KEY=VALUE
|
|
89
|
-
abrun app env unset <app> KEY
|
|
90
|
-
|
|
91
|
-
abrun app domain list <app>
|
|
92
|
-
abrun app domain add <app> <hostname>
|
|
93
|
-
abrun app domain delete <app> <hostname>
|
|
94
|
-
abrun app domain verify <app> <hostname>
|
|
95
|
-
abrun app domain check <app> <hostname>
|
|
96
|
-
|
|
97
|
-
abrun app deployment list <app>
|
|
98
|
-
abrun app deployment inspect <app> <deployment>
|
|
99
|
-
abrun app deployment logs <app> <deployment>
|
|
100
|
-
abrun app deployment watch <app> <deployment>
|
|
101
|
-
abrun app deployment cancel <app> <deployment>
|
|
102
|
-
abrun app deployment redo <app> <deployment>
|
|
103
|
-
|
|
104
|
-
abrun db list
|
|
105
|
-
abrun db inspect <database>
|
|
106
|
-
abrun db create <name>
|
|
107
|
-
abrun db update <database>
|
|
108
|
-
abrun db delete <database>
|
|
109
|
-
abrun db start <database>
|
|
110
|
-
abrun db stop <database>
|
|
111
|
-
abrun db logs <database> [--follow]
|
|
112
|
-
abrun db tunnel <database> --port <port> [--host <host>]
|
|
113
|
-
abrun db credentials <database> --show-password
|
|
114
|
-
abrun db backup list <database>
|
|
115
|
-
abrun db backup create <database>
|
|
68
|
+
abrun app delete <app>
|
|
116
69
|
```
|
|
117
70
|
|
|
118
|
-
|
|
71
|
+
Deploy source from the current directory:
|
|
119
72
|
|
|
120
|
-
```
|
|
121
|
-
|
|
122
|
-
--auth <auth>
|
|
123
|
-
--project <project>
|
|
124
|
-
--json
|
|
73
|
+
```sh
|
|
74
|
+
abrun deploy <app>
|
|
125
75
|
```
|
|
126
76
|
|
|
127
|
-
|
|
77
|
+
Deploy source from another path:
|
|
128
78
|
|
|
129
|
-
```
|
|
130
|
-
|
|
79
|
+
```sh
|
|
80
|
+
abrun deploy <app> ./path/to/source
|
|
131
81
|
```
|
|
132
82
|
|
|
133
|
-
|
|
83
|
+
Deploy an existing image:
|
|
134
84
|
|
|
135
|
-
```
|
|
136
|
-
|
|
85
|
+
```sh
|
|
86
|
+
abrun deploy <app> --image registry.example.com/app:latest
|
|
137
87
|
```
|
|
138
88
|
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
Email/password login is still available when `--email` or `--password` is provided, and uses `POST /api/auth/login`.
|
|
89
|
+
Common deploy flags:
|
|
142
90
|
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
91
|
+
```sh
|
|
92
|
+
abrun deploy <app> --port 3000
|
|
93
|
+
abrun deploy <app> --message "Release checkout fixes"
|
|
94
|
+
abrun deploy <app> --logs
|
|
147
95
|
```
|
|
148
96
|
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
## Deploy Flow
|
|
152
|
-
|
|
153
|
-
`abrun app deploy <app> [path]` performs a local source sync before creating the deployment:
|
|
154
|
-
|
|
155
|
-
1. scans the selected source directory recursively
|
|
156
|
-
2. respects nested `.gitignore` and `.abrunignore` files
|
|
157
|
-
3. always excludes a hard denylist such as `.git`, `.abrun`, `node_modules`, common cache folders, and `.env*`
|
|
158
|
-
4. sends the current file manifest to `POST /api/apps/{appID}/deploy`
|
|
159
|
-
5. if the server returns `sync_required`, prints the requested file count
|
|
160
|
-
6. creates a tar archive with only the required changed files
|
|
161
|
-
7. uploads that archive through `POST /api/apps/{appID}/upload`
|
|
162
|
-
8. retries `POST /api/apps/{appID}/deploy` with the same file manifest
|
|
163
|
-
9. polls rollout status, prints build/deployment logs, then exits when the rollout reaches a terminal state
|
|
97
|
+
Deployment commands:
|
|
164
98
|
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
99
|
+
```sh
|
|
100
|
+
abrun app deployment list <app>
|
|
101
|
+
abrun app deployment inspect <app> <deployment>
|
|
102
|
+
abrun app deployment logs <app> <deployment>
|
|
103
|
+
abrun app deployment watch <app> <deployment>
|
|
104
|
+
abrun app deployment cancel <app> <deployment>
|
|
105
|
+
abrun app deployment redo <app> <deployment>
|
|
172
106
|
```
|
|
173
107
|
|
|
174
|
-
|
|
108
|
+
## App Settings
|
|
175
109
|
|
|
176
|
-
|
|
110
|
+
Environment variables:
|
|
177
111
|
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
GET /api/databases/{databaseID}/logs
|
|
112
|
+
```sh
|
|
113
|
+
abrun app env list <app>
|
|
114
|
+
abrun app env set <app> KEY=VALUE
|
|
115
|
+
abrun app env unset <app> KEY
|
|
183
116
|
```
|
|
184
117
|
|
|
185
|
-
|
|
118
|
+
Domains:
|
|
186
119
|
|
|
187
|
-
|
|
120
|
+
```sh
|
|
121
|
+
abrun app domain list <app>
|
|
122
|
+
abrun app domain add <app> <hostname>
|
|
123
|
+
abrun app domain verify <app> <hostname>
|
|
124
|
+
abrun app domain check <app> <hostname>
|
|
125
|
+
abrun app domain delete <app> <hostname>
|
|
126
|
+
```
|
|
188
127
|
|
|
189
|
-
|
|
128
|
+
Disks:
|
|
190
129
|
|
|
191
|
-
|
|
130
|
+
```sh
|
|
131
|
+
abrun app disk list <app>
|
|
132
|
+
abrun app disk create <app> <name> --size <gb>
|
|
133
|
+
abrun app disk mount <app> <disk> <mountPath>
|
|
134
|
+
abrun app disk unmount <app> <disk>
|
|
135
|
+
abrun app disk expand <app> <disk> --size <gb>
|
|
136
|
+
abrun app disk delete <app> <disk>
|
|
137
|
+
```
|
|
192
138
|
|
|
193
|
-
|
|
194
|
-
- `source`: build from managed source, then release the produced image
|
|
139
|
+
## Databases
|
|
195
140
|
|
|
196
|
-
|
|
141
|
+
Create and manage databases:
|
|
197
142
|
|
|
198
|
-
|
|
143
|
+
```sh
|
|
144
|
+
abrun db create <name>
|
|
145
|
+
abrun dbs
|
|
146
|
+
abrun db inspect <database>
|
|
147
|
+
abrun db start <database>
|
|
148
|
+
abrun db stop <database>
|
|
149
|
+
abrun db logs <database> --follow
|
|
150
|
+
abrun db credentials <database> --show-password
|
|
151
|
+
abrun db delete <database>
|
|
152
|
+
```
|
|
199
153
|
|
|
200
|
-
|
|
154
|
+
Open a local TCP tunnel to a database:
|
|
201
155
|
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
156
|
+
```sh
|
|
157
|
+
abrun db tunnel <database> --port 5432
|
|
158
|
+
```
|
|
205
159
|
|
|
206
|
-
|
|
160
|
+
Backups:
|
|
207
161
|
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
162
|
+
```sh
|
|
163
|
+
abrun db backup list <database>
|
|
164
|
+
abrun db backup create <database>
|
|
165
|
+
```
|
|
211
166
|
|
|
212
|
-
##
|
|
167
|
+
## Tokens
|
|
213
168
|
|
|
214
|
-
|
|
169
|
+
Manage personal access tokens:
|
|
215
170
|
|
|
216
|
-
```
|
|
217
|
-
|
|
171
|
+
```sh
|
|
172
|
+
abrun token list
|
|
173
|
+
abrun token create <name>
|
|
174
|
+
abrun token delete <token>
|
|
218
175
|
```
|
|
219
176
|
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
## Binary Plan
|
|
177
|
+
## Output And Flags
|
|
223
178
|
|
|
224
|
-
|
|
179
|
+
Global flags:
|
|
225
180
|
|
|
226
|
-
```
|
|
227
|
-
abrun
|
|
228
|
-
abrun
|
|
229
|
-
abrun
|
|
230
|
-
abrun
|
|
231
|
-
|
|
181
|
+
```sh
|
|
182
|
+
abrun --endpoint <url> <command>
|
|
183
|
+
abrun --auth <auth> <command>
|
|
184
|
+
abrun --project <project> <command>
|
|
185
|
+
abrun --token <token> <command>
|
|
186
|
+
abrun --json <command>
|
|
187
|
+
abrun -o json <command>
|
|
188
|
+
abrun -o yaml <command>
|
|
232
189
|
```
|
|
233
190
|
|
|
234
|
-
|
|
191
|
+
Saved CLI context lives at:
|
|
235
192
|
|
|
236
193
|
```text
|
|
237
|
-
abrun
|
|
238
|
-
abrun upgrade --check
|
|
239
|
-
abrun upgrade
|
|
194
|
+
~/.abrun/config.yaml
|
|
240
195
|
```
|
|
241
196
|
|
|
242
|
-
|
|
197
|
+
## Help
|
|
243
198
|
|
|
244
|
-
|
|
245
|
-
2. fetch release manifest
|
|
246
|
-
3. compare versions
|
|
247
|
-
4. download the matching artifact to a temp file
|
|
248
|
-
5. verify checksum
|
|
249
|
-
6. atomically replace the current binary
|
|
250
|
-
7. keep one backup for rollback on failure
|
|
199
|
+
Every command has built-in help:
|
|
251
200
|
|
|
252
|
-
|
|
201
|
+
```sh
|
|
202
|
+
abrun --help
|
|
203
|
+
abrun app --help
|
|
204
|
+
abrun deploy --help
|
|
205
|
+
abrun db --help
|
|
206
|
+
```
|
|
253
207
|
|
|
254
|
-
##
|
|
208
|
+
## Package
|
|
255
209
|
|
|
256
|
-
|
|
257
|
-
bun install
|
|
258
|
-
cd ../.. && bun run generate:sdk
|
|
259
|
-
bun run check
|
|
260
|
-
bun run build
|
|
261
|
-
```
|
|
210
|
+
This package publishes the built Node.js runtime for the `abrun` command. TypeScript source, tests, source maps, and development configuration are not included in the npm tarball.
|