@collective-intelligence/cli 0.1.1 → 0.1.3
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 +64 -5
- package/dist/cli.js +143 -127
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -4,6 +4,22 @@ The public `ci` binary manages Extension Package development and immutable
|
|
|
4
4
|
release operations. It talks to the Backend only through generated OpenAPI
|
|
5
5
|
operations; it does not import private Backend runtime code.
|
|
6
6
|
|
|
7
|
+
## Install
|
|
8
|
+
|
|
9
|
+
The `ci` binary runs on [Bun](https://bun.sh). Install Bun, then install the
|
|
10
|
+
CLI globally with one of these package managers:
|
|
11
|
+
|
|
12
|
+
```sh
|
|
13
|
+
# npm
|
|
14
|
+
npm install -g @collective-intelligence/cli
|
|
15
|
+
# pnpm (run `pnpm setup` once if pnpm has no global bin directory)
|
|
16
|
+
pnpm add -g @collective-intelligence/cli
|
|
17
|
+
# Bun
|
|
18
|
+
bun add -g @collective-intelligence/cli
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
Run `ci --help` to check the installation.
|
|
22
|
+
|
|
7
23
|
## Sign In and Enroll Your App
|
|
8
24
|
|
|
9
25
|
Interactive developers sign in once; pipelines keep using a token. Every
|
|
@@ -18,7 +34,7 @@ ci whoami
|
|
|
18
34
|
ci orgs list
|
|
19
35
|
ci orgs use <organization-id>
|
|
20
36
|
|
|
21
|
-
# Create or replace one Organization-scoped
|
|
37
|
+
# Create or replace one Organization-scoped External App by FQN and
|
|
22
38
|
# write its connection values. Replace the placeholders with your app's FQN
|
|
23
39
|
# and sign-in callback URL.
|
|
24
40
|
ci apps enroll \
|
|
@@ -40,10 +56,14 @@ ci logout
|
|
|
40
56
|
`CI_MANAGEMENT_TOKEN`), then the Profile (`--profile` or `CI_PROFILE` selects
|
|
41
57
|
one). A Profile never supplies a session for a different origin.
|
|
42
58
|
- `CI_MANAGEMENT_TOKEN` can be an Organization API key with the
|
|
43
|
-
`
|
|
59
|
+
`external_apps_manage` scope. The key fixes its Organization.
|
|
44
60
|
- `ci apps enroll` requires `--fqn`, `--redirect-uri` (repeatable) and
|
|
45
61
|
`--scopes`. Defaults: `--type public`, name = FQN, allowed origins = redirect
|
|
46
|
-
URI origins, audience = first redirect URI origin
|
|
62
|
+
URI origins, audience = first redirect URI origin, primary redirect URI =
|
|
63
|
+
first `--redirect-uri`. `--primary-redirect-uri <uri>` picks another primary;
|
|
64
|
+
it must be one of the `--redirect-uri` values. `--allowed-origin <origin>`
|
|
65
|
+
(repeatable) replaces the derived allowed origins; each value must be an
|
|
66
|
+
exact origin such as `https://<your-app-host>`. Loopback redirect URIs
|
|
47
67
|
(`http://localhost`, `http://127.0.0.1`, `http://[::1]`) need an explicit port.
|
|
48
68
|
- Output keys: `CI_ISSUER`, `CI_AUDIENCE`, `CI_APPLICATION_ID`, `CI_CLIENT_ID`,
|
|
49
69
|
`CI_ORGANIZATION_ID`, `CI_JWKS_URL`, `CI_SCOPES`, plus `CI_CLIENT_SECRET` for
|
|
@@ -62,6 +82,45 @@ ci logout
|
|
|
62
82
|
`apps` also fails after 30 seconds without a complete response; a login
|
|
63
83
|
token poll gets its own 30 seconds. Ctrl-C cancels the request in flight.
|
|
64
84
|
- `ci apps list|get|rotate-secret|disable` manage existing applications.
|
|
85
|
+
`list` and `get` show `primaryRedirectUri` beside `redirectUris`.
|
|
86
|
+
|
|
87
|
+
## Manage Redirect URIs and Trusted Websites
|
|
88
|
+
|
|
89
|
+
An application accepts every registered redirect URI. A sign-in chooses its
|
|
90
|
+
callback with the OAuth `redirect_uri` parameter; the primary redirect URI is
|
|
91
|
+
the default that people and tools use. `allowedOrigins` lists the trusted
|
|
92
|
+
websites: exact origins that may call CI from a browser. `<application>` is an
|
|
93
|
+
Application Id or an FQN.
|
|
94
|
+
|
|
95
|
+
```sh
|
|
96
|
+
ci apps redirect-uris list <your.app.fqn>
|
|
97
|
+
# Register another callback. By default this also trusts its origin;
|
|
98
|
+
# --no-trust-origin skips that, --primary also makes it the primary.
|
|
99
|
+
ci apps redirect-uris add <your.app.fqn> <your-preview-callback-url>
|
|
100
|
+
ci apps redirect-uris set-primary <your.app.fqn> <your-app-callback-url>
|
|
101
|
+
ci apps redirect-uris remove <your.app.fqn> <your-preview-callback-url>
|
|
102
|
+
|
|
103
|
+
ci apps origins list <your.app.fqn>
|
|
104
|
+
ci apps origins add <your.app.fqn> https://<your-app-host>
|
|
105
|
+
ci apps origins remove <your.app.fqn> https://<your-app-host>
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
- Each write reads the application, computes the full new lists and sends one
|
|
109
|
+
update. The CLI checks URLs before any request: HTTPS, or loopback HTTP with
|
|
110
|
+
an explicit port, with no `#` and no `*`. An origin must have no path.
|
|
111
|
+
- `list` prints `{ "primaryRedirectUri", "redirectUris" }` or
|
|
112
|
+
`{ "allowedOrigins" }`; a write prints the updated application like
|
|
113
|
+
`ci apps get`. Notes and warnings go to stderr.
|
|
114
|
+
- Adding a registered redirect URI or a trusted origin again changes nothing
|
|
115
|
+
and says so. `redirect-uris add` then reports the redirect-URI check of
|
|
116
|
+
`ci doctor`; a failed check does not undo the write.
|
|
117
|
+
- `redirect-uris remove` refuses the last redirect URI and the primary one (run
|
|
118
|
+
`set-primary` first). When no remaining redirect URI uses the removed URI's
|
|
119
|
+
origin, it prints the `ci apps origins remove` command but keeps the origin.
|
|
120
|
+
- `redirect-uris set-primary` needs a registered redirect URI.
|
|
121
|
+
`origins remove` warns when a redirect URI still uses the origin.
|
|
122
|
+
- These commands refuse package-owned applications; change those through their
|
|
123
|
+
Extension Package.
|
|
65
124
|
|
|
66
125
|
## Deploy an Exact Release
|
|
67
126
|
|
|
@@ -336,9 +395,9 @@ native Dataset behavior; refresh does not approve or widen a policy implicitly.
|
|
|
336
395
|
## Client secrets for package-created applications
|
|
337
396
|
|
|
338
397
|
Install creates a declared confidential application without a client secret.
|
|
339
|
-
An administrator holding `
|
|
398
|
+
An administrator holding `external_apps:manage` (CLI Session, Dashboard
|
|
340
399
|
session token or API key) runs `ci apps rotate-secret <application-id>`, calls
|
|
341
|
-
`POST /admin/organization/
|
|
400
|
+
`POST /admin/organization/external-apps/<application-id>/credential/rotate`
|
|
342
401
|
with the `x-organization-id` header, or chooses **Rotate secret** on the
|
|
343
402
|
application in the Dashboard External Apps page. The response shows
|
|
344
403
|
`clientSecret` once; store it server-side immediately, because CI keeps only its
|