workos 0.6.0 → 0.7.1
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 +51 -15
- package/dist/bin.js +151 -0
- package/dist/bin.js.map +1 -1
- package/dist/cli.config.d.ts +1 -0
- package/dist/cli.config.js +1 -0
- package/dist/cli.config.js.map +1 -1
- package/dist/commands/doctor.d.ts +1 -0
- package/dist/commands/doctor.js +1 -0
- package/dist/commands/doctor.js.map +1 -1
- package/dist/commands/env.d.ts +9 -0
- package/dist/commands/env.js +188 -0
- package/dist/commands/env.js.map +1 -0
- package/dist/commands/organization.d.ts +18 -0
- package/dist/commands/organization.js +142 -0
- package/dist/commands/organization.js.map +1 -0
- package/dist/commands/user.d.ts +19 -0
- package/dist/commands/user.js +128 -0
- package/dist/commands/user.js.map +1 -0
- package/dist/dashboard/components/CompletionView.js +5 -1
- package/dist/dashboard/components/CompletionView.js.map +1 -1
- package/dist/doctor/agent-prompt.d.ts +10 -0
- package/dist/doctor/agent-prompt.js +190 -0
- package/dist/doctor/agent-prompt.js.map +1 -0
- package/dist/doctor/checks/ai-analysis.d.ts +9 -0
- package/dist/doctor/checks/ai-analysis.js +122 -0
- package/dist/doctor/checks/ai-analysis.js.map +1 -0
- package/dist/doctor/checks/auth-patterns.d.ts +2 -0
- package/dist/doctor/checks/auth-patterns.js +530 -0
- package/dist/doctor/checks/auth-patterns.js.map +1 -0
- package/dist/doctor/checks/environment.js +22 -4
- package/dist/doctor/checks/environment.js.map +1 -1
- package/dist/doctor/checks/framework.js +27 -8
- package/dist/doctor/checks/framework.js.map +1 -1
- package/dist/doctor/checks/language.d.ts +6 -0
- package/dist/doctor/checks/language.js +104 -0
- package/dist/doctor/checks/language.js.map +1 -0
- package/dist/doctor/checks/sdk.js +113 -22
- package/dist/doctor/checks/sdk.js.map +1 -1
- package/dist/doctor/index.js +26 -3
- package/dist/doctor/index.js.map +1 -1
- package/dist/doctor/issues.js +22 -1
- package/dist/doctor/issues.js.map +1 -1
- package/dist/doctor/output.js +85 -18
- package/dist/doctor/output.js.map +1 -1
- package/dist/doctor/types.d.ts +38 -0
- package/dist/doctor/types.js.map +1 -1
- package/dist/lib/adapters/cli-adapter.js +4 -14
- package/dist/lib/adapters/cli-adapter.js.map +1 -1
- package/dist/lib/adapters/dashboard-adapter.js +3 -16
- package/dist/lib/adapters/dashboard-adapter.js.map +1 -1
- package/dist/lib/api-key.d.ts +13 -0
- package/dist/lib/api-key.js +26 -0
- package/dist/lib/api-key.js.map +1 -0
- package/dist/lib/config-store.d.ts +27 -0
- package/dist/lib/config-store.js +142 -0
- package/dist/lib/config-store.js.map +1 -0
- package/dist/lib/credential-store.d.ts +4 -0
- package/dist/lib/credential-store.js +47 -11
- package/dist/lib/credential-store.js.map +1 -1
- package/dist/lib/credentials.d.ts +1 -1
- package/dist/lib/credentials.js +1 -1
- package/dist/lib/credentials.js.map +1 -1
- package/dist/lib/run-with-core.js +23 -2
- package/dist/lib/run-with-core.js.map +1 -1
- package/dist/lib/settings.d.ts +1 -0
- package/dist/lib/settings.js.map +1 -1
- package/dist/lib/validation/build-validator.js +0 -1
- package/dist/lib/validation/build-validator.js.map +1 -1
- package/dist/lib/validation/quick-checks.js +0 -1
- package/dist/lib/validation/quick-checks.js.map +1 -1
- package/dist/lib/workos-api.d.ts +30 -0
- package/dist/lib/workos-api.js +69 -0
- package/dist/lib/workos-api.js.map +1 -0
- package/dist/utils/cli-symbols.d.ts +1 -1
- package/dist/utils/lock-art.d.ts +4 -0
- package/dist/utils/lock-art.js +73 -0
- package/dist/utils/lock-art.js.map +1 -0
- package/dist/utils/package-json.d.ts +1 -0
- package/dist/utils/package-json.js +11 -0
- package/dist/utils/package-json.js.map +1 -1
- package/dist/utils/summary-box.d.ts +18 -0
- package/dist/utils/summary-box.js +148 -0
- package/dist/utils/summary-box.js.map +1 -0
- package/dist/utils/table.d.ts +5 -0
- package/dist/utils/table.js +18 -0
- package/dist/utils/table.js.map +1 -0
- package/package.json +1 -1
- package/skills/workos-authkit-nextjs/SKILL.md +5 -5
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# workos
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
WorkOS CLI for installing AuthKit integrations and managing WorkOS resources.
|
|
4
4
|
|
|
5
5
|
## Installation
|
|
6
6
|
|
|
@@ -45,29 +45,65 @@ Get your credentials from [dashboard.workos.com](https://dashboard.workos.com):
|
|
|
45
45
|
## CLI Options
|
|
46
46
|
|
|
47
47
|
```bash
|
|
48
|
-
workos [
|
|
48
|
+
workos [command]
|
|
49
49
|
|
|
50
50
|
Commands:
|
|
51
|
-
|
|
51
|
+
install Install WorkOS AuthKit into your project
|
|
52
|
+
dashboard Run installer with visual TUI dashboard (experimental)
|
|
52
53
|
login Authenticate with WorkOS via Connect OAuth device flow
|
|
53
54
|
logout Remove stored credentials
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
55
|
+
env Manage environment configurations
|
|
56
|
+
organization Manage organizations
|
|
57
|
+
user Manage users
|
|
58
|
+
doctor Diagnose WorkOS integration issues
|
|
59
|
+
install-skill Install AuthKit skills to coding agents
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
### Environment Management
|
|
63
|
+
|
|
64
|
+
```bash
|
|
65
|
+
workos env add [name] [apiKey] # Add environment (interactive if no args)
|
|
66
|
+
workos env remove <name> # Remove an environment
|
|
67
|
+
workos env switch [name] # Switch active environment
|
|
68
|
+
workos env list # List environments with active indicator
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
API keys are stored in the system keychain via `@napi-rs/keyring`, with a JSON file fallback at `~/.workos/config.json`.
|
|
72
|
+
|
|
73
|
+
### Organization Management
|
|
74
|
+
|
|
75
|
+
```bash
|
|
76
|
+
workos organization create <name> [domain:state ...]
|
|
77
|
+
workos organization update <orgId> <name> [domain] [state]
|
|
78
|
+
workos organization get <orgId>
|
|
79
|
+
workos organization list [--domain] [--limit] [--before] [--after] [--order]
|
|
80
|
+
workos organization delete <orgId>
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
### User Management
|
|
84
|
+
|
|
85
|
+
```bash
|
|
86
|
+
workos user get <userId>
|
|
87
|
+
workos user list [--email] [--organization] [--limit] [--before] [--after] [--order]
|
|
88
|
+
workos user update <userId> [--first-name] [--last-name] [--email-verified] [--password] [--external-id]
|
|
89
|
+
workos user delete <userId>
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
Management commands resolve API keys via: `WORKOS_API_KEY` env var → `--api-key` flag → active environment's stored key.
|
|
93
|
+
|
|
94
|
+
### Installer Options
|
|
95
|
+
|
|
96
|
+
```bash
|
|
97
|
+
workos install [options]
|
|
58
98
|
|
|
59
|
-
Options:
|
|
60
99
|
--direct, -D Use your own Anthropic API key (bypass llm-gateway)
|
|
61
100
|
--integration <name> Framework: nextjs, react, react-router, tanstack-start, vanilla-js
|
|
62
|
-
--redirect-uri <uri> Custom redirect URI
|
|
63
|
-
--homepage-url <url> Custom homepage URL
|
|
101
|
+
--redirect-uri <uri> Custom redirect URI
|
|
102
|
+
--homepage-url <url> Custom homepage URL
|
|
64
103
|
--install-dir <path> Installation directory
|
|
65
|
-
--no-validate Skip post-installation validation
|
|
104
|
+
--no-validate Skip post-installation validation
|
|
66
105
|
--force-install Force install packages even if peer dependency checks fail
|
|
67
106
|
--debug Enable verbose logging
|
|
68
|
-
|
|
69
|
-
Environment Variables:
|
|
70
|
-
WORKOS_TELEMETRY=false Disable telemetry collection
|
|
71
107
|
```
|
|
72
108
|
|
|
73
109
|
## Examples
|
|
@@ -95,7 +131,7 @@ workos login
|
|
|
95
131
|
workos logout
|
|
96
132
|
```
|
|
97
133
|
|
|
98
|
-
|
|
134
|
+
OAuth credentials are stored in the system keychain (with `~/.workos/credentials.json` fallback). Access tokens are not persisted long-term for security - users re-authenticate when tokens expire.
|
|
99
135
|
|
|
100
136
|
## How It Works
|
|
101
137
|
|
package/dist/bin.js
CHANGED
|
@@ -25,7 +25,9 @@ import clack from './utils/clack.js';
|
|
|
25
25
|
async function applyInsecureStorage(insecureStorage) {
|
|
26
26
|
if (insecureStorage) {
|
|
27
27
|
const { setInsecureStorage } = await import('./lib/credentials.js');
|
|
28
|
+
const { setInsecureConfigStorage } = await import('./lib/config-store.js');
|
|
28
29
|
setInsecureStorage(true);
|
|
30
|
+
setInsecureConfigStorage(true);
|
|
29
31
|
}
|
|
30
32
|
}
|
|
31
33
|
/** Shared insecure-storage option for commands that access credentials */
|
|
@@ -179,6 +181,11 @@ yargs(hideBin(process.argv))
|
|
|
179
181
|
default: false,
|
|
180
182
|
description: 'Skip API calls (offline mode)',
|
|
181
183
|
},
|
|
184
|
+
'skip-ai': {
|
|
185
|
+
type: 'boolean',
|
|
186
|
+
default: false,
|
|
187
|
+
description: 'Skip AI-powered analysis',
|
|
188
|
+
},
|
|
182
189
|
'install-dir': {
|
|
183
190
|
type: 'string',
|
|
184
191
|
default: process.cwd(),
|
|
@@ -198,6 +205,150 @@ yargs(hideBin(process.argv))
|
|
|
198
205
|
const { handleDoctor } = await import('./commands/doctor.js');
|
|
199
206
|
await handleDoctor(argv);
|
|
200
207
|
})
|
|
208
|
+
.command('env', 'Manage environment configurations', (yargs) => yargs
|
|
209
|
+
.options(insecureStorageOption)
|
|
210
|
+
.command('add [name] [apiKey]', 'Add an environment configuration', (yargs) => yargs
|
|
211
|
+
.positional('name', { type: 'string', describe: 'Environment name' })
|
|
212
|
+
.positional('apiKey', { type: 'string', describe: 'WorkOS API key' })
|
|
213
|
+
.option('client-id', { type: 'string', describe: 'WorkOS client ID' })
|
|
214
|
+
.option('endpoint', { type: 'string', describe: 'Custom API endpoint' }), async (argv) => {
|
|
215
|
+
await applyInsecureStorage(argv.insecureStorage);
|
|
216
|
+
const { runEnvAdd } = await import('./commands/env.js');
|
|
217
|
+
await runEnvAdd({
|
|
218
|
+
name: argv.name,
|
|
219
|
+
apiKey: argv.apiKey,
|
|
220
|
+
clientId: argv.clientId,
|
|
221
|
+
endpoint: argv.endpoint,
|
|
222
|
+
});
|
|
223
|
+
})
|
|
224
|
+
.command('remove <name>', 'Remove an environment configuration', (yargs) => yargs.positional('name', { type: 'string', demandOption: true, describe: 'Environment name' }), async (argv) => {
|
|
225
|
+
await applyInsecureStorage(argv.insecureStorage);
|
|
226
|
+
const { runEnvRemove } = await import('./commands/env.js');
|
|
227
|
+
await runEnvRemove(argv.name);
|
|
228
|
+
})
|
|
229
|
+
.command('switch [name]', 'Switch active environment', (yargs) => yargs.positional('name', { type: 'string', describe: 'Environment name' }), async (argv) => {
|
|
230
|
+
await applyInsecureStorage(argv.insecureStorage);
|
|
231
|
+
const { runEnvSwitch } = await import('./commands/env.js');
|
|
232
|
+
await runEnvSwitch(argv.name);
|
|
233
|
+
})
|
|
234
|
+
.command('list', 'List configured environments', {}, async (argv) => {
|
|
235
|
+
await applyInsecureStorage(argv.insecureStorage);
|
|
236
|
+
const { runEnvList } = await import('./commands/env.js');
|
|
237
|
+
await runEnvList();
|
|
238
|
+
})
|
|
239
|
+
.demandCommand(1, 'Please specify an env subcommand')
|
|
240
|
+
.strict())
|
|
241
|
+
.command('organization', 'Manage organizations', (yargs) => yargs
|
|
242
|
+
.options({
|
|
243
|
+
...insecureStorageOption,
|
|
244
|
+
'api-key': { type: 'string', describe: 'WorkOS API key (overrides environment config)' },
|
|
245
|
+
})
|
|
246
|
+
.command('create <name> [domains..]', 'Create a new organization', (yargs) => yargs
|
|
247
|
+
.positional('name', { type: 'string', demandOption: true, describe: 'Organization name' })
|
|
248
|
+
.positional('domains', { type: 'string', array: true, describe: 'Domains as domain:state' }), async (argv) => {
|
|
249
|
+
await applyInsecureStorage(argv.insecureStorage);
|
|
250
|
+
const { resolveApiKey, resolveApiBaseUrl } = await import('./lib/api-key.js');
|
|
251
|
+
const { runOrgCreate } = await import('./commands/organization.js');
|
|
252
|
+
const apiKey = resolveApiKey({ apiKey: argv.apiKey });
|
|
253
|
+
await runOrgCreate(argv.name, argv.domains || [], apiKey, resolveApiBaseUrl());
|
|
254
|
+
})
|
|
255
|
+
.command('update <orgId> <name> [domain] [state]', 'Update an organization', (yargs) => yargs
|
|
256
|
+
.positional('orgId', { type: 'string', demandOption: true, describe: 'Organization ID' })
|
|
257
|
+
.positional('name', { type: 'string', demandOption: true, describe: 'Organization name' })
|
|
258
|
+
.positional('domain', { type: 'string', describe: 'Domain' })
|
|
259
|
+
.positional('state', { type: 'string', describe: 'Domain state (verified or pending)' }), async (argv) => {
|
|
260
|
+
await applyInsecureStorage(argv.insecureStorage);
|
|
261
|
+
const { resolveApiKey, resolveApiBaseUrl } = await import('./lib/api-key.js');
|
|
262
|
+
const { runOrgUpdate } = await import('./commands/organization.js');
|
|
263
|
+
const apiKey = resolveApiKey({ apiKey: argv.apiKey });
|
|
264
|
+
await runOrgUpdate(argv.orgId, argv.name, apiKey, argv.domain, argv.state, resolveApiBaseUrl());
|
|
265
|
+
})
|
|
266
|
+
.command('get <orgId>', 'Get an organization by ID', (yargs) => yargs.positional('orgId', { type: 'string', demandOption: true, describe: 'Organization ID' }), async (argv) => {
|
|
267
|
+
await applyInsecureStorage(argv.insecureStorage);
|
|
268
|
+
const { resolveApiKey, resolveApiBaseUrl } = await import('./lib/api-key.js');
|
|
269
|
+
const { runOrgGet } = await import('./commands/organization.js');
|
|
270
|
+
const apiKey = resolveApiKey({ apiKey: argv.apiKey });
|
|
271
|
+
await runOrgGet(argv.orgId, apiKey, resolveApiBaseUrl());
|
|
272
|
+
})
|
|
273
|
+
.command('list', 'List organizations', (yargs) => yargs.options({
|
|
274
|
+
domain: { type: 'string', describe: 'Filter by domain' },
|
|
275
|
+
limit: { type: 'number', describe: 'Limit number of results' },
|
|
276
|
+
before: { type: 'string', describe: 'Cursor for results before a specific item' },
|
|
277
|
+
after: { type: 'string', describe: 'Cursor for results after a specific item' },
|
|
278
|
+
order: { type: 'string', describe: 'Order of results (asc or desc)' },
|
|
279
|
+
}), async (argv) => {
|
|
280
|
+
await applyInsecureStorage(argv.insecureStorage);
|
|
281
|
+
const { resolveApiKey, resolveApiBaseUrl } = await import('./lib/api-key.js');
|
|
282
|
+
const { runOrgList } = await import('./commands/organization.js');
|
|
283
|
+
const apiKey = resolveApiKey({ apiKey: argv.apiKey });
|
|
284
|
+
await runOrgList({ domain: argv.domain, limit: argv.limit, before: argv.before, after: argv.after, order: argv.order }, apiKey, resolveApiBaseUrl());
|
|
285
|
+
})
|
|
286
|
+
.command('delete <orgId>', 'Delete an organization', (yargs) => yargs.positional('orgId', { type: 'string', demandOption: true, describe: 'Organization ID' }), async (argv) => {
|
|
287
|
+
await applyInsecureStorage(argv.insecureStorage);
|
|
288
|
+
const { resolveApiKey, resolveApiBaseUrl } = await import('./lib/api-key.js');
|
|
289
|
+
const { runOrgDelete } = await import('./commands/organization.js');
|
|
290
|
+
const apiKey = resolveApiKey({ apiKey: argv.apiKey });
|
|
291
|
+
await runOrgDelete(argv.orgId, apiKey, resolveApiBaseUrl());
|
|
292
|
+
})
|
|
293
|
+
.demandCommand(1, 'Please specify an organization subcommand')
|
|
294
|
+
.strict())
|
|
295
|
+
.command('user', 'Manage users', (yargs) => yargs
|
|
296
|
+
.options({
|
|
297
|
+
...insecureStorageOption,
|
|
298
|
+
'api-key': { type: 'string', describe: 'WorkOS API key (overrides environment config)' },
|
|
299
|
+
})
|
|
300
|
+
.command('get <userId>', 'Get a user by ID', (yargs) => yargs.positional('userId', { type: 'string', demandOption: true, describe: 'User ID' }), async (argv) => {
|
|
301
|
+
await applyInsecureStorage(argv.insecureStorage);
|
|
302
|
+
const { resolveApiKey, resolveApiBaseUrl } = await import('./lib/api-key.js');
|
|
303
|
+
const { runUserGet } = await import('./commands/user.js');
|
|
304
|
+
await runUserGet(argv.userId, resolveApiKey({ apiKey: argv.apiKey }), resolveApiBaseUrl());
|
|
305
|
+
})
|
|
306
|
+
.command('list', 'List users', (yargs) => yargs.options({
|
|
307
|
+
email: { type: 'string', describe: 'Filter by email' },
|
|
308
|
+
organization: { type: 'string', describe: 'Filter by organization ID' },
|
|
309
|
+
limit: { type: 'number', describe: 'Limit number of results' },
|
|
310
|
+
before: { type: 'string', describe: 'Cursor for results before a specific item' },
|
|
311
|
+
after: { type: 'string', describe: 'Cursor for results after a specific item' },
|
|
312
|
+
order: { type: 'string', describe: 'Order of results (asc or desc)' },
|
|
313
|
+
}), async (argv) => {
|
|
314
|
+
await applyInsecureStorage(argv.insecureStorage);
|
|
315
|
+
const { resolveApiKey, resolveApiBaseUrl } = await import('./lib/api-key.js');
|
|
316
|
+
const { runUserList } = await import('./commands/user.js');
|
|
317
|
+
await runUserList({
|
|
318
|
+
email: argv.email,
|
|
319
|
+
organization: argv.organization,
|
|
320
|
+
limit: argv.limit,
|
|
321
|
+
before: argv.before,
|
|
322
|
+
after: argv.after,
|
|
323
|
+
order: argv.order,
|
|
324
|
+
}, resolveApiKey({ apiKey: argv.apiKey }), resolveApiBaseUrl());
|
|
325
|
+
})
|
|
326
|
+
.command('update <userId>', 'Update a user', (yargs) => yargs.positional('userId', { type: 'string', demandOption: true, describe: 'User ID' }).options({
|
|
327
|
+
'first-name': { type: 'string', describe: 'First name' },
|
|
328
|
+
'last-name': { type: 'string', describe: 'Last name' },
|
|
329
|
+
'email-verified': { type: 'boolean', describe: 'Email verification status' },
|
|
330
|
+
password: { type: 'string', describe: 'New password' },
|
|
331
|
+
'external-id': { type: 'string', describe: 'External ID' },
|
|
332
|
+
}), async (argv) => {
|
|
333
|
+
await applyInsecureStorage(argv.insecureStorage);
|
|
334
|
+
const { resolveApiKey, resolveApiBaseUrl } = await import('./lib/api-key.js');
|
|
335
|
+
const { runUserUpdate } = await import('./commands/user.js');
|
|
336
|
+
await runUserUpdate(argv.userId, resolveApiKey({ apiKey: argv.apiKey }), {
|
|
337
|
+
firstName: argv.firstName,
|
|
338
|
+
lastName: argv.lastName,
|
|
339
|
+
emailVerified: argv.emailVerified,
|
|
340
|
+
password: argv.password,
|
|
341
|
+
externalId: argv.externalId,
|
|
342
|
+
}, resolveApiBaseUrl());
|
|
343
|
+
})
|
|
344
|
+
.command('delete <userId>', 'Delete a user', (yargs) => yargs.positional('userId', { type: 'string', demandOption: true, describe: 'User ID' }), async (argv) => {
|
|
345
|
+
await applyInsecureStorage(argv.insecureStorage);
|
|
346
|
+
const { resolveApiKey, resolveApiBaseUrl } = await import('./lib/api-key.js');
|
|
347
|
+
const { runUserDelete } = await import('./commands/user.js');
|
|
348
|
+
await runUserDelete(argv.userId, resolveApiKey({ apiKey: argv.apiKey }), resolveApiBaseUrl());
|
|
349
|
+
})
|
|
350
|
+
.demandCommand(1, 'Please specify a user subcommand')
|
|
351
|
+
.strict())
|
|
201
352
|
.command('install', 'Install WorkOS AuthKit into your project', (yargs) => yargs.options(installerOptions), withAuth(async (argv) => {
|
|
202
353
|
const { handleInstall } = await import('./commands/install.js');
|
|
203
354
|
await handleInstall(argv);
|
package/dist/bin.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bin.js","sourceRoot":"","sources":["../src/bin.ts"],"names":[],"mappings":";AAEA,kEAAkE;AAClE,IAAI,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,IAAI,OAAO,CAAC,GAAG,CAAC,aAAa,EAAE,CAAC;IAClE,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,MAAM,CAAC,QAAQ,CAAC,CAAC;IAC1C,wEAAwE;IACxE,MAAM,CAAC,EAAE,IAAI,EAAE,IAAI,GAAG,CAAC,eAAe,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAC;AACvE,CAAC;AAED,OAAO,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AACnC,OAAO,EAAE,GAAG,EAAE,MAAM,oBAAoB,CAAC;AACzC,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAE1D,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,OAAO,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,CAAC;IAClB,CAAC;IAED,+CAA+C;IAC/C,MAAM,oBAAoB,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;IACjD,MAAM,mBAAmB,EAAE,CAAC;IAE5B,MAAM,EAAE,aAAa,EAAE,GAAG,MAAM,MAAM,CAAC,uBAAuB,CAAC,CAAC;IAChE,MAAM,aAAa,CAAC,EAAE,SAAS,EAAE,KAAK,EAAS,CAAC,CAAC;IACjD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CACF;KACA,MAAM,EAAE;KACR,IAAI,EAAE;KACN,KAAK,CAAC,MAAM,EAAE,GAAG,CAAC;KAClB,OAAO,CAAC,UAAU,EAAE,CAAC;KACrB,KAAK,CAAC,SAAS,EAAE,GAAG,CAAC;KACrB,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,KAAK,IAAI,OAAO,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC","sourcesContent":["#!/usr/bin/env node\n\n// Load .env.local for local development when --local flag is used\nif (process.argv.includes('--local') || process.env.INSTALLER_DEV) {\n const { config } = await import('dotenv');\n // bin.ts compiles to dist/bin.js, so go up one level to find .env.local\n config({ path: new URL('../.env.local', import.meta.url).pathname });\n}\n\nimport { satisfies } from 'semver';\nimport { red } from './utils/logging.js';\nimport { getConfig, getVersion } from './lib/settings.js';\n\nimport yargs from 'yargs';\nimport { hideBin } from 'yargs/helpers';\nimport chalk from 'chalk';\nimport { ensureAuthenticated } from './lib/ensure-auth.js';\nimport { checkForUpdates } from './lib/version-check.js';\n\nconst NODE_VERSION_RANGE = getConfig().nodeVersion;\n\n// Have to run this above the other imports because they are importing clack that\n// has the problematic imports.\nif (!satisfies(process.version, NODE_VERSION_RANGE)) {\n red(\n `WorkOS AuthKit installer requires Node.js ${NODE_VERSION_RANGE}. You are using Node.js ${process.version}. Please upgrade your Node.js version.`,\n );\n process.exit(1);\n}\n\nimport { isNonInteractiveEnvironment } from './utils/environment.js';\nimport clack from './utils/clack.js';\n\n/** Apply insecure storage flag if set */\nasync function applyInsecureStorage(insecureStorage?: boolean): Promise<void> {\n if (insecureStorage) {\n const { setInsecureStorage } = await import('./lib/credentials.js');\n setInsecureStorage(true);\n }\n}\n\n/** Shared insecure-storage option for commands that access credentials */\nconst insecureStorageOption = {\n 'insecure-storage': {\n default: false,\n describe: 'Store credentials in plaintext file instead of system keyring',\n type: 'boolean' as const,\n },\n} as const;\n\n/**\n * Wrap a command handler with authentication check.\n * Ensures valid auth before executing the handler.\n * Respects --skip-auth flag for CI/testing.\n */\nfunction withAuth<T>(handler: (argv: T) => Promise<void>): (argv: T) => Promise<void> {\n return async (argv: T) => {\n const typedArgv = argv as { skipAuth?: boolean; insecureStorage?: boolean };\n await applyInsecureStorage(typedArgv.insecureStorage);\n if (!typedArgv.skipAuth) await ensureAuthenticated();\n await handler(argv);\n };\n}\n\nconst installerOptions = {\n direct: {\n alias: 'D',\n default: false,\n describe: 'Use your own Anthropic API key (bypass llm-gateway)',\n type: 'boolean' as const,\n },\n debug: {\n default: false,\n describe: 'Enable verbose logging',\n type: 'boolean' as const,\n },\n ...insecureStorageOption,\n // Hidden dev/automation flags (use env vars)\n local: {\n default: false,\n type: 'boolean' as const,\n hidden: true,\n },\n ci: {\n default: false,\n type: 'boolean' as const,\n hidden: true,\n },\n 'skip-auth': {\n default: false,\n type: 'boolean' as const,\n hidden: true,\n },\n 'api-key': {\n type: 'string' as const,\n hidden: true,\n },\n 'client-id': {\n type: 'string' as const,\n hidden: true,\n },\n inspect: {\n default: false,\n type: 'boolean' as const,\n hidden: true,\n },\n // User-facing flags\n 'homepage-url': {\n describe: 'App homepage URL for WorkOS (defaults to http://localhost:{port})',\n type: 'string' as const,\n },\n 'redirect-uri': {\n describe: 'Redirect URI for WorkOS callback (defaults to framework convention)',\n type: 'string' as const,\n },\n 'no-validate': {\n default: false,\n describe: 'Skip post-installation validation (includes build check)',\n type: 'boolean' as const,\n },\n 'install-dir': {\n describe: 'Directory to install WorkOS AuthKit in',\n type: 'string' as const,\n },\n integration: {\n describe: 'Integration to set up',\n type: 'string' as const,\n },\n 'force-install': {\n default: false,\n describe: 'Force install packages even if peer dependency checks fail',\n type: 'boolean' as const,\n },\n dashboard: {\n alias: 'd',\n default: false,\n describe: 'Run with visual dashboard mode',\n type: 'boolean' as const,\n },\n};\n\n// Check for updates (blocks up to 500ms)\nawait checkForUpdates();\n\nyargs(hideBin(process.argv))\n .env('WORKOS_INSTALLER')\n .command('login', 'Authenticate with WorkOS', insecureStorageOption, async (argv) => {\n await applyInsecureStorage(argv.insecureStorage);\n const { runLogin } = await import('./commands/login.js');\n await runLogin();\n process.exit(0);\n })\n .command('logout', 'Remove stored credentials', insecureStorageOption, async (argv) => {\n await applyInsecureStorage(argv.insecureStorage);\n const { runLogout } = await import('./commands/logout.js');\n await runLogout();\n })\n .command(\n 'install-skill',\n 'Install bundled AuthKit skills to coding agents',\n (yargs) => {\n return yargs\n .option('list', {\n alias: 'l',\n type: 'boolean',\n description: 'List available skills without installing',\n })\n .option('skill', {\n alias: 's',\n type: 'array',\n string: true,\n description: 'Install specific skill(s)',\n })\n .option('agent', {\n alias: 'a',\n type: 'array',\n string: true,\n description: 'Target specific agent(s): claude-code, codex, cursor, goose',\n });\n },\n withAuth(async (argv) => {\n const { runInstallSkill } = await import('./commands/install-skill.js');\n await runInstallSkill({\n list: argv.list as boolean | undefined,\n skill: argv.skill as string[] | undefined,\n agent: argv.agent as string[] | undefined,\n });\n }),\n )\n .command(\n 'doctor',\n 'Diagnose WorkOS integration issues',\n (yargs) =>\n yargs.options({\n verbose: {\n type: 'boolean',\n default: false,\n description: 'Include additional diagnostic information',\n },\n 'skip-api': {\n type: 'boolean',\n default: false,\n description: 'Skip API calls (offline mode)',\n },\n 'install-dir': {\n type: 'string',\n default: process.cwd(),\n description: 'Project directory to analyze',\n },\n json: {\n type: 'boolean',\n default: false,\n description: 'Output report as JSON',\n },\n copy: {\n type: 'boolean',\n default: false,\n description: 'Copy report to clipboard',\n },\n }),\n async (argv) => {\n const { handleDoctor } = await import('./commands/doctor.js');\n await handleDoctor(argv);\n },\n )\n .command(\n 'install',\n 'Install WorkOS AuthKit into your project',\n (yargs) => yargs.options(installerOptions),\n withAuth(async (argv) => {\n const { handleInstall } = await import('./commands/install.js');\n await handleInstall(argv);\n }),\n )\n .command(\n 'dashboard',\n false, // hidden from help\n (yargs) => yargs.options(installerOptions),\n withAuth(async (argv) => {\n const { handleInstall } = await import('./commands/install.js');\n await handleInstall({ ...argv, dashboard: true });\n }),\n )\n .command(\n ['$0'],\n 'WorkOS AuthKit CLI',\n (yargs) => yargs.options(insecureStorageOption),\n async (argv) => {\n // Non-TTY: show help\n if (isNonInteractiveEnvironment()) {\n yargs(hideBin(process.argv)).showHelp();\n return;\n }\n\n // TTY: ask if user wants to run installer\n const shouldInstall = await clack.confirm({\n message: 'Run the AuthKit installer?',\n });\n\n if (clack.isCancel(shouldInstall) || !shouldInstall) {\n process.exit(0);\n }\n\n // Auth check happens HERE, after user confirms\n await applyInsecureStorage(argv.insecureStorage);\n await ensureAuthenticated();\n\n const { handleInstall } = await import('./commands/install.js');\n await handleInstall({ dashboard: false } as any);\n process.exit(0);\n },\n )\n .strict()\n .help()\n .alias('help', 'h')\n .version(getVersion())\n .alias('version', 'v')\n .wrap(process.stdout.isTTY && process.stdout.columns ? process.stdout.columns : 80).argv;\n"]}
|
|
1
|
+
{"version":3,"file":"bin.js","sourceRoot":"","sources":["../src/bin.ts"],"names":[],"mappings":";AAEA,kEAAkE;AAClE,IAAI,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,IAAI,OAAO,CAAC,GAAG,CAAC,aAAa,EAAE,CAAC;IAClE,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,MAAM,CAAC,QAAQ,CAAC,CAAC;IAC1C,wEAAwE;IACxE,MAAM,CAAC,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AC,CAAC,CAAC;IAClB,CAAC;IAED,+CAA+C;IAC/C,MAAM,oBAAoB,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;IACjD,MAAM,mBAAmB,EAAE,CAAC;IAE5B,MAAM,EAAE,aAAa,EAAE,GAAG,MAAM,MAAM,CAAC,uBAAuB,CAAC,CAAC;IAChE,MAAM,aAAa,CAAC,EAAE,SAAS,EAAE,KAAK,EAAS,CAAC,CAAC;IACjD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CACF;KACA,MAAM,EAAE;KACR,IAAI,EAAE;KACN,KAAK,CAAC,MAAM,EAAE,GAAG,CAAC;KAClB,OAAO,CAAC,UAAU,EAAE,CAAC;KACrB,KAAK,CAAC,SAAS,EAAE,GAAG,CAAC;KACrB,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,KAAK,IAAI,OAAO,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC","sourcesContent":["#!/usr/bin/env node\n\n// Load .env.local for local development when --local flag is used\nif (process.argv.includes('--local') || process.env.INSTALLER_DEV) {\n const { config } = await import('dotenv');\n // bin.ts compiles to dist/bin.js, so go up one level to find .env.local\n config({ path: new URL('../.env.local', import.meta.url).pathname });\n}\n\nimport { satisfies } from 'semver';\nimport { red } from './utils/logging.js';\nimport { getConfig, getVersion } from './lib/settings.js';\n\nimport yargs from 'yargs';\nimport { hideBin } from 'yargs/helpers';\nimport chalk from 'chalk';\nimport { ensureAuthenticated } from './lib/ensure-auth.js';\nimport { checkForUpdates } from './lib/version-check.js';\n\nconst NODE_VERSION_RANGE = getConfig().nodeVersion;\n\n// Have to run this above the other imports because they are importing clack that\n// has the problematic imports.\nif (!satisfies(process.version, NODE_VERSION_RANGE)) {\n red(\n `WorkOS AuthKit installer requires Node.js ${NODE_VERSION_RANGE}. You are using Node.js ${process.version}. Please upgrade your Node.js version.`,\n );\n process.exit(1);\n}\n\nimport { isNonInteractiveEnvironment } from './utils/environment.js';\nimport clack from './utils/clack.js';\n\n/** Apply insecure storage flag if set */\nasync function applyInsecureStorage(insecureStorage?: boolean): Promise<void> {\n if (insecureStorage) {\n const { setInsecureStorage } = await import('./lib/credentials.js');\n const { setInsecureConfigStorage } = await import('./lib/config-store.js');\n setInsecureStorage(true);\n setInsecureConfigStorage(true);\n }\n}\n\n/** Shared insecure-storage option for commands that access credentials */\nconst insecureStorageOption = {\n 'insecure-storage': {\n default: false,\n describe: 'Store credentials in plaintext file instead of system keyring',\n type: 'boolean' as const,\n },\n} as const;\n\n/**\n * Wrap a command handler with authentication check.\n * Ensures valid auth before executing the handler.\n * Respects --skip-auth flag for CI/testing.\n */\nfunction withAuth<T>(handler: (argv: T) => Promise<void>): (argv: T) => Promise<void> {\n return async (argv: T) => {\n const typedArgv = argv as { skipAuth?: boolean; insecureStorage?: boolean };\n await applyInsecureStorage(typedArgv.insecureStorage);\n if (!typedArgv.skipAuth) await ensureAuthenticated();\n await handler(argv);\n };\n}\n\nconst installerOptions = {\n direct: {\n alias: 'D',\n default: false,\n describe: 'Use your own Anthropic API key (bypass llm-gateway)',\n type: 'boolean' as const,\n },\n debug: {\n default: false,\n describe: 'Enable verbose logging',\n type: 'boolean' as const,\n },\n ...insecureStorageOption,\n // Hidden dev/automation flags (use env vars)\n local: {\n default: false,\n type: 'boolean' as const,\n hidden: true,\n },\n ci: {\n default: false,\n type: 'boolean' as const,\n hidden: true,\n },\n 'skip-auth': {\n default: false,\n type: 'boolean' as const,\n hidden: true,\n },\n 'api-key': {\n type: 'string' as const,\n hidden: true,\n },\n 'client-id': {\n type: 'string' as const,\n hidden: true,\n },\n inspect: {\n default: false,\n type: 'boolean' as const,\n hidden: true,\n },\n // User-facing flags\n 'homepage-url': {\n describe: 'App homepage URL for WorkOS (defaults to http://localhost:{port})',\n type: 'string' as const,\n },\n 'redirect-uri': {\n describe: 'Redirect URI for WorkOS callback (defaults to framework convention)',\n type: 'string' as const,\n },\n 'no-validate': {\n default: false,\n describe: 'Skip post-installation validation (includes build check)',\n type: 'boolean' as const,\n },\n 'install-dir': {\n describe: 'Directory to install WorkOS AuthKit in',\n type: 'string' as const,\n },\n integration: {\n describe: 'Integration to set up',\n type: 'string' as const,\n },\n 'force-install': {\n default: false,\n describe: 'Force install packages even if peer dependency checks fail',\n type: 'boolean' as const,\n },\n dashboard: {\n alias: 'd',\n default: false,\n describe: 'Run with visual dashboard mode',\n type: 'boolean' as const,\n },\n};\n\n// Check for updates (blocks up to 500ms)\nawait checkForUpdates();\n\nyargs(hideBin(process.argv))\n .env('WORKOS_INSTALLER')\n .command('login', 'Authenticate with WorkOS', insecureStorageOption, async (argv) => {\n await applyInsecureStorage(argv.insecureStorage);\n const { runLogin } = await import('./commands/login.js');\n await runLogin();\n process.exit(0);\n })\n .command('logout', 'Remove stored credentials', insecureStorageOption, async (argv) => {\n await applyInsecureStorage(argv.insecureStorage);\n const { runLogout } = await import('./commands/logout.js');\n await runLogout();\n })\n .command(\n 'install-skill',\n 'Install bundled AuthKit skills to coding agents',\n (yargs) => {\n return yargs\n .option('list', {\n alias: 'l',\n type: 'boolean',\n description: 'List available skills without installing',\n })\n .option('skill', {\n alias: 's',\n type: 'array',\n string: true,\n description: 'Install specific skill(s)',\n })\n .option('agent', {\n alias: 'a',\n type: 'array',\n string: true,\n description: 'Target specific agent(s): claude-code, codex, cursor, goose',\n });\n },\n withAuth(async (argv) => {\n const { runInstallSkill } = await import('./commands/install-skill.js');\n await runInstallSkill({\n list: argv.list as boolean | undefined,\n skill: argv.skill as string[] | undefined,\n agent: argv.agent as string[] | undefined,\n });\n }),\n )\n .command(\n 'doctor',\n 'Diagnose WorkOS integration issues',\n (yargs) =>\n yargs.options({\n verbose: {\n type: 'boolean',\n default: false,\n description: 'Include additional diagnostic information',\n },\n 'skip-api': {\n type: 'boolean',\n default: false,\n description: 'Skip API calls (offline mode)',\n },\n 'skip-ai': {\n type: 'boolean',\n default: false,\n description: 'Skip AI-powered analysis',\n },\n 'install-dir': {\n type: 'string',\n default: process.cwd(),\n description: 'Project directory to analyze',\n },\n json: {\n type: 'boolean',\n default: false,\n description: 'Output report as JSON',\n },\n copy: {\n type: 'boolean',\n default: false,\n description: 'Copy report to clipboard',\n },\n }),\n async (argv) => {\n const { handleDoctor } = await import('./commands/doctor.js');\n await handleDoctor(argv);\n },\n )\n .command('env', 'Manage environment configurations', (yargs) =>\n yargs\n .options(insecureStorageOption)\n .command(\n 'add [name] [apiKey]',\n 'Add an environment configuration',\n (yargs) =>\n yargs\n .positional('name', { type: 'string', describe: 'Environment name' })\n .positional('apiKey', { type: 'string', describe: 'WorkOS API key' })\n .option('client-id', { type: 'string', describe: 'WorkOS client ID' })\n .option('endpoint', { type: 'string', describe: 'Custom API endpoint' }),\n async (argv) => {\n await applyInsecureStorage(argv.insecureStorage);\n const { runEnvAdd } = await import('./commands/env.js');\n await runEnvAdd({\n name: argv.name,\n apiKey: argv.apiKey,\n clientId: argv.clientId,\n endpoint: argv.endpoint,\n });\n },\n )\n .command(\n 'remove <name>',\n 'Remove an environment configuration',\n (yargs) => yargs.positional('name', { type: 'string', demandOption: true, describe: 'Environment name' }),\n async (argv) => {\n await applyInsecureStorage(argv.insecureStorage);\n const { runEnvRemove } = await import('./commands/env.js');\n await runEnvRemove(argv.name);\n },\n )\n .command(\n 'switch [name]',\n 'Switch active environment',\n (yargs) => yargs.positional('name', { type: 'string', describe: 'Environment name' }),\n async (argv) => {\n await applyInsecureStorage(argv.insecureStorage);\n const { runEnvSwitch } = await import('./commands/env.js');\n await runEnvSwitch(argv.name);\n },\n )\n .command('list', 'List configured environments', {}, async (argv) => {\n await applyInsecureStorage((argv as any).insecureStorage);\n const { runEnvList } = await import('./commands/env.js');\n await runEnvList();\n })\n .demandCommand(1, 'Please specify an env subcommand')\n .strict(),\n )\n .command('organization', 'Manage organizations', (yargs) =>\n yargs\n .options({\n ...insecureStorageOption,\n 'api-key': { type: 'string' as const, describe: 'WorkOS API key (overrides environment config)' },\n })\n .command(\n 'create <name> [domains..]',\n 'Create a new organization',\n (yargs) =>\n yargs\n .positional('name', { type: 'string', demandOption: true, describe: 'Organization name' })\n .positional('domains', { type: 'string', array: true, describe: 'Domains as domain:state' }),\n async (argv) => {\n await applyInsecureStorage(argv.insecureStorage);\n const { resolveApiKey, resolveApiBaseUrl } = await import('./lib/api-key.js');\n const { runOrgCreate } = await import('./commands/organization.js');\n const apiKey = resolveApiKey({ apiKey: argv.apiKey });\n await runOrgCreate(argv.name, (argv.domains as string[]) || [], apiKey, resolveApiBaseUrl());\n },\n )\n .command(\n 'update <orgId> <name> [domain] [state]',\n 'Update an organization',\n (yargs) =>\n yargs\n .positional('orgId', { type: 'string', demandOption: true, describe: 'Organization ID' })\n .positional('name', { type: 'string', demandOption: true, describe: 'Organization name' })\n .positional('domain', { type: 'string', describe: 'Domain' })\n .positional('state', { type: 'string', describe: 'Domain state (verified or pending)' }),\n async (argv) => {\n await applyInsecureStorage(argv.insecureStorage);\n const { resolveApiKey, resolveApiBaseUrl } = await import('./lib/api-key.js');\n const { runOrgUpdate } = await import('./commands/organization.js');\n const apiKey = resolveApiKey({ apiKey: argv.apiKey });\n await runOrgUpdate(argv.orgId, argv.name, apiKey, argv.domain, argv.state, resolveApiBaseUrl());\n },\n )\n .command(\n 'get <orgId>',\n 'Get an organization by ID',\n (yargs) => yargs.positional('orgId', { type: 'string', demandOption: true, describe: 'Organization ID' }),\n async (argv) => {\n await applyInsecureStorage(argv.insecureStorage);\n const { resolveApiKey, resolveApiBaseUrl } = await import('./lib/api-key.js');\n const { runOrgGet } = await import('./commands/organization.js');\n const apiKey = resolveApiKey({ apiKey: argv.apiKey });\n await runOrgGet(argv.orgId, apiKey, resolveApiBaseUrl());\n },\n )\n .command(\n 'list',\n 'List organizations',\n (yargs) =>\n yargs.options({\n domain: { type: 'string', describe: 'Filter by domain' },\n limit: { type: 'number', describe: 'Limit number of results' },\n before: { type: 'string', describe: 'Cursor for results before a specific item' },\n after: { type: 'string', describe: 'Cursor for results after a specific item' },\n order: { type: 'string', describe: 'Order of results (asc or desc)' },\n }),\n async (argv) => {\n await applyInsecureStorage(argv.insecureStorage);\n const { resolveApiKey, resolveApiBaseUrl } = await import('./lib/api-key.js');\n const { runOrgList } = await import('./commands/organization.js');\n const apiKey = resolveApiKey({ apiKey: argv.apiKey });\n await runOrgList(\n { domain: argv.domain, limit: argv.limit, before: argv.before, after: argv.after, order: argv.order },\n apiKey,\n resolveApiBaseUrl(),\n );\n },\n )\n .command(\n 'delete <orgId>',\n 'Delete an organization',\n (yargs) => yargs.positional('orgId', { type: 'string', demandOption: true, describe: 'Organization ID' }),\n async (argv) => {\n await applyInsecureStorage(argv.insecureStorage);\n const { resolveApiKey, resolveApiBaseUrl } = await import('./lib/api-key.js');\n const { runOrgDelete } = await import('./commands/organization.js');\n const apiKey = resolveApiKey({ apiKey: argv.apiKey });\n await runOrgDelete(argv.orgId, apiKey, resolveApiBaseUrl());\n },\n )\n .demandCommand(1, 'Please specify an organization subcommand')\n .strict(),\n )\n .command('user', 'Manage users', (yargs) =>\n yargs\n .options({\n ...insecureStorageOption,\n 'api-key': { type: 'string' as const, describe: 'WorkOS API key (overrides environment config)' },\n })\n .command(\n 'get <userId>',\n 'Get a user by ID',\n (yargs) => yargs.positional('userId', { type: 'string', demandOption: true, describe: 'User ID' }),\n async (argv) => {\n await applyInsecureStorage(argv.insecureStorage);\n const { resolveApiKey, resolveApiBaseUrl } = await import('./lib/api-key.js');\n const { runUserGet } = await import('./commands/user.js');\n await runUserGet(argv.userId, resolveApiKey({ apiKey: argv.apiKey }), resolveApiBaseUrl());\n },\n )\n .command(\n 'list',\n 'List users',\n (yargs) =>\n yargs.options({\n email: { type: 'string', describe: 'Filter by email' },\n organization: { type: 'string', describe: 'Filter by organization ID' },\n limit: { type: 'number', describe: 'Limit number of results' },\n before: { type: 'string', describe: 'Cursor for results before a specific item' },\n after: { type: 'string', describe: 'Cursor for results after a specific item' },\n order: { type: 'string', describe: 'Order of results (asc or desc)' },\n }),\n async (argv) => {\n await applyInsecureStorage(argv.insecureStorage);\n const { resolveApiKey, resolveApiBaseUrl } = await import('./lib/api-key.js');\n const { runUserList } = await import('./commands/user.js');\n await runUserList(\n {\n email: argv.email,\n organization: argv.organization,\n limit: argv.limit,\n before: argv.before,\n after: argv.after,\n order: argv.order,\n },\n resolveApiKey({ apiKey: argv.apiKey }),\n resolveApiBaseUrl(),\n );\n },\n )\n .command(\n 'update <userId>',\n 'Update a user',\n (yargs) =>\n yargs.positional('userId', { type: 'string', demandOption: true, describe: 'User ID' }).options({\n 'first-name': { type: 'string', describe: 'First name' },\n 'last-name': { type: 'string', describe: 'Last name' },\n 'email-verified': { type: 'boolean', describe: 'Email verification status' },\n password: { type: 'string', describe: 'New password' },\n 'external-id': { type: 'string', describe: 'External ID' },\n }),\n async (argv) => {\n await applyInsecureStorage(argv.insecureStorage);\n const { resolveApiKey, resolveApiBaseUrl } = await import('./lib/api-key.js');\n const { runUserUpdate } = await import('./commands/user.js');\n await runUserUpdate(\n argv.userId,\n resolveApiKey({ apiKey: argv.apiKey }),\n {\n firstName: argv.firstName,\n lastName: argv.lastName,\n emailVerified: argv.emailVerified,\n password: argv.password,\n externalId: argv.externalId,\n },\n resolveApiBaseUrl(),\n );\n },\n )\n .command(\n 'delete <userId>',\n 'Delete a user',\n (yargs) => yargs.positional('userId', { type: 'string', demandOption: true, describe: 'User ID' }),\n async (argv) => {\n await applyInsecureStorage(argv.insecureStorage);\n const { resolveApiKey, resolveApiBaseUrl } = await import('./lib/api-key.js');\n const { runUserDelete } = await import('./commands/user.js');\n await runUserDelete(argv.userId, resolveApiKey({ apiKey: argv.apiKey }), resolveApiBaseUrl());\n },\n )\n .demandCommand(1, 'Please specify a user subcommand')\n .strict(),\n )\n .command(\n 'install',\n 'Install WorkOS AuthKit into your project',\n (yargs) => yargs.options(installerOptions),\n withAuth(async (argv) => {\n const { handleInstall } = await import('./commands/install.js');\n await handleInstall(argv);\n }),\n )\n .command(\n 'dashboard',\n false, // hidden from help\n (yargs) => yargs.options(installerOptions),\n withAuth(async (argv) => {\n const { handleInstall } = await import('./commands/install.js');\n await handleInstall({ ...argv, dashboard: true });\n }),\n )\n .command(\n ['$0'],\n 'WorkOS AuthKit CLI',\n (yargs) => yargs.options(insecureStorageOption),\n async (argv) => {\n // Non-TTY: show help\n if (isNonInteractiveEnvironment()) {\n yargs(hideBin(process.argv)).showHelp();\n return;\n }\n\n // TTY: ask if user wants to run installer\n const shouldInstall = await clack.confirm({\n message: 'Run the AuthKit installer?',\n });\n\n if (clack.isCancel(shouldInstall) || !shouldInstall) {\n process.exit(0);\n }\n\n // Auth check happens HERE, after user confirms\n await applyInsecureStorage(argv.insecureStorage);\n await ensureAuthenticated();\n\n const { handleInstall } = await import('./commands/install.js');\n await handleInstall({ dashboard: false } as any);\n process.exit(0);\n },\n )\n .strict()\n .help()\n .alias('help', 'h')\n .version(getVersion())\n .alias('version', 'v')\n .wrap(process.stdout.isTTY && process.stdout.columns ? process.stdout.columns : 80).argv;\n"]}
|
package/dist/cli.config.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export declare const version: string;
|
|
2
2
|
export declare const config: {
|
|
3
3
|
readonly model: "claude-opus-4-5-20251101";
|
|
4
|
+
readonly doctorModel: "claude-haiku-4-5-20251001";
|
|
4
5
|
readonly workos: {
|
|
5
6
|
readonly clientId: "client_01KFKHSZWK9ADVJV854PDFQCCR";
|
|
6
7
|
readonly authkitDomain: "https://signin.workos.com";
|
package/dist/cli.config.js
CHANGED
|
@@ -2,6 +2,7 @@ import pkg from '../package.json' with { type: 'json' };
|
|
|
2
2
|
export const version = pkg.version;
|
|
3
3
|
export const config = {
|
|
4
4
|
model: 'claude-opus-4-5-20251101',
|
|
5
|
+
doctorModel: 'claude-haiku-4-5-20251001',
|
|
5
6
|
// Production defaults - override via env vars for local dev
|
|
6
7
|
workos: {
|
|
7
8
|
clientId: 'client_01KFKHSZWK9ADVJV854PDFQCCR',
|
package/dist/cli.config.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.config.js","sourceRoot":"","sources":["../src/cli.config.ts"],"names":[],"mappings":"AACA,OAAO,GAAG,MAAM,iBAAiB,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAC;AAExD,MAAM,CAAC,MAAM,OAAO,GAAG,GAAG,CAAC,OAAO,CAAC;AAEnC,MAAM,CAAC,MAAM,MAAM,GAAG;IACpB,KAAK,EAAE,0BAA0B;
|
|
1
|
+
{"version":3,"file":"cli.config.js","sourceRoot":"","sources":["../src/cli.config.ts"],"names":[],"mappings":"AACA,OAAO,GAAG,MAAM,iBAAiB,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAC;AAExD,MAAM,CAAC,MAAM,OAAO,GAAG,GAAG,CAAC,OAAO,CAAC;AAEnC,MAAM,CAAC,MAAM,MAAM,GAAG;IACpB,KAAK,EAAE,0BAA0B;IACjC,WAAW,EAAE,2BAA2B;IAExC,4DAA4D;IAC5D,MAAM,EAAE;QACN,QAAQ,EAAE,mCAAmC;QAC7C,aAAa,EAAE,2BAA2B;QAC1C,aAAa,EAAE,oCAAoC;KACpD;IAED,SAAS,EAAE;QACT,OAAO,EAAE,IAAI;QACb,SAAS,EAAE,uBAAuB;KACnC;IAED,KAAK,EAAE;QACL,uEAAuE;QACvE,kBAAkB,EAAE,MAAM;KAC3B;IAED,WAAW,EAAE,SAAS;IAEtB,OAAO,EAAE;QACP,SAAS,EAAE,KAAK;KACjB;IAED,aAAa,EAAE;QACb,aAAa,EAAE,iCAAiC;QAChD,YAAY,EAAE,8BAA8B;QAC5C,SAAS,EAAE,4CAA4C;KACxD;IAED,UAAU,EAAE;QACV,MAAM,EAAE;YACN,IAAI,EAAE,IAAI;YACV,YAAY,EAAE,gBAAgB;SAC/B;QACD,KAAK,EAAE;YACL,IAAI,EAAE,IAAI;YACV,YAAY,EAAE,WAAW;SAC1B;QACD,aAAa,EAAE;YACb,IAAI,EAAE,IAAI;YACV,YAAY,EAAE,oBAAoB;SACnC;QACD,WAAW,EAAE;YACX,IAAI,EAAE,IAAI;YACV,YAAY,EAAE,WAAW;SAC1B;QACD,SAAS,EAAE;YACT,IAAI,EAAE,IAAI;YACV,YAAY,EAAE,WAAW;SAC1B;KACF;IAED,MAAM,EAAE;QACN,SAAS,EAAE,IAAI;KAChB;IAED,QAAQ,EAAE;QACR,YAAY,EAAE,IAAI;QAClB,UAAU,EAAE,KAAK;QACjB,eAAe,EAAE,4BAA4B;QAC7C,QAAQ,EAAE;;;;;;;;;;;;;;;;wEAgB0D;KACrE;CACiC,CAAC","sourcesContent":["import type { InstallerConfig } from './lib/settings.js';\nimport pkg from '../package.json' with { type: 'json' };\n\nexport const version = pkg.version;\n\nexport const config = {\n model: 'claude-opus-4-5-20251101',\n doctorModel: 'claude-haiku-4-5-20251001',\n\n // Production defaults - override via env vars for local dev\n workos: {\n clientId: 'client_01KFKHSZWK9ADVJV854PDFQCCR',\n authkitDomain: 'https://signin.workos.com',\n llmGatewayUrl: 'https://api.workos.com/llm-gateway',\n },\n\n telemetry: {\n enabled: true,\n eventName: 'installer interaction',\n },\n\n proxy: {\n // Refresh token when it expires within this window (default: 1 minute)\n refreshThresholdMs: 60_000,\n },\n\n nodeVersion: '>=20.20',\n\n logging: {\n debugMode: false,\n },\n\n documentation: {\n workosDocsUrl: 'https://workos.com/docs/authkit',\n dashboardUrl: 'https://dashboard.workos.com',\n issuesUrl: 'https://github.com/workos/installer/issues',\n },\n\n frameworks: {\n nextjs: {\n port: 3000,\n callbackPath: '/auth/callback',\n },\n react: {\n port: 5173,\n callbackPath: '/callback',\n },\n tanstackStart: {\n port: 3000,\n callbackPath: '/api/auth/callback',\n },\n reactRouter: {\n port: 5173,\n callbackPath: '/callback',\n },\n vanillaJs: {\n port: 5173,\n callbackPath: '/callback',\n },\n },\n\n legacy: {\n oauthPort: 8239,\n },\n\n branding: {\n showAsciiArt: true,\n useCompact: false,\n compactAsciiArt: `⚡ WorkOS AuthKit Installer`,\n asciiArt: `░██ ░██ ░██ ░██████ ░██████\n░██ ░██ ░██ ░██ ░██ ░██ ░██\n░██ ░██ ░██ ░███████ ░██░████ ░██ ░██░██ ░██ ░██\n░██ ░████ ░██ ░██ ░██ ░███ ░██ ░██ ░██ ░██ ░████████\n░██░██ ░██░██ ░██ ░██ ░██ ░███████ ░██ ░██ ░██\n░████ ░████ ░██ ░██ ░██ ░██ ░██ ░██ ░██ ░██ ░██\n░███ ░███ ░███████ ░██ ░██ ░██ ░██████ ░██████\n\n\n\n ░███ ░██ ░██ ░██ ░██ ░██ ░██\n ░██░██ ░██ ░██ ░██ ░██ ░██\n ░██ ░██ ░██ ░██ ░████████ ░████████ ░██ ░██ ░██░████████\n░█████████ ░██ ░██ ░██ ░██ ░██ ░███████ ░██ ░██\n░██ ░██ ░██ ░██ ░██ ░██ ░██ ░██ ░██ ░██ ░██\n░██ ░██ ░██ ░███ ░██ ░██ ░██ ░██ ░██ ░██ ░██\n░██ ░██ ░█████░██ ░████ ░██ ░██ ░██ ░██ ░██ ░████ `,\n },\n} as const satisfies InstallerConfig;\n"]}
|
package/dist/commands/doctor.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"doctor.js","sourceRoot":"","sources":["../../src/commands/doctor.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAC7D,OAAO,KAAK,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"doctor.js","sourceRoot":"","sources":["../../src/commands/doctor.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAC7D,OAAO,KAAK,MAAM,mBAAmB,CAAC;AAWtC,MAAM,CAAC,KAAK,UAAU,YAAY,CAAC,IAAoC;IACrE,MAAM,OAAO,GAAG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port clack from '../utils/clack.js';\n\ninterface DoctorArgs {\n verbose?: boolean;\n skipApi?: boolean;\n skipAi?: boolean;\n installDir?: string;\n json?: boolean;\n copy?: boolean;\n}\n\nexport async function handleDoctor(argv: ArgumentsCamelCase<DoctorArgs>): Promise<void> {\n const options = {\n installDir: argv.installDir ?? process.cwd(),\n verbose: argv.verbose ?? false,\n skipApi: argv.skipApi ?? false,\n skipAi: argv.skipAi ?? false,\n json: argv.json ?? false,\n copy: argv.copy ?? false,\n };\n\n try {\n const report = await runDoctor(options);\n await outputReport(report, options);\n\n // Exit with error code if critical issues found\n if (report.summary.errors > 0) {\n process.exit(1);\n }\n process.exit(0);\n } catch (error) {\n if (!options.json) {\n clack.log.error(`Doctor failed: ${error instanceof Error ? error.message : 'Unknown error'}`);\n } else {\n console.error(JSON.stringify({ error: error instanceof Error ? error.message : 'Unknown error' }));\n }\n process.exit(1);\n }\n}\n"]}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export declare function runEnvAdd(options: {
|
|
2
|
+
name?: string;
|
|
3
|
+
apiKey?: string;
|
|
4
|
+
clientId?: string;
|
|
5
|
+
endpoint?: string;
|
|
6
|
+
}): Promise<void>;
|
|
7
|
+
export declare function runEnvRemove(name: string): Promise<void>;
|
|
8
|
+
export declare function runEnvSwitch(name?: string): Promise<void>;
|
|
9
|
+
export declare function runEnvList(): Promise<void>;
|