@topolo/cli 0.1.15 → 0.1.17
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 +20 -4
- package/dist/index.js +2147 -303
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -9,6 +9,7 @@ via `stdin`/`stdout`.
|
|
|
9
9
|
- API-key authentication (long-lived, service-scoped).
|
|
10
10
|
- Access-token authentication via OAuth device flow when a CLI OAuth client id is configured.
|
|
11
11
|
- Stored access-token refresh when the config includes a refresh token and OAuth client id.
|
|
12
|
+
- First-class `production` and `staging` CLI environments with separate stored credentials, OAuth client ids, and service URL overrides.
|
|
12
13
|
- Commands: `auth login/logout/status`, `whoami`, `apps`, `apps scaffold`, `services`, `crm contacts:list`, `crm contacts:get`, and generic `api` passthrough for SDK-registered services.
|
|
13
14
|
|
|
14
15
|
## Install
|
|
@@ -23,9 +24,19 @@ npx @topolo/cli whoami
|
|
|
23
24
|
|
|
24
25
|
Credentials come from (in priority order):
|
|
25
26
|
|
|
26
|
-
1. `
|
|
27
|
-
2. `
|
|
28
|
-
3.
|
|
27
|
+
1. Environment-specific vars such as `TOPOLO_STAGING_API_KEY` or `TOPOLO_PRODUCTION_ACCESS_TOKEN`
|
|
28
|
+
2. Global vars `TOPOLO_API_KEY` or `TOPOLO_ACCESS_TOKEN`
|
|
29
|
+
3. The selected environment profile in the config file (`$XDG_CONFIG_HOME/topolo/config.json`, mode `0600`)
|
|
30
|
+
|
|
31
|
+
Production is the default. Select staging with `--env staging` anywhere in the command, or set `TOPOLO_ENV=staging`:
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
topolo auth status --env staging --json
|
|
35
|
+
topolo auth login --env staging --client-id doac_...
|
|
36
|
+
topolo platform apps scaffold home --env staging --write --json
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
The staging profile uses `auth.stg.topolo.us`, `developers.stg.topolo.us`, and `seed.stg.topolo.us` by default. Other SDK service calls in staging must have an explicit staging URL override; the CLI refuses to call a production SDK URL while `--env staging` is selected.
|
|
29
40
|
|
|
30
41
|
For interactive use:
|
|
31
42
|
|
|
@@ -38,7 +49,8 @@ topolo auth logout # clears the stored credential
|
|
|
38
49
|
|
|
39
50
|
If no client id is configured, `topolo auth login` falls back to an API-key
|
|
40
51
|
prompt in an interactive terminal. Non-interactive sessions should pass
|
|
41
|
-
`--api-key` or set `
|
|
52
|
+
`--api-key` or set `TOPOLO_PRODUCTION_CLI_CLIENT_ID`,
|
|
53
|
+
`TOPOLO_STAGING_CLI_CLIENT_ID`, or the shared `TOPOLO_CLI_CLIENT_ID`.
|
|
42
54
|
|
|
43
55
|
## Cross-org isolation
|
|
44
56
|
|
|
@@ -97,9 +109,13 @@ topolo crm contacts:get contact_abc123
|
|
|
97
109
|
### `topolo services`
|
|
98
110
|
|
|
99
111
|
Lists every service id and effective URL known to the generated SDK registry.
|
|
112
|
+
In staging, `environmentSafe: false` means that service still resolves to a
|
|
113
|
+
production SDK default and will be refused by `topolo api` until a staging URL
|
|
114
|
+
override is configured.
|
|
100
115
|
|
|
101
116
|
```bash
|
|
102
117
|
topolo services --json
|
|
118
|
+
topolo services --env staging --json
|
|
103
119
|
```
|
|
104
120
|
|
|
105
121
|
### `topolo apps`
|