workos 0.7.3 → 0.8.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 +353 -8
- package/dist/bin.js +938 -128
- package/dist/bin.js.map +1 -1
- package/dist/commands/api-key-mgmt.d.ts +16 -0
- package/dist/commands/api-key-mgmt.js +96 -0
- package/dist/commands/api-key-mgmt.js.map +1 -0
- package/dist/commands/audit-log.d.ts +26 -0
- package/dist/commands/audit-log.js +155 -0
- package/dist/commands/audit-log.js.map +1 -0
- package/dist/commands/config.d.ts +3 -0
- package/dist/commands/config.js +54 -0
- package/dist/commands/config.js.map +1 -0
- package/dist/commands/connection.d.ts +13 -0
- package/dist/commands/connection.js +94 -0
- package/dist/commands/connection.js.map +1 -0
- package/dist/commands/debug-sso.d.ts +1 -0
- package/dist/commands/debug-sso.js +78 -0
- package/dist/commands/debug-sso.js.map +1 -0
- package/dist/commands/debug-sync.d.ts +1 -0
- package/dist/commands/debug-sync.js +102 -0
- package/dist/commands/debug-sync.js.map +1 -0
- package/dist/commands/directory.d.ts +27 -0
- package/dist/commands/directory.js +174 -0
- package/dist/commands/directory.js.map +1 -0
- package/dist/commands/env.js +41 -28
- package/dist/commands/env.js.map +1 -1
- package/dist/commands/event.d.ts +9 -0
- package/dist/commands/event.js +43 -0
- package/dist/commands/event.js.map +1 -0
- package/dist/commands/feature-flag.d.ts +12 -0
- package/dist/commands/feature-flag.js +96 -0
- package/dist/commands/feature-flag.js.map +1 -0
- package/dist/commands/install.js +13 -20
- package/dist/commands/install.js.map +1 -1
- package/dist/commands/invitation.d.ts +19 -0
- package/dist/commands/invitation.js +94 -0
- package/dist/commands/invitation.js.map +1 -0
- package/dist/commands/membership.d.ts +20 -0
- package/dist/commands/membership.js +129 -0
- package/dist/commands/membership.js.map +1 -0
- package/dist/commands/onboard-user.d.ts +7 -0
- package/dist/commands/onboard-user.js +61 -0
- package/dist/commands/onboard-user.js.map +1 -0
- package/dist/commands/org-domain.d.ts +4 -0
- package/dist/commands/org-domain.js +45 -0
- package/dist/commands/org-domain.js.map +1 -0
- package/dist/commands/organization.d.ts +1 -5
- package/dist/commands/organization.js +34 -73
- package/dist/commands/organization.js.map +1 -1
- package/dist/commands/permission.d.ts +20 -0
- package/dist/commands/permission.js +93 -0
- package/dist/commands/permission.js.map +1 -0
- package/dist/commands/portal.d.ts +7 -0
- package/dist/commands/portal.js +26 -0
- package/dist/commands/portal.js.map +1 -0
- package/dist/commands/role.d.ts +17 -0
- package/dist/commands/role.js +122 -0
- package/dist/commands/role.js.map +1 -0
- package/dist/commands/seed.d.ts +4 -0
- package/dist/commands/seed.js +238 -0
- package/dist/commands/seed.js.map +1 -0
- package/dist/commands/session.d.ts +8 -0
- package/dist/commands/session.js +63 -0
- package/dist/commands/session.js.map +1 -0
- package/dist/commands/setup-org.d.ts +6 -0
- package/dist/commands/setup-org.js +99 -0
- package/dist/commands/setup-org.js.map +1 -0
- package/dist/commands/user.js +35 -71
- package/dist/commands/user.js.map +1 -1
- package/dist/commands/vault.d.ts +24 -0
- package/dist/commands/vault.js +120 -0
- package/dist/commands/vault.js.map +1 -0
- package/dist/commands/webhook.d.ts +3 -0
- package/dist/commands/webhook.js +73 -0
- package/dist/commands/webhook.js.map +1 -0
- package/dist/dashboard/components/DiffPanel.js.map +1 -1
- package/dist/dashboard/lib/logo-frames.js +1 -1
- package/dist/dashboard/lib/logo-frames.js.map +1 -1
- package/dist/doctor/checks/dashboard.js.map +1 -1
- package/dist/doctor/checks/environment.js.map +1 -1
- package/dist/integrations/go/index.js +1 -3
- package/dist/integrations/go/index.js.map +1 -1
- package/dist/lib/adapters/headless-adapter.d.ts +67 -0
- package/dist/lib/adapters/headless-adapter.js +263 -0
- package/dist/lib/adapters/headless-adapter.js.map +1 -0
- package/dist/lib/adapters/index.d.ts +1 -0
- package/dist/lib/adapters/index.js +1 -0
- package/dist/lib/adapters/index.js.map +1 -1
- package/dist/lib/agent-interface.d.ts +3 -11
- package/dist/lib/agent-interface.js +1 -13
- package/dist/lib/agent-interface.js.map +1 -1
- package/dist/lib/api-error-handler.d.ts +6 -0
- package/dist/lib/api-error-handler.js +58 -0
- package/dist/lib/api-error-handler.js.map +1 -0
- package/dist/lib/api-key.js +5 -1
- package/dist/lib/api-key.js.map +1 -1
- package/dist/lib/config.js.map +1 -1
- package/dist/lib/credential-proxy.js +0 -6
- package/dist/lib/credential-proxy.js.map +1 -1
- package/dist/lib/device-auth.js +1 -1
- package/dist/lib/device-auth.js.map +1 -1
- package/dist/lib/ensure-auth.js +25 -4
- package/dist/lib/ensure-auth.js.map +1 -1
- package/dist/lib/installer-core.d.ts +12 -12
- package/dist/lib/run-with-core.js +25 -4
- package/dist/lib/run-with-core.js.map +1 -1
- package/dist/lib/validation/validator.js +0 -1
- package/dist/lib/validation/validator.js.map +1 -1
- package/dist/lib/workos-client.d.ts +58 -0
- package/dist/lib/workos-client.js +137 -0
- package/dist/lib/workos-client.js.map +1 -0
- package/dist/run.d.ts +7 -0
- package/dist/run.js +5 -2
- package/dist/run.js.map +1 -1
- package/dist/smoke-test.ts +881 -0
- package/dist/steps/run-prettier.js +1 -1
- package/dist/steps/run-prettier.js.map +1 -1
- package/dist/utils/analytics.d.ts +1 -1
- package/dist/utils/analytics.js.map +1 -1
- package/dist/utils/clack-utils.js +1 -1
- package/dist/utils/clack-utils.js.map +1 -1
- package/dist/utils/environment.js +8 -0
- package/dist/utils/environment.js.map +1 -1
- package/dist/utils/exit-codes.d.ts +22 -0
- package/dist/utils/exit-codes.js +30 -0
- package/dist/utils/exit-codes.js.map +1 -0
- package/dist/utils/help-json.d.ts +45 -0
- package/dist/utils/help-json.js +1161 -0
- package/dist/utils/help-json.js.map +1 -0
- package/dist/utils/ndjson.d.ts +16 -0
- package/dist/utils/ndjson.js +18 -0
- package/dist/utils/ndjson.js.map +1 -0
- package/dist/utils/output.d.ts +40 -0
- package/dist/utils/output.js +95 -0
- package/dist/utils/output.js.map +1 -0
- package/dist/utils/package-manager.js +2 -3
- package/dist/utils/package-manager.js.map +1 -1
- package/dist/utils/register-subcommand.d.ts +7 -0
- package/dist/utils/register-subcommand.js +36 -0
- package/dist/utils/register-subcommand.js.map +1 -0
- package/dist/utils/telemetry-types.d.ts +1 -1
- package/dist/utils/telemetry-types.js.map +1 -1
- package/dist/utils/types.d.ts +12 -0
- package/dist/utils/types.js.map +1 -1
- package/package.json +20 -16
- package/skills/workos-management/SKILL.md +250 -0
package/README.md
CHANGED
|
@@ -21,6 +21,7 @@ workos
|
|
|
21
21
|
- **Smart Detection:** Auto-detects framework, package manager, router type
|
|
22
22
|
- **Live Documentation:** Fetches latest SDK docs from WorkOS and GitHub
|
|
23
23
|
- **Full Integration:** Creates routes, middleware, environment vars, and UI
|
|
24
|
+
- **Agent & CI Ready:** Non-TTY auto-detection, JSON output, structured errors, headless installer with NDJSON streaming
|
|
24
25
|
|
|
25
26
|
## What It Creates
|
|
26
27
|
|
|
@@ -49,14 +50,127 @@ workos [command]
|
|
|
49
50
|
|
|
50
51
|
Commands:
|
|
51
52
|
install Install WorkOS AuthKit into your project
|
|
52
|
-
|
|
53
|
-
login Authenticate with WorkOS via Connect OAuth device flow
|
|
53
|
+
login Authenticate with WorkOS via browser OAuth
|
|
54
54
|
logout Remove stored credentials
|
|
55
55
|
env Manage environment configurations
|
|
56
|
-
organization Manage organizations
|
|
57
|
-
user Manage users
|
|
58
56
|
doctor Diagnose WorkOS integration issues
|
|
59
57
|
install-skill Install AuthKit skills to coding agents
|
|
58
|
+
|
|
59
|
+
Resource Management:
|
|
60
|
+
organization (org) Manage organizations
|
|
61
|
+
user Manage users
|
|
62
|
+
role Manage roles (RBAC)
|
|
63
|
+
permission Manage permissions (RBAC)
|
|
64
|
+
membership Manage organization memberships
|
|
65
|
+
invitation Manage user invitations
|
|
66
|
+
session Manage user sessions
|
|
67
|
+
connection Manage SSO connections
|
|
68
|
+
directory Manage directory sync
|
|
69
|
+
event Query events
|
|
70
|
+
audit-log Manage audit logs
|
|
71
|
+
feature-flag Manage feature flags
|
|
72
|
+
webhook Manage webhooks
|
|
73
|
+
config Manage redirect URIs, CORS, homepage URL
|
|
74
|
+
portal Generate Admin Portal links
|
|
75
|
+
vault Manage encrypted secrets
|
|
76
|
+
api-key Manage per-org API keys
|
|
77
|
+
org-domain Manage organization domains
|
|
78
|
+
|
|
79
|
+
Workflows:
|
|
80
|
+
seed Declarative resource provisioning from YAML
|
|
81
|
+
setup-org One-shot organization onboarding
|
|
82
|
+
onboard-user Send invitation and assign role
|
|
83
|
+
debug-sso Diagnose SSO connection issues
|
|
84
|
+
debug-sync Diagnose directory sync issues
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
All management commands support `--json` for structured output (auto-enabled in non-TTY) and `--api-key` to override the active environment's key.
|
|
88
|
+
|
|
89
|
+
### Workflows
|
|
90
|
+
|
|
91
|
+
The compound workflow commands compose multiple API calls into common operations. These are the highest-value commands for both developers and AI agents.
|
|
92
|
+
|
|
93
|
+
#### seed — Declarative resource provisioning
|
|
94
|
+
|
|
95
|
+
Provision permissions, roles, organizations, and config from a YAML file. Tracks created resources for clean teardown.
|
|
96
|
+
|
|
97
|
+
```bash
|
|
98
|
+
# Apply a seed file
|
|
99
|
+
workos seed --file workos-seed.yml
|
|
100
|
+
|
|
101
|
+
# Tear down everything the seed created (reads .workos-seed-state.json)
|
|
102
|
+
workos seed --clean
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
Example `workos-seed.yml`:
|
|
106
|
+
|
|
107
|
+
```yaml
|
|
108
|
+
permissions:
|
|
109
|
+
- name: Read Posts
|
|
110
|
+
slug: posts:read
|
|
111
|
+
- name: Write Posts
|
|
112
|
+
slug: posts:write
|
|
113
|
+
|
|
114
|
+
roles:
|
|
115
|
+
- name: Editor
|
|
116
|
+
slug: editor
|
|
117
|
+
permissions: [posts:read, posts:write]
|
|
118
|
+
- name: Viewer
|
|
119
|
+
slug: viewer
|
|
120
|
+
permissions: [posts:read]
|
|
121
|
+
|
|
122
|
+
organizations:
|
|
123
|
+
- name: Acme Corp
|
|
124
|
+
domains: [acme.com]
|
|
125
|
+
|
|
126
|
+
config:
|
|
127
|
+
redirect_uris:
|
|
128
|
+
- http://localhost:3000/callback
|
|
129
|
+
cors_origins:
|
|
130
|
+
- http://localhost:3000
|
|
131
|
+
homepage_url: http://localhost:3000
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
Resources are created in dependency order (permissions → roles → organizations → config). State is tracked in `.workos-seed-state.json` so `--clean` removes exactly what was created.
|
|
135
|
+
|
|
136
|
+
#### setup-org — One-shot organization onboarding
|
|
137
|
+
|
|
138
|
+
Creates an organization with optional domain verification, roles, and an Admin Portal link in a single command.
|
|
139
|
+
|
|
140
|
+
```bash
|
|
141
|
+
# Minimal: just create the org
|
|
142
|
+
workos setup-org "Acme Corp"
|
|
143
|
+
|
|
144
|
+
# Full: org + domain + roles + portal link
|
|
145
|
+
workos setup-org "Acme Corp" --domain acme.com --roles admin,viewer
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
#### onboard-user — User invitation workflow
|
|
149
|
+
|
|
150
|
+
Sends an invitation to a user with an optional role assignment. With `--wait`, polls until the invitation is accepted.
|
|
151
|
+
|
|
152
|
+
```bash
|
|
153
|
+
# Send invitation
|
|
154
|
+
workos onboard-user alice@acme.com --org org_01ABC123
|
|
155
|
+
|
|
156
|
+
# Send with role and wait for acceptance
|
|
157
|
+
workos onboard-user alice@acme.com --org org_01ABC123 --role admin --wait
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
#### debug-sso — SSO connection diagnostics
|
|
161
|
+
|
|
162
|
+
Inspects an SSO connection's state and recent authentication events. Flags inactive connections and surfaces auth event history for debugging.
|
|
163
|
+
|
|
164
|
+
```bash
|
|
165
|
+
workos debug-sso conn_01ABC123
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
#### debug-sync — Directory sync diagnostics
|
|
169
|
+
|
|
170
|
+
Inspects a directory's sync state, user/group counts, recent events, and detects stalled syncs.
|
|
171
|
+
|
|
172
|
+
```bash
|
|
173
|
+
workos debug-sync directory_01ABC123
|
|
60
174
|
```
|
|
61
175
|
|
|
62
176
|
### Environment Management
|
|
@@ -70,7 +184,11 @@ workos env list # List environments with active indicator
|
|
|
70
184
|
|
|
71
185
|
API keys are stored in the system keychain via `@napi-rs/keyring`, with a JSON file fallback at `~/.workos/config.json`.
|
|
72
186
|
|
|
73
|
-
###
|
|
187
|
+
### Resource Management
|
|
188
|
+
|
|
189
|
+
All resource commands follow the same pattern: `workos <resource> <action> [args] [--options]`. API keys resolve via: `WORKOS_API_KEY` env var → `--api-key` flag → active environment's stored key.
|
|
190
|
+
|
|
191
|
+
#### organization
|
|
74
192
|
|
|
75
193
|
```bash
|
|
76
194
|
workos organization create <name> [domain:state ...]
|
|
@@ -80,16 +198,165 @@ workos organization list [--domain] [--limit] [--before] [--after] [--order]
|
|
|
80
198
|
workos organization delete <orgId>
|
|
81
199
|
```
|
|
82
200
|
|
|
83
|
-
|
|
201
|
+
#### user
|
|
84
202
|
|
|
85
203
|
```bash
|
|
86
204
|
workos user get <userId>
|
|
87
|
-
workos user list [--email] [--organization] [--limit]
|
|
205
|
+
workos user list [--email] [--organization] [--limit]
|
|
88
206
|
workos user update <userId> [--first-name] [--last-name] [--email-verified] [--password] [--external-id]
|
|
89
207
|
workos user delete <userId>
|
|
90
208
|
```
|
|
91
209
|
|
|
92
|
-
|
|
210
|
+
#### role
|
|
211
|
+
|
|
212
|
+
```bash
|
|
213
|
+
workos role list [--org <orgId>]
|
|
214
|
+
workos role get <slug> [--org <orgId>]
|
|
215
|
+
workos role create --slug <slug> --name <name> [--org <orgId>]
|
|
216
|
+
workos role update <slug> [--name] [--description] [--org <orgId>]
|
|
217
|
+
workos role delete <slug> --org <orgId>
|
|
218
|
+
workos role set-permissions <slug> --permissions <slugs> [--org <orgId>]
|
|
219
|
+
workos role add-permission <slug> <permissionSlug> [--org <orgId>]
|
|
220
|
+
workos role remove-permission <slug> <permissionSlug> --org <orgId>
|
|
221
|
+
```
|
|
222
|
+
|
|
223
|
+
#### permission
|
|
224
|
+
|
|
225
|
+
```bash
|
|
226
|
+
workos permission list [--limit]
|
|
227
|
+
workos permission get <slug>
|
|
228
|
+
workos permission create --slug <slug> --name <name> [--description]
|
|
229
|
+
workos permission update <slug> [--name] [--description]
|
|
230
|
+
workos permission delete <slug>
|
|
231
|
+
```
|
|
232
|
+
|
|
233
|
+
#### membership
|
|
234
|
+
|
|
235
|
+
```bash
|
|
236
|
+
workos membership list [--org] [--user] [--limit]
|
|
237
|
+
workos membership get <id>
|
|
238
|
+
workos membership create --org <orgId> --user <userId> [--role]
|
|
239
|
+
workos membership update <id> [--role]
|
|
240
|
+
workos membership delete <id>
|
|
241
|
+
workos membership deactivate <id>
|
|
242
|
+
workos membership reactivate <id>
|
|
243
|
+
```
|
|
244
|
+
|
|
245
|
+
#### invitation
|
|
246
|
+
|
|
247
|
+
```bash
|
|
248
|
+
workos invitation list [--org] [--email] [--limit]
|
|
249
|
+
workos invitation get <id>
|
|
250
|
+
workos invitation send --email <email> [--org] [--role] [--expires-in-days]
|
|
251
|
+
workos invitation revoke <id>
|
|
252
|
+
workos invitation resend <id>
|
|
253
|
+
```
|
|
254
|
+
|
|
255
|
+
#### session
|
|
256
|
+
|
|
257
|
+
```bash
|
|
258
|
+
workos session list <userId> [--limit]
|
|
259
|
+
workos session revoke <sessionId>
|
|
260
|
+
```
|
|
261
|
+
|
|
262
|
+
#### connection
|
|
263
|
+
|
|
264
|
+
```bash
|
|
265
|
+
workos connection list [--org] [--type] [--limit]
|
|
266
|
+
workos connection get <id>
|
|
267
|
+
workos connection delete <id> [--force]
|
|
268
|
+
```
|
|
269
|
+
|
|
270
|
+
#### directory
|
|
271
|
+
|
|
272
|
+
```bash
|
|
273
|
+
workos directory list [--org] [--limit]
|
|
274
|
+
workos directory get <id>
|
|
275
|
+
workos directory delete <id> [--force]
|
|
276
|
+
workos directory list-users [--directory] [--group] [--limit]
|
|
277
|
+
workos directory list-groups --directory <id> [--limit]
|
|
278
|
+
```
|
|
279
|
+
|
|
280
|
+
#### event
|
|
281
|
+
|
|
282
|
+
```bash
|
|
283
|
+
workos event list --events <types> [--org] [--range-start] [--range-end] [--limit]
|
|
284
|
+
```
|
|
285
|
+
|
|
286
|
+
#### audit-log
|
|
287
|
+
|
|
288
|
+
```bash
|
|
289
|
+
workos audit-log create-event <orgId> --action <action> --actor-type <type> --actor-id <id> [--file <json>]
|
|
290
|
+
workos audit-log export --org <orgId> --range-start <date> --range-end <date> [--actions] [--actor-names]
|
|
291
|
+
workos audit-log list-actions
|
|
292
|
+
workos audit-log get-schema <action>
|
|
293
|
+
workos audit-log create-schema <action> --file <schema.json>
|
|
294
|
+
workos audit-log get-retention <orgId>
|
|
295
|
+
```
|
|
296
|
+
|
|
297
|
+
#### feature-flag
|
|
298
|
+
|
|
299
|
+
```bash
|
|
300
|
+
workos feature-flag list [--limit]
|
|
301
|
+
workos feature-flag get <slug>
|
|
302
|
+
workos feature-flag enable <slug>
|
|
303
|
+
workos feature-flag disable <slug>
|
|
304
|
+
workos feature-flag add-target <slug> <targetId>
|
|
305
|
+
workos feature-flag remove-target <slug> <targetId>
|
|
306
|
+
```
|
|
307
|
+
|
|
308
|
+
#### webhook
|
|
309
|
+
|
|
310
|
+
```bash
|
|
311
|
+
workos webhook list
|
|
312
|
+
workos webhook create --url <endpoint> --events <types>
|
|
313
|
+
workos webhook delete <id>
|
|
314
|
+
```
|
|
315
|
+
|
|
316
|
+
#### config
|
|
317
|
+
|
|
318
|
+
```bash
|
|
319
|
+
workos config redirect add <uri>
|
|
320
|
+
workos config cors add <origin>
|
|
321
|
+
workos config homepage-url set <url>
|
|
322
|
+
```
|
|
323
|
+
|
|
324
|
+
#### portal
|
|
325
|
+
|
|
326
|
+
```bash
|
|
327
|
+
workos portal generate-link --intent <intent> --org <orgId> [--return-url] [--success-url]
|
|
328
|
+
```
|
|
329
|
+
|
|
330
|
+
#### vault
|
|
331
|
+
|
|
332
|
+
```bash
|
|
333
|
+
workos vault list [--limit]
|
|
334
|
+
workos vault get <id>
|
|
335
|
+
workos vault get-by-name <name>
|
|
336
|
+
workos vault create --name <name> --value <secret> [--org <orgId>]
|
|
337
|
+
workos vault update <id> --value <secret> [--version-check]
|
|
338
|
+
workos vault delete <id>
|
|
339
|
+
workos vault describe <id>
|
|
340
|
+
workos vault list-versions <id>
|
|
341
|
+
```
|
|
342
|
+
|
|
343
|
+
#### api-key
|
|
344
|
+
|
|
345
|
+
```bash
|
|
346
|
+
workos api-key list --org <orgId> [--limit]
|
|
347
|
+
workos api-key create --org <orgId> --name <name> [--permissions]
|
|
348
|
+
workos api-key validate <value>
|
|
349
|
+
workos api-key delete <id>
|
|
350
|
+
```
|
|
351
|
+
|
|
352
|
+
#### org-domain
|
|
353
|
+
|
|
354
|
+
```bash
|
|
355
|
+
workos org-domain get <id>
|
|
356
|
+
workos org-domain create <domain> --org <orgId>
|
|
357
|
+
workos org-domain verify <id>
|
|
358
|
+
workos org-domain delete <id>
|
|
359
|
+
```
|
|
93
360
|
|
|
94
361
|
### Installer Options
|
|
95
362
|
|
|
@@ -98,10 +365,16 @@ workos install [options]
|
|
|
98
365
|
|
|
99
366
|
--direct, -D Use your own Anthropic API key (bypass llm-gateway)
|
|
100
367
|
--integration <name> Framework: nextjs, react, react-router, tanstack-start, vanilla-js
|
|
368
|
+
--api-key <key> WorkOS API key (required in non-interactive mode)
|
|
369
|
+
--client-id <id> WorkOS client ID (required in non-interactive mode)
|
|
101
370
|
--redirect-uri <uri> Custom redirect URI
|
|
102
371
|
--homepage-url <url> Custom homepage URL
|
|
103
372
|
--install-dir <path> Installation directory
|
|
104
373
|
--no-validate Skip post-installation validation
|
|
374
|
+
--no-branch Skip branch creation (use current branch)
|
|
375
|
+
--no-commit Skip auto-commit after installation
|
|
376
|
+
--create-pr Auto-create pull request after installation
|
|
377
|
+
--no-git-check Skip git dirty working tree check
|
|
105
378
|
--force-install Force install packages even if peer dependency checks fail
|
|
106
379
|
--debug Enable verbose logging
|
|
107
380
|
```
|
|
@@ -117,6 +390,78 @@ npx workos --integration react-router
|
|
|
117
390
|
|
|
118
391
|
# With visual dashboard (experimental)
|
|
119
392
|
npx workos dashboard
|
|
393
|
+
|
|
394
|
+
# JSON output (explicit)
|
|
395
|
+
workos org list --json --api-key sk_test_xxx
|
|
396
|
+
|
|
397
|
+
# Pipe-friendly (auto-detects non-TTY)
|
|
398
|
+
workos org list --api-key sk_test_xxx | jq '.data[].name'
|
|
399
|
+
|
|
400
|
+
# Machine-readable command discovery
|
|
401
|
+
workos --help --json | jq '.commands[].name'
|
|
402
|
+
```
|
|
403
|
+
|
|
404
|
+
## Scripting & Automation
|
|
405
|
+
|
|
406
|
+
The CLI auto-detects non-TTY environments (piped output, CI, coding agents) and switches to machine-friendly behavior. No flags required — just pipe it.
|
|
407
|
+
|
|
408
|
+
### JSON Output
|
|
409
|
+
|
|
410
|
+
All commands produce structured JSON when piped or with `--json`:
|
|
411
|
+
|
|
412
|
+
```bash
|
|
413
|
+
workos org list --api-key sk_test_xxx | jq .
|
|
414
|
+
# → { "data": [...], "list_metadata": { "before": null, "after": "..." } }
|
|
415
|
+
|
|
416
|
+
workos env list --json
|
|
417
|
+
# → { "data": [{ "name": "prod", "type": "production", "active": true, ... }] }
|
|
418
|
+
```
|
|
419
|
+
|
|
420
|
+
Errors go to stderr as structured JSON:
|
|
421
|
+
|
|
422
|
+
```bash
|
|
423
|
+
workos org list 2>&1
|
|
424
|
+
# → { "error": { "code": "no_api_key", "message": "No API key configured..." } }
|
|
425
|
+
```
|
|
426
|
+
|
|
427
|
+
### Headless Installer
|
|
428
|
+
|
|
429
|
+
In non-TTY, the installer streams progress as NDJSON (one JSON object per line):
|
|
430
|
+
|
|
431
|
+
```bash
|
|
432
|
+
workos install --api-key sk_test_xxx --client-id client_xxx --no-commit 2>/dev/null
|
|
433
|
+
# → {"type":"detection:complete","integration":"nextjs","timestamp":"..."}
|
|
434
|
+
# → {"type":"agent:start","timestamp":"..."}
|
|
435
|
+
# → {"type":"agent:progress","message":"...","timestamp":"..."}
|
|
436
|
+
# → {"type":"complete","success":true,"timestamp":"..."}
|
|
437
|
+
```
|
|
438
|
+
|
|
439
|
+
### Exit Codes
|
|
440
|
+
|
|
441
|
+
| Code | Meaning |
|
|
442
|
+
| ---- | ----------------------- |
|
|
443
|
+
| 0 | Success |
|
|
444
|
+
| 1 | General error |
|
|
445
|
+
| 2 | Cancelled |
|
|
446
|
+
| 4 | Authentication required |
|
|
447
|
+
|
|
448
|
+
### Environment Variables
|
|
449
|
+
|
|
450
|
+
| Variable | Effect |
|
|
451
|
+
| ------------------------ | -------------------------------------------------------- |
|
|
452
|
+
| `WORKOS_API_KEY` | API key for management commands (bypasses stored config) |
|
|
453
|
+
| `WORKOS_NO_PROMPT=1` | Force non-interactive mode + JSON output |
|
|
454
|
+
| `WORKOS_FORCE_TTY=1` | Force interactive mode even when piped |
|
|
455
|
+
| `WORKOS_TELEMETRY=false` | Disable telemetry |
|
|
456
|
+
|
|
457
|
+
### Command Discovery
|
|
458
|
+
|
|
459
|
+
Agents can introspect available commands:
|
|
460
|
+
|
|
461
|
+
```bash
|
|
462
|
+
workos --help --json # Full command tree
|
|
463
|
+
workos env --help --json # Subcommand tree
|
|
464
|
+
workos organization --help --json # With positionals and option types
|
|
120
465
|
```
|
|
121
466
|
|
|
122
467
|
## Authentication
|