@onbox/cli 0.1.1 → 0.2.0

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.
Files changed (3) hide show
  1. package/README.md +8 -0
  2. package/dist/onbox.js +1606 -165
  3. package/package.json +2 -7
package/README.md CHANGED
@@ -32,12 +32,20 @@ For several organisations, or production and a local environment, keep several p
32
32
 
33
33
  ```bash
34
34
  onbox profiles list # * marks the active profile
35
+ onbox profiles list --check # also: does each sign-in still work, and as whom
35
36
  onbox profiles use acme
36
37
  onbox profiles remove old
37
38
  onbox logout [--profile acme] # revokes the sign-in, then deletes the credential and the profile
38
39
  onbox auth set-key [--profile ci] # sign in with a personal API key instead of the browser
39
40
  ```
40
41
 
42
+ `profiles list --check` checks every profile with read-only calls and reports its `status`:
43
+ `valid`, `expired` (the sign-in ran out and its refresh was refused), `revoked` (the API refused a credential that had not expired, such as a revoked API key) or `error` (no stored credential, or the API could not be reached).
44
+ For a working profile it shows the signed-in user's name and email (from the OAuth user info endpoint; not available for an API key) and the organisation (from `GET /v1/account/status`).
45
+ A sign-in due to expire is refreshed and the rotated tokens are stored, as any command would.
46
+ One failing profile does not stop the others, the command exits 0, and it never prints a token.
47
+ `--json` returns the `profiles list --json` rows with `status`, `user` and `error` added.
48
+
41
49
  `auth set-key` reads the key from a hidden prompt, or from stdin (`echo $KEY | onbox auth set-key`).
42
50
  Create keys in Onbox under Settings, API keys.
43
51
  The CLI checks the key against the API, then saves it in a profile for the key's organisation.