@hideandseeklab/aoox 0.1.0-alpha.8 → 0.1.0-alpha.9
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 +317 -14
- package/dist/commands/deploy.js +6 -1
- package/dist/commands/env/diff.d.ts +18 -0
- package/dist/commands/env/diff.js +46 -0
- package/dist/commands/env/history.d.ts +15 -0
- package/dist/commands/env/history.js +46 -0
- package/dist/commands/env/list.d.ts +31 -0
- package/dist/commands/env/list.js +91 -0
- package/dist/commands/env/promote.d.ts +20 -0
- package/dist/commands/env/promote.js +99 -0
- package/dist/commands/env/pull.d.ts +15 -0
- package/dist/commands/env/pull.js +69 -0
- package/dist/commands/env/push.d.ts +15 -0
- package/dist/commands/env/push.js +81 -0
- package/dist/commands/env/set.d.ts +17 -0
- package/dist/commands/env/set.js +76 -0
- package/dist/commands/env/unset.d.ts +16 -0
- package/dist/commands/env/unset.js +56 -0
- package/dist/commands/registry/build.d.ts +4 -2
- package/dist/commands/registry/build.js +12 -3
- package/dist/commands/registry/push.js +4 -10
- package/dist/commands/run.d.ts +16 -0
- package/dist/commands/run.js +108 -0
- package/dist/commands/update.js +2 -2
- package/dist/lib/connection-summary.d.ts +11 -4
- package/dist/lib/connection-summary.js +46 -11
- package/dist/lib/docker.d.ts +8 -0
- package/dist/lib/docker.js +30 -0
- package/dist/lib/env-command.d.ts +61 -0
- package/dist/lib/env-command.js +156 -0
- package/dist/lib/env-file.d.ts +21 -0
- package/dist/lib/env-file.js +61 -0
- package/dist/lib/env-plan.d.ts +23 -0
- package/dist/lib/env-plan.js +34 -0
- package/dist/lib/env-run.d.ts +24 -0
- package/dist/lib/env-run.js +56 -0
- package/dist/lib/env-text.d.ts +97 -0
- package/dist/lib/env-text.js +262 -0
- package/dist/lib/panel-addresses.d.ts +35 -0
- package/dist/lib/panel-addresses.js +122 -0
- package/dist/lib/registry-image-command.d.ts +5 -1
- package/dist/lib/registry-image-command.js +21 -2
- package/dist/lib/types.d.ts +62 -0
- package/oclif.manifest.json +663 -1
- package/package.json +4 -1
package/README.md
CHANGED
|
@@ -27,7 +27,7 @@ $ npm install -g @hideandseeklab/aoox
|
|
|
27
27
|
$ aoox COMMAND
|
|
28
28
|
running command...
|
|
29
29
|
$ aoox (--version)
|
|
30
|
-
@hideandseeklab/aoox/0.1.0-alpha.
|
|
30
|
+
@hideandseeklab/aoox/0.1.0-alpha.9 linux-x64 node-v24.21.0
|
|
31
31
|
$ aoox --help [COMMAND]
|
|
32
32
|
USAGE
|
|
33
33
|
$ aoox COMMAND
|
|
@@ -85,6 +85,14 @@ npm link # or: npm install -g .
|
|
|
85
85
|
<!-- commands -->
|
|
86
86
|
* [`aoox deploy`](#aoox-deploy)
|
|
87
87
|
* [`aoox domain set`](#aoox-domain-set)
|
|
88
|
+
* [`aoox env diff FROM TO`](#aoox-env-diff-from-to)
|
|
89
|
+
* [`aoox env history`](#aoox-env-history)
|
|
90
|
+
* [`aoox env list`](#aoox-env-list)
|
|
91
|
+
* [`aoox env promote FROM TO`](#aoox-env-promote-from-to)
|
|
92
|
+
* [`aoox env pull`](#aoox-env-pull)
|
|
93
|
+
* [`aoox env push`](#aoox-env-push)
|
|
94
|
+
* [`aoox env set ASSIGNMENTS`](#aoox-env-set-assignments)
|
|
95
|
+
* [`aoox env unset KEYS`](#aoox-env-unset-keys)
|
|
88
96
|
* [`aoox help [COMMAND]`](#aoox-help-command)
|
|
89
97
|
* [`aoox install`](#aoox-install)
|
|
90
98
|
* [`aoox link`](#aoox-link)
|
|
@@ -103,6 +111,7 @@ npm link # or: npm install -g .
|
|
|
103
111
|
* [`aoox registry domain`](#aoox-registry-domain)
|
|
104
112
|
* [`aoox registry push IMAGE`](#aoox-registry-push-image)
|
|
105
113
|
* [`aoox reinstall`](#aoox-reinstall)
|
|
114
|
+
* [`aoox run`](#aoox-run)
|
|
106
115
|
* [`aoox update`](#aoox-update)
|
|
107
116
|
* [`aoox update panel`](#aoox-update-panel)
|
|
108
117
|
* [`aoox whoami`](#aoox-whoami)
|
|
@@ -134,7 +143,7 @@ EXAMPLES
|
|
|
134
143
|
$ aoox deploy --tag v1.2.3
|
|
135
144
|
```
|
|
136
145
|
|
|
137
|
-
_See code: [src/commands/deploy.ts](https://github.com/hideandseeklab/aoox-cli/blob/v0.1.0-alpha.
|
|
146
|
+
_See code: [src/commands/deploy.ts](https://github.com/hideandseeklab/aoox-cli/blob/v0.1.0-alpha.9/src/commands/deploy.ts)_
|
|
138
147
|
|
|
139
148
|
## `aoox domain set`
|
|
140
149
|
|
|
@@ -161,7 +170,267 @@ EXAMPLES
|
|
|
161
170
|
$ aoox domain set --web panel.example.com --api api.example.com --acme-email you@example.com
|
|
162
171
|
```
|
|
163
172
|
|
|
164
|
-
_See code: [src/commands/domain/set.ts](https://github.com/hideandseeklab/aoox-cli/blob/v0.1.0-alpha.
|
|
173
|
+
_See code: [src/commands/domain/set.ts](https://github.com/hideandseeklab/aoox-cli/blob/v0.1.0-alpha.9/src/commands/domain/set.ts)_
|
|
174
|
+
|
|
175
|
+
## `aoox env diff FROM TO`
|
|
176
|
+
|
|
177
|
+
Compare two environments key by key: which variables exist on one side only and which have different values. Prints names only, never values
|
|
178
|
+
|
|
179
|
+
```
|
|
180
|
+
USAGE
|
|
181
|
+
$ aoox env diff FROM TO [--json] [-t <value>] [-u <value>] [--project <value>]
|
|
182
|
+
|
|
183
|
+
ARGUMENTS
|
|
184
|
+
FROM Environment to compare from
|
|
185
|
+
TO Environment to compare to
|
|
186
|
+
|
|
187
|
+
FLAGS
|
|
188
|
+
-t, --token=<value> [env: AOOX_TOKEN] API token (aoox_…); defaults to the value from `aoox login`
|
|
189
|
+
-u, --url=<value> [env: AOOX_URL] Dashboard URL (the address you open the dashboard with, e.g.
|
|
190
|
+
https://dashboard.example.com); defaults to the value from `aoox login`
|
|
191
|
+
--project=<value> Project ID or name; defaults to the project of the application linked with `aoox link`
|
|
192
|
+
|
|
193
|
+
GLOBAL FLAGS
|
|
194
|
+
--json Format output as json.
|
|
195
|
+
|
|
196
|
+
DESCRIPTION
|
|
197
|
+
Compare two environments key by key: which variables exist on one side only and which have different values. Prints
|
|
198
|
+
names only, never values
|
|
199
|
+
|
|
200
|
+
EXAMPLES
|
|
201
|
+
$ aoox env diff staging production
|
|
202
|
+
```
|
|
203
|
+
|
|
204
|
+
_See code: [src/commands/env/diff.ts](https://github.com/hideandseeklab/aoox-cli/blob/v0.1.0-alpha.9/src/commands/env/diff.ts)_
|
|
205
|
+
|
|
206
|
+
## `aoox env history`
|
|
207
|
+
|
|
208
|
+
Show the version history of an environment: when, who, and which variable names were added (+), changed (~) or removed (-). Values are never shown
|
|
209
|
+
|
|
210
|
+
```
|
|
211
|
+
USAGE
|
|
212
|
+
$ aoox env history [--json] [-t <value>] [-u <value>] [--project <value>] [-e <value>] [--limit <value>]
|
|
213
|
+
|
|
214
|
+
FLAGS
|
|
215
|
+
-e, --env=<value> [default: development] Environment name (development, staging, production, or a custom one)
|
|
216
|
+
-t, --token=<value> [env: AOOX_TOKEN] API token (aoox_…); defaults to the value from `aoox login`
|
|
217
|
+
-u, --url=<value> [env: AOOX_URL] Dashboard URL (the address you open the dashboard with, e.g.
|
|
218
|
+
https://dashboard.example.com); defaults to the value from `aoox login`
|
|
219
|
+
--limit=<value> [default: 20] How many versions to show (newest first)
|
|
220
|
+
--project=<value> Project ID or name; defaults to the project of the application linked with `aoox link`
|
|
221
|
+
|
|
222
|
+
GLOBAL FLAGS
|
|
223
|
+
--json Format output as json.
|
|
224
|
+
|
|
225
|
+
DESCRIPTION
|
|
226
|
+
Show the version history of an environment: when, who, and which variable names were added (+), changed (~) or removed
|
|
227
|
+
(-). Values are never shown
|
|
228
|
+
|
|
229
|
+
EXAMPLES
|
|
230
|
+
$ aoox env history --env production
|
|
231
|
+
|
|
232
|
+
$ aoox env history --limit 5 --json
|
|
233
|
+
```
|
|
234
|
+
|
|
235
|
+
_See code: [src/commands/env/history.ts](https://github.com/hideandseeklab/aoox-cli/blob/v0.1.0-alpha.9/src/commands/env/history.ts)_
|
|
236
|
+
|
|
237
|
+
## `aoox env list`
|
|
238
|
+
|
|
239
|
+
List the project environments, or (with --env) the variable names of one. Values are masked unless --reveal is given
|
|
240
|
+
|
|
241
|
+
```
|
|
242
|
+
USAGE
|
|
243
|
+
$ aoox env list [--json] [-t <value>] [-u <value>] [--project <value>] [-e <value>] [--reveal]
|
|
244
|
+
|
|
245
|
+
FLAGS
|
|
246
|
+
-e, --env=<value> Environment name; without it the environments of the project are listed
|
|
247
|
+
-t, --token=<value> [env: AOOX_TOKEN] API token (aoox_…); defaults to the value from `aoox login`
|
|
248
|
+
-u, --url=<value> [env: AOOX_URL] Dashboard URL (the address you open the dashboard with, e.g.
|
|
249
|
+
https://dashboard.example.com); defaults to the value from `aoox login`
|
|
250
|
+
--project=<value> Project ID or name; defaults to the project of the application linked with `aoox link`
|
|
251
|
+
--reveal Show the values (needs --env; the read is recorded in the audit log)
|
|
252
|
+
|
|
253
|
+
GLOBAL FLAGS
|
|
254
|
+
--json Format output as json.
|
|
255
|
+
|
|
256
|
+
DESCRIPTION
|
|
257
|
+
List the project environments, or (with --env) the variable names of one. Values are masked unless --reveal is given
|
|
258
|
+
|
|
259
|
+
EXAMPLES
|
|
260
|
+
$ aoox env list
|
|
261
|
+
|
|
262
|
+
$ aoox env list --env staging
|
|
263
|
+
|
|
264
|
+
$ aoox env list --env development --reveal
|
|
265
|
+
```
|
|
266
|
+
|
|
267
|
+
_See code: [src/commands/env/list.ts](https://github.com/hideandseeklab/aoox-cli/blob/v0.1.0-alpha.9/src/commands/env/list.ts)_
|
|
268
|
+
|
|
269
|
+
## `aoox env promote FROM TO`
|
|
270
|
+
|
|
271
|
+
Copy variables from one environment to another (name them, or use --all). Needs the right to read the source and to change the target. The target keeps its comments and order; new variables are appended. Shows what changes and asks before writing (unless --yes)
|
|
272
|
+
|
|
273
|
+
```
|
|
274
|
+
USAGE
|
|
275
|
+
$ aoox env promote FROM... TO... [-t <value>] [-u <value>] [--project <value>] [--all] [-y]
|
|
276
|
+
|
|
277
|
+
ARGUMENTS
|
|
278
|
+
FROM... Environment to copy the values from
|
|
279
|
+
TO... Environment to copy the values into
|
|
280
|
+
|
|
281
|
+
FLAGS
|
|
282
|
+
-t, --token=<value> [env: AOOX_TOKEN] API token (aoox_…); defaults to the value from `aoox login`
|
|
283
|
+
-u, --url=<value> [env: AOOX_URL] Dashboard URL (the address you open the dashboard with, e.g.
|
|
284
|
+
https://dashboard.example.com); defaults to the value from `aoox login`
|
|
285
|
+
-y, --yes Do not ask for confirmation
|
|
286
|
+
--all Promote every variable of the source (those already equal are skipped)
|
|
287
|
+
--project=<value> Project ID or name; defaults to the project of the application linked with `aoox link`
|
|
288
|
+
|
|
289
|
+
DESCRIPTION
|
|
290
|
+
Copy variables from one environment to another (name them, or use --all). Needs the right to read the source and to
|
|
291
|
+
change the target. The target keeps its comments and order; new variables are appended. Shows what changes and asks
|
|
292
|
+
before writing (unless --yes)
|
|
293
|
+
|
|
294
|
+
EXAMPLES
|
|
295
|
+
$ aoox env promote staging production API_URL FEATURE_X
|
|
296
|
+
|
|
297
|
+
$ aoox env promote development staging --all --yes
|
|
298
|
+
```
|
|
299
|
+
|
|
300
|
+
_See code: [src/commands/env/promote.ts](https://github.com/hideandseeklab/aoox-cli/blob/v0.1.0-alpha.9/src/commands/env/promote.ts)_
|
|
301
|
+
|
|
302
|
+
## `aoox env pull`
|
|
303
|
+
|
|
304
|
+
Write the variables of an environment to a local file (mode 0600), or to standard output with --file -. Refuses to overwrite unless --force. The read is recorded in the audit log
|
|
305
|
+
|
|
306
|
+
```
|
|
307
|
+
USAGE
|
|
308
|
+
$ aoox env pull [-t <value>] [-u <value>] [--project <value>] [-e <value>] [--file <value>] [--force]
|
|
309
|
+
[--format dotenv|json|shell]
|
|
310
|
+
|
|
311
|
+
FLAGS
|
|
312
|
+
-e, --env=<value> [default: development] Environment name (development, staging, production, or a custom one)
|
|
313
|
+
-t, --token=<value> [env: AOOX_TOKEN] API token (aoox_…); defaults to the value from `aoox login`
|
|
314
|
+
-u, --url=<value> [env: AOOX_URL] Dashboard URL (the address you open the dashboard with, e.g.
|
|
315
|
+
https://dashboard.example.com); defaults to the value from `aoox login`
|
|
316
|
+
--file=<value> File to write, relative to the current folder; "-" writes to standard output (nothing else is
|
|
317
|
+
printed there). Default: .env, .env.json or .env.sh by format
|
|
318
|
+
--force Overwrite the file if it exists
|
|
319
|
+
--format=<option> [default: dotenv] dotenv (the stored text, comments kept), json ({"KEY":"value"}) or shell
|
|
320
|
+
(export KEY='value' lines for eval)
|
|
321
|
+
<options: dotenv|json|shell>
|
|
322
|
+
--project=<value> Project ID or name; defaults to the project of the application linked with `aoox link`
|
|
323
|
+
|
|
324
|
+
DESCRIPTION
|
|
325
|
+
Write the variables of an environment to a local file (mode 0600), or to standard output with --file -. Refuses to
|
|
326
|
+
overwrite unless --force. The read is recorded in the audit log
|
|
327
|
+
|
|
328
|
+
EXAMPLES
|
|
329
|
+
$ aoox env pull
|
|
330
|
+
|
|
331
|
+
$ aoox env pull --env staging --file .env.staging
|
|
332
|
+
|
|
333
|
+
$ aoox env pull --force
|
|
334
|
+
|
|
335
|
+
$ aoox env pull --format json --file -
|
|
336
|
+
|
|
337
|
+
$ aoox env pull --format shell --file -
|
|
338
|
+
```
|
|
339
|
+
|
|
340
|
+
_See code: [src/commands/env/pull.ts](https://github.com/hideandseeklab/aoox-cli/blob/v0.1.0-alpha.9/src/commands/env/pull.ts)_
|
|
341
|
+
|
|
342
|
+
## `aoox env push`
|
|
343
|
+
|
|
344
|
+
Replace the whole text of an environment with a local .env file. Shows what is added, changed and removed and asks before writing (unless --yes); the write fails if someone else changed the environment in between
|
|
345
|
+
|
|
346
|
+
```
|
|
347
|
+
USAGE
|
|
348
|
+
$ aoox env push --file <value> [-t <value>] [-u <value>] [--project <value>] [-e <value>] [-y]
|
|
349
|
+
|
|
350
|
+
FLAGS
|
|
351
|
+
-e, --env=<value> [default: development] Environment name (development, staging, production, or a custom one)
|
|
352
|
+
-t, --token=<value> [env: AOOX_TOKEN] API token (aoox_…); defaults to the value from `aoox login`
|
|
353
|
+
-u, --url=<value> [env: AOOX_URL] Dashboard URL (the address you open the dashboard with, e.g.
|
|
354
|
+
https://dashboard.example.com); defaults to the value from `aoox login`
|
|
355
|
+
-y, --yes Do not ask for confirmation
|
|
356
|
+
--file=<value> (required) The .env file to upload
|
|
357
|
+
--project=<value> Project ID or name; defaults to the project of the application linked with `aoox link`
|
|
358
|
+
|
|
359
|
+
DESCRIPTION
|
|
360
|
+
Replace the whole text of an environment with a local .env file. Shows what is added, changed and removed and asks
|
|
361
|
+
before writing (unless --yes); the write fails if someone else changed the environment in between
|
|
362
|
+
|
|
363
|
+
EXAMPLES
|
|
364
|
+
$ aoox env push --file .env
|
|
365
|
+
|
|
366
|
+
$ aoox env push --file .env.staging --env staging --yes
|
|
367
|
+
```
|
|
368
|
+
|
|
369
|
+
_See code: [src/commands/env/push.ts](https://github.com/hideandseeklab/aoox-cli/blob/v0.1.0-alpha.9/src/commands/env/push.ts)_
|
|
370
|
+
|
|
371
|
+
## `aoox env set ASSIGNMENTS`
|
|
372
|
+
|
|
373
|
+
Set one or more variables in an environment. Existing comments and order are kept; the write fails if someone else changed the environment in between
|
|
374
|
+
|
|
375
|
+
```
|
|
376
|
+
USAGE
|
|
377
|
+
$ aoox env set ASSIGNMENTS... [-t <value>] [-u <value>] [--project <value>] [-e <value>] [--secret]
|
|
378
|
+
|
|
379
|
+
ARGUMENTS
|
|
380
|
+
ASSIGNMENTS... KEY=VALUE (the value is stored exactly as given)
|
|
381
|
+
|
|
382
|
+
FLAGS
|
|
383
|
+
-e, --env=<value> [default: development] Environment name (development, staging, production, or a custom one)
|
|
384
|
+
-t, --token=<value> [env: AOOX_TOKEN] API token (aoox_…); defaults to the value from `aoox login`
|
|
385
|
+
-u, --url=<value> [env: AOOX_URL] Dashboard URL (the address you open the dashboard with, e.g.
|
|
386
|
+
https://dashboard.example.com); defaults to the value from `aoox login`
|
|
387
|
+
--project=<value> Project ID or name; defaults to the project of the application linked with `aoox link`
|
|
388
|
+
--[no-]secret Mark the variables as secret (--secret: always masked in logs) or explicitly not secret
|
|
389
|
+
(--no-secret: never masked). Without either the flag is left as it is
|
|
390
|
+
|
|
391
|
+
DESCRIPTION
|
|
392
|
+
Set one or more variables in an environment. Existing comments and order are kept; the write fails if someone else
|
|
393
|
+
changed the environment in between
|
|
394
|
+
|
|
395
|
+
EXAMPLES
|
|
396
|
+
$ aoox env set API_URL=https://api.example.com
|
|
397
|
+
|
|
398
|
+
$ aoox env set GREETING="hello world" QUERY=a=b --env staging
|
|
399
|
+
|
|
400
|
+
$ aoox env set API_TOKEN=abc123 --secret
|
|
401
|
+
```
|
|
402
|
+
|
|
403
|
+
_See code: [src/commands/env/set.ts](https://github.com/hideandseeklab/aoox-cli/blob/v0.1.0-alpha.9/src/commands/env/set.ts)_
|
|
404
|
+
|
|
405
|
+
## `aoox env unset KEYS`
|
|
406
|
+
|
|
407
|
+
Remove one or more variables from an environment. Comments and the other variables are kept; the write fails if someone else changed the environment in between
|
|
408
|
+
|
|
409
|
+
```
|
|
410
|
+
USAGE
|
|
411
|
+
$ aoox env unset KEYS... [-t <value>] [-u <value>] [--project <value>] [-e <value>]
|
|
412
|
+
|
|
413
|
+
ARGUMENTS
|
|
414
|
+
KEYS... Variable name(s) to remove
|
|
415
|
+
|
|
416
|
+
FLAGS
|
|
417
|
+
-e, --env=<value> [default: development] Environment name (development, staging, production, or a custom one)
|
|
418
|
+
-t, --token=<value> [env: AOOX_TOKEN] API token (aoox_…); defaults to the value from `aoox login`
|
|
419
|
+
-u, --url=<value> [env: AOOX_URL] Dashboard URL (the address you open the dashboard with, e.g.
|
|
420
|
+
https://dashboard.example.com); defaults to the value from `aoox login`
|
|
421
|
+
--project=<value> Project ID or name; defaults to the project of the application linked with `aoox link`
|
|
422
|
+
|
|
423
|
+
DESCRIPTION
|
|
424
|
+
Remove one or more variables from an environment. Comments and the other variables are kept; the write fails if
|
|
425
|
+
someone else changed the environment in between
|
|
426
|
+
|
|
427
|
+
EXAMPLES
|
|
428
|
+
$ aoox env unset OLD_KEY
|
|
429
|
+
|
|
430
|
+
$ aoox env unset A B --env staging
|
|
431
|
+
```
|
|
432
|
+
|
|
433
|
+
_See code: [src/commands/env/unset.ts](https://github.com/hideandseeklab/aoox-cli/blob/v0.1.0-alpha.9/src/commands/env/unset.ts)_
|
|
165
434
|
|
|
166
435
|
## `aoox help [COMMAND]`
|
|
167
436
|
|
|
@@ -217,7 +486,7 @@ EXAMPLES
|
|
|
217
486
|
sudo aoox install --web-domain panel.example.com --api-domain api.panel.example.com --acme-email me@example.com
|
|
218
487
|
```
|
|
219
488
|
|
|
220
|
-
_See code: [src/commands/install.ts](https://github.com/hideandseeklab/aoox-cli/blob/v0.1.0-alpha.
|
|
489
|
+
_See code: [src/commands/install.ts](https://github.com/hideandseeklab/aoox-cli/blob/v0.1.0-alpha.9/src/commands/install.ts)_
|
|
221
490
|
|
|
222
491
|
## `aoox link`
|
|
223
492
|
|
|
@@ -243,7 +512,7 @@ EXAMPLES
|
|
|
243
512
|
$ aoox link --project <id> --app <id>
|
|
244
513
|
```
|
|
245
514
|
|
|
246
|
-
_See code: [src/commands/link.ts](https://github.com/hideandseeklab/aoox-cli/blob/v0.1.0-alpha.
|
|
515
|
+
_See code: [src/commands/link.ts](https://github.com/hideandseeklab/aoox-cli/blob/v0.1.0-alpha.9/src/commands/link.ts)_
|
|
247
516
|
|
|
248
517
|
## `aoox login`
|
|
249
518
|
|
|
@@ -269,7 +538,7 @@ EXAMPLES
|
|
|
269
538
|
$ aoox login --url 203.0.113.10:3000 --token aoox_xxx
|
|
270
539
|
```
|
|
271
540
|
|
|
272
|
-
_See code: [src/commands/login.ts](https://github.com/hideandseeklab/aoox-cli/blob/v0.1.0-alpha.
|
|
541
|
+
_See code: [src/commands/login.ts](https://github.com/hideandseeklab/aoox-cli/blob/v0.1.0-alpha.9/src/commands/login.ts)_
|
|
273
542
|
|
|
274
543
|
## `aoox plugins`
|
|
275
544
|
|
|
@@ -568,7 +837,7 @@ Build an image from a Dockerfile, named for the aoox registry (refuses a version
|
|
|
568
837
|
```
|
|
569
838
|
USAGE
|
|
570
839
|
$ aoox registry build IMAGE [-t <value>] [-u <value>] [--force] [--registry <value>] [--context <value>] [-f
|
|
571
|
-
<value>]
|
|
840
|
+
<value>] [--push]
|
|
572
841
|
|
|
573
842
|
ARGUMENTS
|
|
574
843
|
IMAGE Image name and version, e.g. myapp:1.0.0
|
|
@@ -580,6 +849,7 @@ FLAGS
|
|
|
580
849
|
https://dashboard.example.com); defaults to the value from `aoox login`
|
|
581
850
|
--context=<value> [default: .] Docker build context
|
|
582
851
|
--force Overwrite a version that already exists in the registry
|
|
852
|
+
--push Push the image to the registry right after the build
|
|
583
853
|
--registry=<value> Registry ID; defaults to the self-hosted registry
|
|
584
854
|
|
|
585
855
|
DESCRIPTION
|
|
@@ -588,12 +858,14 @@ DESCRIPTION
|
|
|
588
858
|
EXAMPLES
|
|
589
859
|
$ aoox registry build myapp:1.0.0
|
|
590
860
|
|
|
861
|
+
$ aoox registry build myapp:1.0.0 --push
|
|
862
|
+
|
|
591
863
|
$ aoox registry build team/api:2.1.0 -f docker/Dockerfile --context .
|
|
592
864
|
|
|
593
865
|
$ aoox registry build myapp:1.0.0 --force
|
|
594
866
|
```
|
|
595
867
|
|
|
596
|
-
_See code: [src/commands/registry/build.ts](https://github.com/hideandseeklab/aoox-cli/blob/v0.1.0-alpha.
|
|
868
|
+
_See code: [src/commands/registry/build.ts](https://github.com/hideandseeklab/aoox-cli/blob/v0.1.0-alpha.9/src/commands/registry/build.ts)_
|
|
597
869
|
|
|
598
870
|
## `aoox registry domain`
|
|
599
871
|
|
|
@@ -619,7 +891,7 @@ EXAMPLES
|
|
|
619
891
|
$ aoox registry domain --clear
|
|
620
892
|
```
|
|
621
893
|
|
|
622
|
-
_See code: [src/commands/registry/domain.ts](https://github.com/hideandseeklab/aoox-cli/blob/v0.1.0-alpha.
|
|
894
|
+
_See code: [src/commands/registry/domain.ts](https://github.com/hideandseeklab/aoox-cli/blob/v0.1.0-alpha.9/src/commands/registry/domain.ts)_
|
|
623
895
|
|
|
624
896
|
## `aoox registry push IMAGE`
|
|
625
897
|
|
|
@@ -650,7 +922,7 @@ EXAMPLES
|
|
|
650
922
|
$ aoox registry push myapp:1.0.0 --force
|
|
651
923
|
```
|
|
652
924
|
|
|
653
|
-
_See code: [src/commands/registry/push.ts](https://github.com/hideandseeklab/aoox-cli/blob/v0.1.0-alpha.
|
|
925
|
+
_See code: [src/commands/registry/push.ts](https://github.com/hideandseeklab/aoox-cli/blob/v0.1.0-alpha.9/src/commands/registry/push.ts)_
|
|
654
926
|
|
|
655
927
|
## `aoox reinstall`
|
|
656
928
|
|
|
@@ -680,7 +952,38 @@ EXAMPLES
|
|
|
680
952
|
sudo aoox reinstall --yes --terminal-ssh-user root
|
|
681
953
|
```
|
|
682
954
|
|
|
683
|
-
_See code: [src/commands/reinstall.ts](https://github.com/hideandseeklab/aoox-cli/blob/v0.1.0-alpha.
|
|
955
|
+
_See code: [src/commands/reinstall.ts](https://github.com/hideandseeklab/aoox-cli/blob/v0.1.0-alpha.9/src/commands/reinstall.ts)_
|
|
956
|
+
|
|
957
|
+
## `aoox run`
|
|
958
|
+
|
|
959
|
+
Run a command with the variables of an environment, without writing them to disk. Put the command after `--`; its exit code is forwarded. The read is recorded in the audit log
|
|
960
|
+
|
|
961
|
+
```
|
|
962
|
+
USAGE
|
|
963
|
+
$ aoox run [-t <value>] [-u <value>] [--project <value>] [-e <value>] [--file <value>]
|
|
964
|
+
|
|
965
|
+
FLAGS
|
|
966
|
+
-e, --env=<value> [default: development] Environment name (development, staging, production, or a custom one)
|
|
967
|
+
-t, --token=<value> [env: AOOX_TOKEN] API token (aoox_…); defaults to the value from `aoox login`
|
|
968
|
+
-u, --url=<value> [env: AOOX_URL] Dashboard URL (the address you open the dashboard with, e.g.
|
|
969
|
+
https://dashboard.example.com); defaults to the value from `aoox login`
|
|
970
|
+
--file=<value> A local .env file layered on top of the environment (it wins over aoox, which wins over the
|
|
971
|
+
current environment). Only read, never written
|
|
972
|
+
--project=<value> Project ID or name; defaults to the project of the application linked with `aoox link`
|
|
973
|
+
|
|
974
|
+
DESCRIPTION
|
|
975
|
+
Run a command with the variables of an environment, without writing them to disk. Put the command after `--`; its exit
|
|
976
|
+
code is forwarded. The read is recorded in the audit log
|
|
977
|
+
|
|
978
|
+
EXAMPLES
|
|
979
|
+
$ aoox run -- npm run dev
|
|
980
|
+
|
|
981
|
+
$ aoox run --env staging -- node server.js
|
|
982
|
+
|
|
983
|
+
$ aoox run --file .env.local -- npm run dev
|
|
984
|
+
```
|
|
985
|
+
|
|
986
|
+
_See code: [src/commands/run.ts](https://github.com/hideandseeklab/aoox-cli/blob/v0.1.0-alpha.9/src/commands/run.ts)_
|
|
684
987
|
|
|
685
988
|
## `aoox update`
|
|
686
989
|
|
|
@@ -702,7 +1005,7 @@ EXAMPLES
|
|
|
702
1005
|
$ aoox update --check
|
|
703
1006
|
```
|
|
704
1007
|
|
|
705
|
-
_See code: [src/commands/update.ts](https://github.com/hideandseeklab/aoox-cli/blob/v0.1.0-alpha.
|
|
1008
|
+
_See code: [src/commands/update.ts](https://github.com/hideandseeklab/aoox-cli/blob/v0.1.0-alpha.9/src/commands/update.ts)_
|
|
706
1009
|
|
|
707
1010
|
## `aoox update panel`
|
|
708
1011
|
|
|
@@ -727,7 +1030,7 @@ EXAMPLES
|
|
|
727
1030
|
$ aoox update panel --apply
|
|
728
1031
|
```
|
|
729
1032
|
|
|
730
|
-
_See code: [src/commands/update/panel.ts](https://github.com/hideandseeklab/aoox-cli/blob/v0.1.0-alpha.
|
|
1033
|
+
_See code: [src/commands/update/panel.ts](https://github.com/hideandseeklab/aoox-cli/blob/v0.1.0-alpha.9/src/commands/update/panel.ts)_
|
|
731
1034
|
|
|
732
1035
|
## `aoox whoami`
|
|
733
1036
|
|
|
@@ -754,7 +1057,7 @@ EXAMPLES
|
|
|
754
1057
|
$ aoox whoami --json
|
|
755
1058
|
```
|
|
756
1059
|
|
|
757
|
-
_See code: [src/commands/whoami.ts](https://github.com/hideandseeklab/aoox-cli/blob/v0.1.0-alpha.
|
|
1060
|
+
_See code: [src/commands/whoami.ts](https://github.com/hideandseeklab/aoox-cli/blob/v0.1.0-alpha.9/src/commands/whoami.ts)_
|
|
758
1061
|
<!-- commandsstop -->
|
|
759
1062
|
|
|
760
1063
|
## Versioning
|
package/dist/commands/deploy.js
CHANGED
|
@@ -2,7 +2,7 @@ import { select } from '@inquirer/prompts';
|
|
|
2
2
|
import { Command, Flags } from '@oclif/core';
|
|
3
3
|
import { api, ApiError } from '../lib/api.js';
|
|
4
4
|
import { MissingCredentialsError } from '../lib/config.js';
|
|
5
|
-
import { dockerInherit, dockerLogin } from '../lib/docker.js';
|
|
5
|
+
import { dockerEngineStatus, dockerInherit, dockerLogin, dockerUnavailableLines } from '../lib/docker.js';
|
|
6
6
|
import { connectionFlags, loadCredentials } from '../lib/flags.js';
|
|
7
7
|
import { deployTag } from '../lib/git.js';
|
|
8
8
|
import { imageRefFor } from '../lib/image-ref.js';
|
|
@@ -47,6 +47,11 @@ export default class Deploy extends Command {
|
|
|
47
47
|
this.warn(localHint);
|
|
48
48
|
const tag = flags.tag ?? deployTag(cwd);
|
|
49
49
|
const imageRef = imageRefFor({ appName: app.appName, projectName: app.project.name, registryUrl: registry.url, tag });
|
|
50
|
+
const engine = await dockerEngineStatus();
|
|
51
|
+
if (engine !== 'ok') {
|
|
52
|
+
const [headline, hint] = dockerUnavailableLines(engine);
|
|
53
|
+
this.error(headline, { suggestions: [hint] });
|
|
54
|
+
}
|
|
50
55
|
this.log(`==> Build ${imageRef}`);
|
|
51
56
|
await dockerInherit(['build', '-t', imageRef, '-f', flags.dockerfile, flags.context], cwd);
|
|
52
57
|
if (credentials.username && credentials.password) {
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { EnvironmentDiff } from '../../lib/types.js';
|
|
2
|
+
import { EnvCommand } from '../../lib/env-command.js';
|
|
3
|
+
export default class EnvDiff extends EnvCommand {
|
|
4
|
+
static args: {
|
|
5
|
+
from: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
|
|
6
|
+
to: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
|
|
7
|
+
};
|
|
8
|
+
static description: string;
|
|
9
|
+
static enableJsonFlag: boolean;
|
|
10
|
+
static examples: string[];
|
|
11
|
+
static flags: {
|
|
12
|
+
project: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
13
|
+
token: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
14
|
+
url: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
15
|
+
};
|
|
16
|
+
run(): Promise<EnvironmentDiff>;
|
|
17
|
+
private section;
|
|
18
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { Args } from '@oclif/core';
|
|
2
|
+
import { api } from '../../lib/api.js';
|
|
3
|
+
import { EnvCommand, projectFlags } from '../../lib/env-command.js';
|
|
4
|
+
export default class EnvDiff extends EnvCommand {
|
|
5
|
+
static args = {
|
|
6
|
+
from: Args.string({ description: 'Environment to compare from', required: true }),
|
|
7
|
+
to: Args.string({ description: 'Environment to compare to', required: true }),
|
|
8
|
+
};
|
|
9
|
+
static description = 'Compare two environments key by key: which variables exist on one side only and which have different values. Prints names only, never values';
|
|
10
|
+
static enableJsonFlag = true;
|
|
11
|
+
static examples = ['<%= config.bin %> <%= command.id %> staging production'];
|
|
12
|
+
static flags = { ...projectFlags };
|
|
13
|
+
async run() {
|
|
14
|
+
const { args, flags } = await this.parse(EnvDiff);
|
|
15
|
+
const { config, projectId, projectName } = await this.resolveProject(flags);
|
|
16
|
+
let diff;
|
|
17
|
+
try {
|
|
18
|
+
diff = await api(config, `/projects/${projectId}/environments/diff?from=${encodeURIComponent(args.from)}&to=${encodeURIComponent(args.to)}`);
|
|
19
|
+
}
|
|
20
|
+
catch (error) {
|
|
21
|
+
return this.failFromApi(error);
|
|
22
|
+
}
|
|
23
|
+
this.log(`Project: ${projectName} · ${diff.from.name} -> ${diff.to.name}`);
|
|
24
|
+
this.section(`Only in ${diff.from.name}`, diff.onlyInFrom);
|
|
25
|
+
this.section(`Only in ${diff.to.name}`, diff.onlyInTo);
|
|
26
|
+
if (diff.comparable && diff.different && diff.same) {
|
|
27
|
+
this.section('Different values', diff.different);
|
|
28
|
+
this.log(`Same in both: ${diff.same.length}`);
|
|
29
|
+
if (diff.onlyInFrom.length + diff.onlyInTo.length + diff.different.length === 0) {
|
|
30
|
+
this.log('The two environments are identical.');
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
else {
|
|
34
|
+
this.log(`In both: ${diff.inBoth.length}`);
|
|
35
|
+
this.log('Values were not compared: you cannot read both environments (a protected environment needs a project admin).');
|
|
36
|
+
}
|
|
37
|
+
return diff;
|
|
38
|
+
}
|
|
39
|
+
section(title, names) {
|
|
40
|
+
if (names.length === 0)
|
|
41
|
+
return;
|
|
42
|
+
this.log(`${title} (${names.length}):`);
|
|
43
|
+
for (const n of names)
|
|
44
|
+
this.log(` ${n}`);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { EnvironmentVersion } from '../../lib/types.js';
|
|
2
|
+
import { EnvCommand } from '../../lib/env-command.js';
|
|
3
|
+
export default class EnvHistory extends EnvCommand {
|
|
4
|
+
static description: string;
|
|
5
|
+
static enableJsonFlag: boolean;
|
|
6
|
+
static examples: string[];
|
|
7
|
+
static flags: {
|
|
8
|
+
limit: import("@oclif/core/interfaces").OptionFlag<number, import("@oclif/core/interfaces").CustomOptions>;
|
|
9
|
+
env: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
10
|
+
project: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
11
|
+
token: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
12
|
+
url: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
13
|
+
};
|
|
14
|
+
run(): Promise<EnvironmentVersion[]>;
|
|
15
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { Flags } from '@oclif/core';
|
|
2
|
+
import { api } from '../../lib/api.js';
|
|
3
|
+
import { EnvCommand, environmentFlag, projectFlags } from '../../lib/env-command.js';
|
|
4
|
+
import { describeSummary } from '../../lib/env-plan.js';
|
|
5
|
+
export default class EnvHistory extends EnvCommand {
|
|
6
|
+
static description = 'Show the version history of an environment: when, who, and which variable names were added (+), changed (~) or removed (-). Values are never shown';
|
|
7
|
+
static enableJsonFlag = true;
|
|
8
|
+
static examples = ['<%= config.bin %> <%= command.id %> --env production', '<%= config.bin %> <%= command.id %> --limit 5 --json'];
|
|
9
|
+
static flags = {
|
|
10
|
+
...projectFlags,
|
|
11
|
+
...environmentFlag,
|
|
12
|
+
limit: Flags.integer({ default: 20, description: 'How many versions to show (newest first)', min: 1 }),
|
|
13
|
+
};
|
|
14
|
+
async run() {
|
|
15
|
+
const { flags } = await this.parse(EnvHistory);
|
|
16
|
+
const resolved = await this.resolveEnvironment(flags);
|
|
17
|
+
let versions;
|
|
18
|
+
try {
|
|
19
|
+
versions = await api(resolved.config, `/projects/${resolved.projectId}/environments/${resolved.environment.id}/versions`);
|
|
20
|
+
}
|
|
21
|
+
catch (error) {
|
|
22
|
+
return this.failFromApi(error, { environment: resolved.environment.name });
|
|
23
|
+
}
|
|
24
|
+
this.log(`Project: ${resolved.projectName} · environment: ${resolved.environment.name}`);
|
|
25
|
+
if (versions.length === 0) {
|
|
26
|
+
this.log('No versions yet: the first change creates one.');
|
|
27
|
+
return [];
|
|
28
|
+
}
|
|
29
|
+
const shown = versions.slice(0, flags.limit);
|
|
30
|
+
const when = (v) => new Date(v.createdAt).toISOString().replace('T', ' ').slice(0, 19);
|
|
31
|
+
const who = (v) => `${v.authorEmail ?? 'system'}${v.via === 'token' ? ' (token)' : ''}`;
|
|
32
|
+
const w = {
|
|
33
|
+
action: Math.max(6, ...shown.map((v) => v.action.length)),
|
|
34
|
+
who: Math.max(3, ...shown.map((v) => who(v).length)),
|
|
35
|
+
};
|
|
36
|
+
this.log(`${'WHEN (UTC)'.padEnd(19)} ${'WHO'.padEnd(w.who)} ${'ACTION'.padEnd(w.action)} CHANGE`);
|
|
37
|
+
for (const v of shown) {
|
|
38
|
+
const detail = v.detail && v.action !== 'baseline' ? ` (${v.detail})` : '';
|
|
39
|
+
this.log(`${when(v).padEnd(19)} ${who(v).padEnd(w.who)} ${v.action.padEnd(w.action)} ${describeSummary(v.summary)}${detail}${v.current ? ' <- current' : ''}`);
|
|
40
|
+
}
|
|
41
|
+
const older = versions.length - shown.length;
|
|
42
|
+
if (older > 0)
|
|
43
|
+
this.log(`... ${older} older version${older === 1 ? '' : 's'} (use --limit)`);
|
|
44
|
+
return shown;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { EnvCommand } from '../../lib/env-command.js';
|
|
2
|
+
export interface EnvListEnvironment {
|
|
3
|
+
keys: string[];
|
|
4
|
+
name: string;
|
|
5
|
+
protected: boolean;
|
|
6
|
+
usedBy: string[];
|
|
7
|
+
variables: number;
|
|
8
|
+
}
|
|
9
|
+
export interface EnvListVariables {
|
|
10
|
+
environment: string;
|
|
11
|
+
protected: boolean;
|
|
12
|
+
/** Variables flagged secret. */
|
|
13
|
+
secretKeys: string[];
|
|
14
|
+
/** Present only with `--reveal`. */
|
|
15
|
+
values?: Record<string, string>;
|
|
16
|
+
variables: string[];
|
|
17
|
+
}
|
|
18
|
+
export default class EnvList extends EnvCommand {
|
|
19
|
+
static description: string;
|
|
20
|
+
static enableJsonFlag: boolean;
|
|
21
|
+
static examples: string[];
|
|
22
|
+
static flags: {
|
|
23
|
+
env: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
24
|
+
reveal: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
25
|
+
project: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
26
|
+
token: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
27
|
+
url: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
28
|
+
};
|
|
29
|
+
run(): Promise<EnvListEnvironment[] | EnvListVariables>;
|
|
30
|
+
private listVariables;
|
|
31
|
+
}
|