@collective-intelligence/cli 0.1.5 → 0.1.7

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 +62 -21
  2. package/dist/cli.js +20 -18
  3. package/package.json +2 -2
package/README.md CHANGED
@@ -182,17 +182,27 @@ exit nonzero with the operation ID and Backend-authored guidance. The default
182
182
  overall deadline is 300,000 ms; `--timeout-ms <positive-integer>` changes it.
183
183
  Timeout errors preserve the operation ID and last observed event sequence;
184
184
  rerun the same intent or use `ci package operation reconnect` to follow it.
185
- Deterministic request keys include exact release, Organization, endpoint and
186
- breaking-change acknowledgement and connector setup intent. Broad publisher/management credentials
187
- are sent only to CI, never to a Gateway endpoint.
185
+ Deterministic request keys include exact release, Organization, endpoint,
186
+ breaking-change acknowledgement and deployment inputs. Broad publisher/management
187
+ credentials are sent only to CI, never to a Gateway endpoint.
188
188
 
189
- ## Connector Setup
189
+ When `CI_MANAGEMENT_TOKEN` is an Organization API key (`dpk_` prefix), `ci deploy`
190
+ installs into that key's Organization without `--organization`; with any other
191
+ credential `--organization` or the Profile Current Organization applies.
190
192
 
191
- Pass `--setup-file <path>` to `ci deploy`, `ci package install`, or
192
- `ci package update`. The JSON file stays separate from release bytes:
193
+ ## Deployment Inputs
194
+
195
+ Pass `--inputs <path>` to `ci deploy`, `ci package install`, or
196
+ `ci package update`. The Inputs File is JSON with the optional keys `variables`,
197
+ `connections` and `adoptions`; it stays separate from release bytes:
193
198
 
194
199
  ```json
195
200
  {
201
+ "variables": {
202
+ "collection": "accounts",
203
+ "companyDomains": ["acme.example", "partners.example"],
204
+ "crmToken": { "link": "CRM_TOKEN" }
205
+ },
196
206
  "connections": {
197
207
  "crm": { "connectionId": "2a4cb90a-0e00-4384-8a78-d5279fbb3a77" },
198
208
  "warehouse": {
@@ -207,32 +217,63 @@ Pass `--setup-file <path>` to `ci deploy`, `ci package install`, or
207
217
  }
208
218
  ```
209
219
 
210
- Replace the UUIDs with existing authorized Organization resources and supply
211
- required native credential fields. Connection setup keys match the declaration's
212
- `setupKey`; adoption keys are concrete declaration FQNs. The backend validates
220
+ `variables` supplies the Package Variables the manifest declares (see the
221
+ [SDK `packageVariables`](../extensions-sdk/README.md#package-variables)). A
222
+ value is inline JSON of the declared type or `{ "link": "<ORG_VARIABLE_KEY>" }`,
223
+ a link to an organization variable of the target Organization. A `secret`
224
+ variable accepts only the link form; the CLI rejects an inline secret before any
225
+ request. A variable with a `default` may be omitted; one without a default is
226
+ required. Connection setup keys match the components' `setupKey`s and select an
227
+ existing authorized `connectionId` or a `newConnection` with native credential
228
+ fields; adoption keys are concrete declaration FQNs. The backend validates
213
229
  Organization/template/ownership compatibility and keeps credentials in native
214
- connection custody. Invalid input errors omit setup values.
230
+ connection custody. Invalid input errors omit input values.
231
+
232
+ `ci deploy` also accepts `--var <name>=<value>` (repeatable). The value is
233
+ coerced by the declared type: `string` as-is, `number`, `boolean` as `true` or
234
+ `false`, `string[]` comma-separated, `json` parsed. `--var <name>=@<ORG_VARIABLE_KEY>`
235
+ sets a link. A flag overrides the same name in the Inputs File.
215
236
 
216
237
  ```sh
238
+ ci deploy --declaration ./src/package.ts --inputs-template
239
+
217
240
  ci deploy --backend-url https://ci.example.com --organization <organization-id> \
218
- --declaration ./src/package.ts --setup-file ./setup.json --non-interactive --json
241
+ --declaration ./src/package.ts --inputs ./inputs.json \
242
+ --var crmToken=@CRM_TOKEN --var companyDomains=acme.example,partners.example \
243
+ --non-interactive --json
219
244
 
220
245
  ci package install --backend-url https://ci.example.com --organization <organization-id> \
221
246
  --package com.acme.sales --release <exact-release-id> --idempotency-key <request-key> \
222
- --setup-file ./setup.json
247
+ --inputs ./inputs.json
223
248
 
224
249
  ci package update --backend-url https://ci.example.com --organization <organization-id> \
225
250
  --installation <installation-id> --release <exact-release-id> \
226
- --idempotency-key <request-key> --setup-file ./setup.json
251
+ --idempotency-key <request-key> --inputs ./inputs.json
227
252
  ```
228
253
 
229
- An explicit setup file submits installation/update even when the exact release
230
- already serves. Deploy request keys include canonical setup contents: identical
231
- retries reuse their intent; changed setup gets a different key. For package
232
- install/update, reuse the explicit key only for identical intent; the backend
233
- rejects conflicting replay. Setup flags apply only to install/update, not sync or
234
- publication. A successful configuration operation does not mean records have
235
- been imported; native schedules/manual actions run afterward.
254
+ `--inputs-template` builds the declaration locally and prints the template to
255
+ stdout without contacting the Backend: every declared variable with its `type`,
256
+ `description` and `required: true` or `default`, every connection slot derived
257
+ from the components' `setupKey`s, and empty `adoptions`. The manifest declares
258
+ no slots; `installationWizard` is unchanged.
259
+
260
+ On a first install, `--non-interactive` fails before any publish, promote or
261
+ install request when a required variable or slot is missing and lists every
262
+ missing name. Without `--non-interactive` the CLI asks for each missing input on
263
+ the terminal: variable answers follow the `--var` value syntax, a slot takes an
264
+ existing connection id. On an update the stored values stay unless the Inputs
265
+ File or `--var` overrides them, and the Backend reports `missing_inputs` for a
266
+ required variable the new release adds. `ci package install` and
267
+ `ci package update` send the file as-is; the Backend validates it. No command
268
+ output or error echoes a variable value.
269
+
270
+ Explicit inputs submit installation/update even when the exact release already
271
+ serves. Deploy request keys include the canonical inputs (setup and variables):
272
+ identical retries reuse their intent; changed inputs get a different key. For
273
+ package install/update, reuse the explicit key only for identical intent; the
274
+ backend rejects conflicting replay. `--inputs` applies only to install/update,
275
+ not sync or publication. A successful configuration operation does not mean
276
+ records have been imported; native schedules/manual actions run afterward.
236
277
 
237
278
  ## Immutable Release Builds
238
279
 
@@ -402,7 +443,7 @@ ephemeral, scoped to one local server process, and is not a Backend credential.
402
443
  ## Dataset package instances
403
444
 
404
445
  Managed and External Dataset declarations use the same `ci deploy`, `ci package
405
- install` and `ci package update --setup-file` commands described above. Author the
446
+ install` and `ci package update --inputs` commands described above. Author the
406
447
  required lifecycle and existing provider FQN with the [SDK Dataset examples](../extensions-sdk/README.md#concrete-managed-and-external-datasets).
407
448
  Connection setup remains private input; the release references its `setupKey`.
408
449
  Gateway-backed sources require existing manifest approval before admission.