@stackone/cli 1.11.0 → 1.12.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.
package/README.md CHANGED
@@ -130,6 +130,88 @@ stackone drop <connector> --api-key <your-api-key> --api-url <api-url>
130
130
  - **Precise targeting**: Delete specific connector versions without affecting other versions
131
131
  - **Clear feedback**: Informative success and error messages with color-coded output
132
132
 
133
+ ### `get`
134
+
135
+ Get (download) a connector from the StackOne registry. This command can use either a configuration profile created with the `init` command or provide credentials directly via command-line options.
136
+
137
+ ```bash
138
+ stackone get --connector my-provider@1.0.0 --profile <profile-label>
139
+ ```
140
+
141
+ or using direct credentials:
142
+
143
+ ```bash
144
+ stackone get --connector my-provider@1.0.0 --api-key <your-api-key>
145
+ ```
146
+
147
+ or fetch from an account:
148
+
149
+ ```bash
150
+ stackone get --account-id acc_123 --profile <profile-label>
151
+ ```
152
+
153
+ **Options:**
154
+
155
+ - `--connector <connector>` - Connector identifier in format `provider_key@version` (e.g., `my-provider@1.0.0`)
156
+ - `--account-id <account-id>` - Account ID to fetch the connector from
157
+ - `-f, --format <format>` - Output format: `yaml` or `json` (default: `yaml`)
158
+ - `-o, --output-file <output-file>` - File path to write the connector to (if not specified, outputs to stdout)
159
+ - `-p, --profile <label>` - Configuration profile to use
160
+ - `--api-key <api-key>` - API key to use for authentication (alternative to using a profile)
161
+ - `--api-url <api-url>` - API URL to use (defaults to `https://api.stackone.com` if not specified)
162
+
163
+ **Note:**
164
+
165
+ - You must provide either `--profile` or `--api-key`. If using `--api-key`, the `--api-url` option is optional and will default to the production API URL.
166
+ - You must provide either `--connector` or `--account-id`, but not both.
167
+
168
+ **Usage Examples:**
169
+
170
+ 1. **Get connector from registry with profile:**
171
+
172
+ ```bash
173
+ stackone get --connector my-provider@1.0.0 --profile production
174
+ ```
175
+
176
+ 2. **Get connector from registry with API key:**
177
+
178
+ ```bash
179
+ stackone get --connector my-provider@1.0.0 --api-key your-api-key
180
+ ```
181
+
182
+ 3. **Get connector from account:**
183
+
184
+ ```bash
185
+ stackone get --account-id acc_123 --profile production
186
+ ```
187
+
188
+ 4. **Get connector in JSON format:**
189
+
190
+ ```bash
191
+ stackone get --connector my-provider@1.0.0 --profile production --format json
192
+ ```
193
+
194
+ 5. **Get connector and save to file:**
195
+
196
+ ```bash
197
+ stackone get --connector my-provider@1.0.0 --profile production --output-file my-connector.s1.yaml
198
+ ```
199
+
200
+ 6. **Get connector with custom API URL:**
201
+
202
+ ```bash
203
+ stackone get --connector my-provider@1.0.0 --api-key your-api-key --api-url https://staging.api.stackone.com
204
+ ```
205
+
206
+ **Features:**
207
+
208
+ - **Flexible authentication**: Use either a saved profile or provide credentials directly
209
+ - **Multiple sources**: Fetch connectors from registry by identifier or from specific accounts
210
+ - **Format conversion**: Output in YAML (default) or JSON format
211
+ - **File output**: Save to file or output to stdout for piping
212
+ - **Profile validation**: Ensures the specified profile exists before fetching (when using `--profile`)
213
+ - **Clear feedback**: Informative success and error messages with color-coded output
214
+
133
215
  ### `validate`
134
216
 
135
217
  Validate a StackOne connector file:
@@ -158,57 +240,97 @@ Execute a connector action locally with full control over connector configuratio
158
240
  stackone run --connector path/to/connector.s1.yaml --account-id <account-id> --profile <profile-label>
159
241
  ```
160
242
 
243
+ or using direct credentials:
244
+
245
+ ```bash
246
+ stackone run --account-id <account-id> --api-key <your-api-key>
247
+ ```
248
+
161
249
  **Options:**
162
250
 
163
- - `--connector <connector>` - Path to the connector file to run, or inline connector YAML string
251
+ - `--connector <connector>` - Path to the connector file to run, inline connector YAML string, or connector identifier in format `provider_key@version` to fetch from registry (optional when using `--account-id`, the connector will be fetched from account API)
164
252
  - `--action <action>` - Path to an action file or inline action YAML code to add to the connector
165
253
  - `--action-id <action-id>` - Specific action ID to execute. If not provided, the last action in the connector will be executed
166
254
  - `--account <account>` - Path to a JSON file with account details or inline JSON string (see Account Format below)
167
- - `--account-id <account-id>` - Account ID to fetch from StackOne API (requires `--profile`)
255
+ - `--account-id <account-id>` - Account ID to fetch from StackOne API (requires either `--profile` or `--api-key`). When provided without `--connector`, the connector will also be fetched from the API
168
256
  - `--params <params>` - Path to a JSON file with action parameters or inline JSON string (see Parameters Format below)
169
257
  - `--credentials <credentials>` - Path to a JSON file with credentials or inline JSON string (see Credentials Format below)
170
- - `-p, --profile <label>` - Configuration profile to use (required when using `--account-id`)
258
+ - `-p, --profile <label>` - Configuration profile to use
259
+ - `--api-key <api-key>` - API key to use for authentication (alternative to using a profile)
260
+ - `--api-url <api-url>` - API URL to use (defaults to `https://api.stackone.com` if not specified)
171
261
  - `-o, --output-file <output-file>` - File path to write the execution output to (JSON format)
172
262
  - `-d, --debug` - Enable debug mode to include execution steps and detailed information in the output
173
263
 
264
+ **Note:** You must provide either `--profile` or `--api-key` when using `--account-id`. If using `--api-key`, the `--api-url` option is optional and will default to the production API URL.
265
+
174
266
  **Usage Examples:**
175
267
 
176
- 1. **Run with account from API:**
268
+ 1. **Run with account from API using profile (connector fetched automatically):**
177
269
 
178
270
  ```bash
179
- stackone run --connector connector.s1.yaml --account-id acc_123 --profile production
271
+ stackone run --account-id acc_123 --profile production
180
272
  ```
181
273
 
182
- 2. **Run with local account file & credentials:**
274
+ 2. **Run with account from API using API key (connector fetched automatically):**
183
275
 
184
276
  ```bash
185
- stackone run --connector connector.s1.yaml --account account.json --credentials credentials.json
277
+ stackone run --account-id acc_123 --api-key your-api-key
186
278
  ```
187
279
 
188
- 3. **Run with inline account data:**
280
+ 3. **Run with custom API URL:**
189
281
 
190
282
  ```bash
191
- stackone run --connector connector.s1.yaml --account '{"auth_config_key":"basic","credentials":{"username":"user","password":"pass"}}'
283
+ stackone run --account-id acc_123 --api-key your-api-key --api-url https://staging.api.stackone.com
192
284
  ```
193
285
 
194
- 4. **Run specific action with parameters:**
286
+ 4. **Run with connector identifier from registry:**
195
287
 
196
288
  ```bash
197
- stackone run --connector connector.s1.yaml --action-id list_employees --account-id acc_123 --profile production --params params.json
289
+ stackone run --connector my-provider@1.0.0 --account account.json --api-key your-api-key
198
290
  ```
199
291
 
200
- 5. **Run with custom action file:**
292
+ 5. **Run with connector from registry and account from API:**
201
293
 
202
294
  ```bash
203
- stackone run --connector connector.s1.yaml --action custom-action.yaml --account account.json
295
+ stackone run --connector my-provider@1.0.0 --account-id acc_123 --profile production
204
296
  ```
205
297
 
206
- 6. **Run with debug mode and output to file:**
298
+ 6. **Run with account from API and specific connector file:**
207
299
 
208
300
  ```bash
209
- stackone run --connector connector.s1.yaml --account-id acc_123 --profile production --debug --output-file result.json
301
+ stackone run --connector connector.s1.yaml --account-id acc_123 --profile production
210
302
  ```
211
303
 
304
+ 7. **Run with local account file & credentials:**
305
+
306
+ ```bash
307
+ stackone run --connector connector.s1.yaml --account account.json --credentials credentials.json
308
+ ```
309
+
310
+ 8. **Run with inline account data:**
311
+
312
+ ```bash
313
+ stackone run --connector connector.s1.yaml --account '{"auth_config_key":"basic","credentials":{"username":"user","password":"pass"}}'
314
+ ```
315
+
316
+ 9. **Run specific action with parameters using API key (connector auto-fetched):**
317
+
318
+ ```bash
319
+ stackone run --action-id list_employees --account-id acc_123 --api-key your-api-key --params params.json
320
+ ```
321
+
322
+ 10. **Run with custom action file:**
323
+
324
+ ```bash
325
+ stackone run --connector connector.s1.yaml --action custom-action.yaml --account account.json
326
+ ```
327
+
328
+ 11. **Run with debug mode and output to file (connector auto-fetched):**
329
+
330
+ ```bash
331
+ stackone run --account-id acc_123 --profile production --debug --output-file result.json
332
+ ```
333
+
212
334
  **Account Format** (JSON):
213
335
 
214
336
  When using `--account` with a file or inline JSON, use this structure:
@@ -267,13 +389,19 @@ All fields are optional and default to empty objects `{}`.
267
389
  **Requirements:**
268
390
 
269
391
  - Either `--account` or `--account-id` must be provided
270
- - When using `--account-id`, the `--profile` option is required
392
+ - When using `--account-id`, either `--profile` or `--api-key` is required
393
+ - When using connector identifier format (`provider_key@version`), either `--profile` or `--api-key` is required
394
+ - You must provide either `--profile` or `--api-key`, not both
271
395
  - When using `--action`, the `--connector` option is required
272
- - A valid connector is required (via `--connector` or inferred from action)
396
+ - A connector can be provided via:
397
+ - `--connector` with a file path or inline YAML
398
+ - `--connector` with identifier format (`provider_key@version`) to fetch from registry
399
+ - Automatically fetched from account API when using `--account-id` without `--connector`
273
400
 
274
401
  **Features:**
275
402
 
276
- - **Flexible connector loading**: Load from file path or provide inline YAML
403
+ - **Flexible connector loading**: Load from file path, provide inline YAML, fetch from registry using `provider_key@version` identifier, or auto-fetch from API using account ID
404
+ - **Flexible authentication**: Use either a saved profile or provide credentials directly via command-line options
277
405
  - **Dynamic action injection**: Add custom actions to existing connectors on-the-fly
278
406
  - **Multiple authentication methods**: Use API-fetched accounts or local account data
279
407
  - **Credential override**: Merge or override credentials at runtime
package/dist/cli.cjs CHANGED
@@ -1,2 +1,2 @@
1
1
  #!/usr/bin/env node
2
- const e=require(`./cliCore-CXBqMdiv.cjs`),t=new e.CLI;t.run();
2
+ const e=require(`./cliCore-CdUkuL9P.cjs`),t=new e.CLI;t.run();
package/dist/cli.js CHANGED
@@ -1,2 +1,2 @@
1
1
  #!/usr/bin/env node
2
- import{CLI as e}from"./cliCore-DRnQtnk3.js";const t=new e;t.run();
2
+ import{CLI as e}from"./cliCore-C6WfW_Zy.js";const t=new e;t.run();