workos 0.19.0 → 0.20.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 +4 -646
- package/bin/workos.js +44 -0
- package/package.json +18 -99
- package/LICENSE +0 -47
- package/dist/bin.d.ts +0 -2
- package/dist/bin.js +0 -1790
- package/dist/bin.js.map +0 -1
- package/dist/cli.config.d.ts +0 -88
- package/dist/cli.config.js +0 -110
- package/dist/cli.config.js.map +0 -1
- package/dist/commands/api/catalog.d.ts +0 -23
- package/dist/commands/api/catalog.js +0 -97
- package/dist/commands/api/catalog.js.map +0 -1
- package/dist/commands/api/format.d.ts +0 -5
- package/dist/commands/api/format.js +0 -46
- package/dist/commands/api/format.js.map +0 -1
- package/dist/commands/api/index.d.ts +0 -15
- package/dist/commands/api/index.js +0 -213
- package/dist/commands/api/index.js.map +0 -1
- package/dist/commands/api/interactive.d.ts +0 -3
- package/dist/commands/api/interactive.js +0 -133
- package/dist/commands/api/interactive.js.map +0 -1
- package/dist/commands/api/request.d.ts +0 -14
- package/dist/commands/api/request.js +0 -38
- package/dist/commands/api/request.js.map +0 -1
- package/dist/commands/api-key-mgmt.d.ts +0 -16
- package/dist/commands/api-key-mgmt.js +0 -96
- package/dist/commands/api-key-mgmt.js.map +0 -1
- package/dist/commands/audit-log.d.ts +0 -26
- package/dist/commands/audit-log.js +0 -155
- package/dist/commands/audit-log.js.map +0 -1
- package/dist/commands/auth-status.d.ts +0 -1
- package/dist/commands/auth-status.js +0 -57
- package/dist/commands/auth-status.js.map +0 -1
- package/dist/commands/claim.d.ts +0 -11
- package/dist/commands/claim.js +0 -143
- package/dist/commands/claim.js.map +0 -1
- package/dist/commands/config.d.ts +0 -3
- package/dist/commands/config.js +0 -54
- package/dist/commands/config.js.map +0 -1
- package/dist/commands/connection.d.ts +0 -13
- package/dist/commands/connection.js +0 -96
- package/dist/commands/connection.js.map +0 -1
- package/dist/commands/debug-sso.d.ts +0 -1
- package/dist/commands/debug-sso.js +0 -78
- package/dist/commands/debug-sso.js.map +0 -1
- package/dist/commands/debug-sync.d.ts +0 -1
- package/dist/commands/debug-sync.js +0 -102
- package/dist/commands/debug-sync.js.map +0 -1
- package/dist/commands/debug.d.ts +0 -28
- package/dist/commands/debug.js +0 -406
- package/dist/commands/debug.js.map +0 -1
- package/dist/commands/dev.d.ts +0 -22
- package/dist/commands/dev.js +0 -145
- package/dist/commands/dev.js.map +0 -1
- package/dist/commands/directory.d.ts +0 -27
- package/dist/commands/directory.js +0 -176
- package/dist/commands/directory.js.map +0 -1
- package/dist/commands/doctor.d.ts +0 -12
- package/dist/commands/doctor.js +0 -41
- package/dist/commands/doctor.js.map +0 -1
- package/dist/commands/emulate.d.ts +0 -7
- package/dist/commands/emulate.js +0 -69
- package/dist/commands/emulate.js.map +0 -1
- package/dist/commands/env.d.ts +0 -19
- package/dist/commands/env.js +0 -303
- package/dist/commands/env.js.map +0 -1
- package/dist/commands/event.d.ts +0 -9
- package/dist/commands/event.js +0 -43
- package/dist/commands/event.js.map +0 -1
- package/dist/commands/feature-flag.d.ts +0 -12
- package/dist/commands/feature-flag.js +0 -96
- package/dist/commands/feature-flag.js.map +0 -1
- package/dist/commands/install-skill.d.ts +0 -85
- package/dist/commands/install-skill.js +0 -332
- package/dist/commands/install-skill.js.map +0 -1
- package/dist/commands/install.d.ts +0 -6
- package/dist/commands/install.js +0 -51
- package/dist/commands/install.js.map +0 -1
- package/dist/commands/invitation.d.ts +0 -19
- package/dist/commands/invitation.js +0 -94
- package/dist/commands/invitation.js.map +0 -1
- package/dist/commands/list-skills.d.ts +0 -4
- package/dist/commands/list-skills.js +0 -52
- package/dist/commands/list-skills.js.map +0 -1
- package/dist/commands/login.d.ts +0 -32
- package/dist/commands/login.js +0 -239
- package/dist/commands/login.js.map +0 -1
- package/dist/commands/logout.d.ts +0 -1
- package/dist/commands/logout.js +0 -17
- package/dist/commands/logout.js.map +0 -1
- package/dist/commands/mcp.d.ts +0 -14
- package/dist/commands/mcp.js +0 -99
- package/dist/commands/mcp.js.map +0 -1
- package/dist/commands/membership.d.ts +0 -20
- package/dist/commands/membership.js +0 -129
- package/dist/commands/membership.js.map +0 -1
- package/dist/commands/migrations.d.ts +0 -2
- package/dist/commands/migrations.js +0 -50
- package/dist/commands/migrations.js.map +0 -1
- package/dist/commands/onboard-user.d.ts +0 -7
- package/dist/commands/onboard-user.js +0 -61
- package/dist/commands/onboard-user.js.map +0 -1
- package/dist/commands/org-domain.d.ts +0 -4
- package/dist/commands/org-domain.js +0 -45
- package/dist/commands/org-domain.js.map +0 -1
- package/dist/commands/organization.d.ts +0 -14
- package/dist/commands/organization.js +0 -103
- package/dist/commands/organization.js.map +0 -1
- package/dist/commands/permission.d.ts +0 -20
- package/dist/commands/permission.js +0 -93
- package/dist/commands/permission.js.map +0 -1
- package/dist/commands/portal.d.ts +0 -7
- package/dist/commands/portal.js +0 -26
- package/dist/commands/portal.js.map +0 -1
- package/dist/commands/role.d.ts +0 -17
- package/dist/commands/role.js +0 -122
- package/dist/commands/role.js.map +0 -1
- package/dist/commands/seed.d.ts +0 -6
- package/dist/commands/seed.js +0 -298
- package/dist/commands/seed.js.map +0 -1
- package/dist/commands/session.d.ts +0 -8
- package/dist/commands/session.js +0 -63
- package/dist/commands/session.js.map +0 -1
- package/dist/commands/setup-org.d.ts +0 -6
- package/dist/commands/setup-org.js +0 -99
- package/dist/commands/setup-org.js.map +0 -1
- package/dist/commands/setup.d.ts +0 -50
- package/dist/commands/setup.js +0 -237
- package/dist/commands/setup.js.map +0 -1
- package/dist/commands/telemetry.d.ts +0 -3
- package/dist/commands/telemetry.js +0 -88
- package/dist/commands/telemetry.js.map +0 -1
- package/dist/commands/uninstall-skill.d.ts +0 -11
- package/dist/commands/uninstall-skill.js +0 -117
- package/dist/commands/uninstall-skill.js.map +0 -1
- package/dist/commands/user.d.ts +0 -19
- package/dist/commands/user.js +0 -92
- package/dist/commands/user.js.map +0 -1
- package/dist/commands/vault-run.d.ts +0 -13
- package/dist/commands/vault-run.js +0 -195
- package/dist/commands/vault-run.js.map +0 -1
- package/dist/commands/vault.d.ts +0 -25
- package/dist/commands/vault.js +0 -153
- package/dist/commands/vault.js.map +0 -1
- package/dist/commands/verify-login.d.ts +0 -25
- package/dist/commands/verify-login.js +0 -158
- package/dist/commands/verify-login.js.map +0 -1
- package/dist/commands/webhook.d.ts +0 -3
- package/dist/commands/webhook.js +0 -92
- package/dist/commands/webhook.js.map +0 -1
- package/dist/craft-pre-release.sh +0 -10
- package/dist/dashboard/components/AnimatedLogo.d.ts +0 -8
- package/dist/dashboard/components/AnimatedLogo.js +0 -16
- package/dist/dashboard/components/AnimatedLogo.js.map +0 -1
- package/dist/dashboard/components/CompletionView.d.ts +0 -13
- package/dist/dashboard/components/CompletionView.js +0 -25
- package/dist/dashboard/components/CompletionView.js.map +0 -1
- package/dist/dashboard/components/ConfirmPrompt.d.ts +0 -9
- package/dist/dashboard/components/ConfirmPrompt.js +0 -25
- package/dist/dashboard/components/ConfirmPrompt.js.map +0 -1
- package/dist/dashboard/components/CredentialsForm.d.ts +0 -10
- package/dist/dashboard/components/CredentialsForm.js +0 -47
- package/dist/dashboard/components/CredentialsForm.js.map +0 -1
- package/dist/dashboard/components/Dashboard.d.ts +0 -3
- package/dist/dashboard/components/Dashboard.js +0 -100
- package/dist/dashboard/components/Dashboard.js.map +0 -1
- package/dist/dashboard/components/DashboardLayout.d.ts +0 -24
- package/dist/dashboard/components/DashboardLayout.js +0 -25
- package/dist/dashboard/components/DashboardLayout.js.map +0 -1
- package/dist/dashboard/components/DiffPanel.d.ts +0 -9
- package/dist/dashboard/components/DiffPanel.js +0 -136
- package/dist/dashboard/components/DiffPanel.js.map +0 -1
- package/dist/dashboard/components/InlinePrompt.d.ts +0 -8
- package/dist/dashboard/components/InlinePrompt.js +0 -19
- package/dist/dashboard/components/InlinePrompt.js.map +0 -1
- package/dist/dashboard/components/OutputPanel.d.ts +0 -10
- package/dist/dashboard/components/OutputPanel.js +0 -100
- package/dist/dashboard/components/OutputPanel.js.map +0 -1
- package/dist/dashboard/components/Panel.d.ts +0 -12
- package/dist/dashboard/components/Panel.js +0 -6
- package/dist/dashboard/components/Panel.js.map +0 -1
- package/dist/dashboard/components/TextInput.d.ts +0 -13
- package/dist/dashboard/components/TextInput.js +0 -57
- package/dist/dashboard/components/TextInput.js.map +0 -1
- package/dist/dashboard/components/WelcomeArt.d.ts +0 -2
- package/dist/dashboard/components/WelcomeArt.js +0 -9
- package/dist/dashboard/components/WelcomeArt.js.map +0 -1
- package/dist/dashboard/hooks/useAnimation.d.ts +0 -7
- package/dist/dashboard/hooks/useAnimation.js +0 -24
- package/dist/dashboard/hooks/useAnimation.js.map +0 -1
- package/dist/dashboard/hooks/useKeyboard.d.ts +0 -8
- package/dist/dashboard/hooks/useKeyboard.js +0 -18
- package/dist/dashboard/hooks/useKeyboard.js.map +0 -1
- package/dist/dashboard/hooks/useTerminalSize.d.ts +0 -8
- package/dist/dashboard/hooks/useTerminalSize.js +0 -23
- package/dist/dashboard/hooks/useTerminalSize.js.map +0 -1
- package/dist/dashboard/index.d.ts +0 -6
- package/dist/dashboard/index.js +0 -36
- package/dist/dashboard/index.js.map +0 -1
- package/dist/dashboard/lib/diff-utils.d.ts +0 -21
- package/dist/dashboard/lib/diff-utils.js +0 -271
- package/dist/dashboard/lib/diff-utils.js.map +0 -1
- package/dist/dashboard/lib/logo-frames.d.ts +0 -20
- package/dist/dashboard/lib/logo-frames.js +0 -109
- package/dist/dashboard/lib/logo-frames.js.map +0 -1
- package/dist/dashboard/lib/welcome-art.d.ts +0 -1
- package/dist/dashboard/lib/welcome-art.js +0 -5
- package/dist/dashboard/lib/welcome-art.js.map +0 -1
- package/dist/dashboard/types.d.ts +0 -5
- package/dist/dashboard/types.js +0 -2
- package/dist/dashboard/types.js.map +0 -1
- package/dist/doctor/agent-prompt.d.ts +0 -10
- package/dist/doctor/agent-prompt.js +0 -190
- package/dist/doctor/agent-prompt.js.map +0 -1
- package/dist/doctor/checks/ai-analysis.d.ts +0 -9
- package/dist/doctor/checks/ai-analysis.js +0 -124
- package/dist/doctor/checks/ai-analysis.js.map +0 -1
- package/dist/doctor/checks/auth-patterns.d.ts +0 -2
- package/dist/doctor/checks/auth-patterns.js +0 -569
- package/dist/doctor/checks/auth-patterns.js.map +0 -1
- package/dist/doctor/checks/connectivity.d.ts +0 -2
- package/dist/doctor/checks/connectivity.js +0 -35
- package/dist/doctor/checks/connectivity.js.map +0 -1
- package/dist/doctor/checks/dashboard.d.ts +0 -3
- package/dist/doctor/checks/dashboard.js +0 -123
- package/dist/doctor/checks/dashboard.js.map +0 -1
- package/dist/doctor/checks/environment.d.ts +0 -2
- package/dist/doctor/checks/environment.js +0 -86
- package/dist/doctor/checks/environment.js.map +0 -1
- package/dist/doctor/checks/framework.d.ts +0 -2
- package/dist/doctor/checks/framework.js +0 -94
- package/dist/doctor/checks/framework.js.map +0 -1
- package/dist/doctor/checks/host-execution.d.ts +0 -2
- package/dist/doctor/checks/host-execution.js +0 -21
- package/dist/doctor/checks/host-execution.js.map +0 -1
- package/dist/doctor/checks/language.d.ts +0 -6
- package/dist/doctor/checks/language.js +0 -104
- package/dist/doctor/checks/language.js.map +0 -1
- package/dist/doctor/checks/mcp.d.ts +0 -15
- package/dist/doctor/checks/mcp.js +0 -34
- package/dist/doctor/checks/mcp.js.map +0 -1
- package/dist/doctor/checks/runtime.d.ts +0 -2
- package/dist/doctor/checks/runtime.js +0 -20
- package/dist/doctor/checks/runtime.js.map +0 -1
- package/dist/doctor/checks/sdk.d.ts +0 -2
- package/dist/doctor/checks/sdk.js +0 -192
- package/dist/doctor/checks/sdk.js.map +0 -1
- package/dist/doctor/checks/skills.d.ts +0 -9
- package/dist/doctor/checks/skills.js +0 -84
- package/dist/doctor/checks/skills.js.map +0 -1
- package/dist/doctor/clipboard.d.ts +0 -1
- package/dist/doctor/clipboard.js +0 -43
- package/dist/doctor/clipboard.js.map +0 -1
- package/dist/doctor/index.d.ts +0 -26
- package/dist/doctor/index.js +0 -182
- package/dist/doctor/index.js.map +0 -1
- package/dist/doctor/issues.d.ts +0 -63
- package/dist/doctor/issues.js +0 -199
- package/dist/doctor/issues.js.map +0 -1
- package/dist/doctor/json-output.d.ts +0 -2
- package/dist/doctor/json-output.js +0 -4
- package/dist/doctor/json-output.js.map +0 -1
- package/dist/doctor/output.d.ts +0 -7
- package/dist/doctor/output.js +0 -289
- package/dist/doctor/output.js.map +0 -1
- package/dist/doctor/types.d.ts +0 -203
- package/dist/doctor/types.js +0 -2
- package/dist/doctor/types.js.map +0 -1
- package/dist/integrations/dotnet/index.d.ts +0 -8
- package/dist/integrations/dotnet/index.js +0 -170
- package/dist/integrations/dotnet/index.js.map +0 -1
- package/dist/integrations/elixir/index.d.ts +0 -8
- package/dist/integrations/elixir/index.js +0 -146
- package/dist/integrations/elixir/index.js.map +0 -1
- package/dist/integrations/go/index.d.ts +0 -11
- package/dist/integrations/go/index.js +0 -212
- package/dist/integrations/go/index.js.map +0 -1
- package/dist/integrations/kotlin/index.d.ts +0 -4
- package/dist/integrations/kotlin/index.js +0 -78
- package/dist/integrations/kotlin/index.js.map +0 -1
- package/dist/integrations/nextjs/index.d.ts +0 -4
- package/dist/integrations/nextjs/index.js +0 -93
- package/dist/integrations/nextjs/index.js.map +0 -1
- package/dist/integrations/nextjs/utils.d.ts +0 -8
- package/dist/integrations/nextjs/utils.js +0 -68
- package/dist/integrations/nextjs/utils.js.map +0 -1
- package/dist/integrations/node/index.d.ts +0 -4
- package/dist/integrations/node/index.js +0 -52
- package/dist/integrations/node/index.js.map +0 -1
- package/dist/integrations/php/index.d.ts +0 -4
- package/dist/integrations/php/index.js +0 -51
- package/dist/integrations/php/index.js.map +0 -1
- package/dist/integrations/php-laravel/index.d.ts +0 -4
- package/dist/integrations/php-laravel/index.js +0 -51
- package/dist/integrations/php-laravel/index.js.map +0 -1
- package/dist/integrations/python/index.d.ts +0 -9
- package/dist/integrations/python/index.js +0 -249
- package/dist/integrations/python/index.js.map +0 -1
- package/dist/integrations/react/index.d.ts +0 -4
- package/dist/integrations/react/index.js +0 -49
- package/dist/integrations/react/index.js.map +0 -1
- package/dist/integrations/react-router/index.d.ts +0 -4
- package/dist/integrations/react-router/index.js +0 -94
- package/dist/integrations/react-router/index.js.map +0 -1
- package/dist/integrations/react-router/utils.d.ts +0 -10
- package/dist/integrations/react-router/utils.js +0 -162
- package/dist/integrations/react-router/utils.js.map +0 -1
- package/dist/integrations/ruby/index.d.ts +0 -8
- package/dist/integrations/ruby/index.js +0 -137
- package/dist/integrations/ruby/index.js.map +0 -1
- package/dist/integrations/sveltekit/index.d.ts +0 -4
- package/dist/integrations/sveltekit/index.js +0 -50
- package/dist/integrations/sveltekit/index.js.map +0 -1
- package/dist/integrations/tanstack-start/index.d.ts +0 -4
- package/dist/integrations/tanstack-start/index.js +0 -51
- package/dist/integrations/tanstack-start/index.js.map +0 -1
- package/dist/integrations/vanilla-js/index.d.ts +0 -4
- package/dist/integrations/vanilla-js/index.js +0 -49
- package/dist/integrations/vanilla-js/index.js.map +0 -1
- package/dist/lib/__test-helpers__/mock-unclaimed-env-api-error.d.ts +0 -7
- package/dist/lib/__test-helpers__/mock-unclaimed-env-api-error.js +0 -12
- package/dist/lib/__test-helpers__/mock-unclaimed-env-api-error.js.map +0 -1
- package/dist/lib/adapters/cli-adapter.d.ts +0 -113
- package/dist/lib/adapters/cli-adapter.js +0 -641
- package/dist/lib/adapters/cli-adapter.js.map +0 -1
- package/dist/lib/adapters/dashboard-adapter.d.ts +0 -34
- package/dist/lib/adapters/dashboard-adapter.js +0 -121
- package/dist/lib/adapters/dashboard-adapter.js.map +0 -1
- package/dist/lib/adapters/headless-adapter.d.ts +0 -80
- package/dist/lib/adapters/headless-adapter.js +0 -347
- package/dist/lib/adapters/headless-adapter.js.map +0 -1
- package/dist/lib/adapters/index.d.ts +0 -4
- package/dist/lib/adapters/index.js +0 -4
- package/dist/lib/adapters/index.js.map +0 -1
- package/dist/lib/adapters/types.d.ts +0 -41
- package/dist/lib/adapters/types.js +0 -2
- package/dist/lib/adapters/types.js.map +0 -1
- package/dist/lib/agent-interface.d.ts +0 -84
- package/dist/lib/agent-interface.js +0 -840
- package/dist/lib/agent-interface.js.map +0 -1
- package/dist/lib/agent-runner.d.ts +0 -9
- package/dist/lib/agent-runner.js +0 -261
- package/dist/lib/agent-runner.js.map +0 -1
- package/dist/lib/ai-content.d.ts +0 -14
- package/dist/lib/ai-content.js +0 -131
- package/dist/lib/ai-content.js.map +0 -1
- package/dist/lib/api-error-handler.d.ts +0 -18
- package/dist/lib/api-error-handler.js +0 -76
- package/dist/lib/api-error-handler.js.map +0 -1
- package/dist/lib/api-key.d.ts +0 -14
- package/dist/lib/api-key.js +0 -37
- package/dist/lib/api-key.js.map +0 -1
- package/dist/lib/api.d.ts +0 -25
- package/dist/lib/api.js +0 -120
- package/dist/lib/api.js.map +0 -1
- package/dist/lib/background-refresh.d.ts +0 -29
- package/dist/lib/background-refresh.js +0 -95
- package/dist/lib/background-refresh.js.map +0 -1
- package/dist/lib/command-aliases.d.ts +0 -8
- package/dist/lib/command-aliases.js +0 -12
- package/dist/lib/command-aliases.js.map +0 -1
- package/dist/lib/completion-data.d.ts +0 -33
- package/dist/lib/completion-data.js +0 -33
- package/dist/lib/completion-data.js.map +0 -1
- package/dist/lib/config-store.d.ts +0 -63
- package/dist/lib/config-store.js +0 -293
- package/dist/lib/config-store.js.map +0 -1
- package/dist/lib/config.d.ts +0 -34
- package/dist/lib/config.js +0 -37
- package/dist/lib/config.js.map +0 -1
- package/dist/lib/constants.d.ts +0 -51
- package/dist/lib/constants.js +0 -50
- package/dist/lib/constants.js.map +0 -1
- package/dist/lib/credential-discovery.d.ts +0 -42
- package/dist/lib/credential-discovery.js +0 -100
- package/dist/lib/credential-discovery.js.map +0 -1
- package/dist/lib/credential-proxy.d.ts +0 -45
- package/dist/lib/credential-proxy.js +0 -364
- package/dist/lib/credential-proxy.js.map +0 -1
- package/dist/lib/credential-store.d.ts +0 -32
- package/dist/lib/credential-store.js +0 -236
- package/dist/lib/credential-store.js.map +0 -1
- package/dist/lib/credentials.d.ts +0 -13
- package/dist/lib/credentials.js +0 -34
- package/dist/lib/credentials.js.map +0 -1
- package/dist/lib/dev-command.d.ts +0 -26
- package/dist/lib/dev-command.js +0 -129
- package/dist/lib/dev-command.js.map +0 -1
- package/dist/lib/device-auth.d.ts +0 -48
- package/dist/lib/device-auth.js +0 -176
- package/dist/lib/device-auth.js.map +0 -1
- package/dist/lib/device-id.d.ts +0 -25
- package/dist/lib/device-id.js +0 -102
- package/dist/lib/device-id.js.map +0 -1
- package/dist/lib/ensure-auth.d.ts +0 -12
- package/dist/lib/ensure-auth.js +0 -111
- package/dist/lib/ensure-auth.js.map +0 -1
- package/dist/lib/env-writer.d.ts +0 -25
- package/dist/lib/env-writer.js +0 -90
- package/dist/lib/env-writer.js.map +0 -1
- package/dist/lib/events.d.ts +0 -248
- package/dist/lib/events.js +0 -19
- package/dist/lib/events.js.map +0 -1
- package/dist/lib/framework-config.d.ts +0 -133
- package/dist/lib/framework-config.js +0 -11
- package/dist/lib/framework-config.js.map +0 -1
- package/dist/lib/helper-functions.d.ts +0 -1
- package/dist/lib/helper-functions.js +0 -2
- package/dist/lib/helper-functions.js.map +0 -1
- package/dist/lib/host-probe.d.ts +0 -28
- package/dist/lib/host-probe.js +0 -154
- package/dist/lib/host-probe.js.map +0 -1
- package/dist/lib/installer-core.d.ts +0 -569
- package/dist/lib/installer-core.js +0 -1134
- package/dist/lib/installer-core.js.map +0 -1
- package/dist/lib/installer-core.types.d.ts +0 -162
- package/dist/lib/installer-core.types.js +0 -2
- package/dist/lib/installer-core.types.js.map +0 -1
- package/dist/lib/mcp-clients.d.ts +0 -45
- package/dist/lib/mcp-clients.js +0 -297
- package/dist/lib/mcp-clients.js.map +0 -1
- package/dist/lib/port-detection.d.ts +0 -7
- package/dist/lib/port-detection.js +0 -244
- package/dist/lib/port-detection.js.map +0 -1
- package/dist/lib/post-install.d.ts +0 -8
- package/dist/lib/post-install.js +0 -51
- package/dist/lib/post-install.js.map +0 -1
- package/dist/lib/preferences.d.ts +0 -143
- package/dist/lib/preferences.js +0 -227
- package/dist/lib/preferences.js.map +0 -1
- package/dist/lib/progress-tracker.d.ts +0 -22
- package/dist/lib/progress-tracker.js +0 -47
- package/dist/lib/progress-tracker.js.map +0 -1
- package/dist/lib/registry.d.ts +0 -42
- package/dist/lib/registry.js +0 -96
- package/dist/lib/registry.js.map +0 -1
- package/dist/lib/resolve-install-credentials.d.ts +0 -11
- package/dist/lib/resolve-install-credentials.js +0 -53
- package/dist/lib/resolve-install-credentials.js.map +0 -1
- package/dist/lib/run-with-core.d.ts +0 -7
- package/dist/lib/run-with-core.js +0 -559
- package/dist/lib/run-with-core.js.map +0 -1
- package/dist/lib/safe-tools.d.ts +0 -2
- package/dist/lib/safe-tools.js +0 -212
- package/dist/lib/safe-tools.js.map +0 -1
- package/dist/lib/scaffold/index.d.ts +0 -1
- package/dist/lib/scaffold/index.js +0 -2
- package/dist/lib/scaffold/index.js.map +0 -1
- package/dist/lib/scaffold/scaffold.d.ts +0 -66
- package/dist/lib/scaffold/scaffold.js +0 -156
- package/dist/lib/scaffold/scaffold.js.map +0 -1
- package/dist/lib/settings.d.ts +0 -60
- package/dist/lib/settings.js +0 -31
- package/dist/lib/settings.js.map +0 -1
- package/dist/lib/staging-api.d.ts +0 -22
- package/dist/lib/staging-api.js +0 -74
- package/dist/lib/staging-api.js.map +0 -1
- package/dist/lib/startup-notice-gate.d.ts +0 -21
- package/dist/lib/startup-notice-gate.js +0 -29
- package/dist/lib/startup-notice-gate.js.map +0 -1
- package/dist/lib/telemetry-notice.d.ts +0 -25
- package/dist/lib/telemetry-notice.js +0 -58
- package/dist/lib/telemetry-notice.js.map +0 -1
- package/dist/lib/token-refresh-client.d.ts +0 -23
- package/dist/lib/token-refresh-client.js +0 -89
- package/dist/lib/token-refresh-client.js.map +0 -1
- package/dist/lib/token-refresh.d.ts +0 -12
- package/dist/lib/token-refresh.js +0 -27
- package/dist/lib/token-refresh.js.map +0 -1
- package/dist/lib/unclaimed-env-api.d.ts +0 -42
- package/dist/lib/unclaimed-env-api.js +0 -139
- package/dist/lib/unclaimed-env-api.js.map +0 -1
- package/dist/lib/unclaimed-env-provision.d.ts +0 -24
- package/dist/lib/unclaimed-env-provision.js +0 -80
- package/dist/lib/unclaimed-env-provision.js.map +0 -1
- package/dist/lib/unclaimed-warning.d.ts +0 -15
- package/dist/lib/unclaimed-warning.js +0 -78
- package/dist/lib/unclaimed-warning.js.map +0 -1
- package/dist/lib/validation/build-validator.d.ts +0 -21
- package/dist/lib/validation/build-validator.js +0 -153
- package/dist/lib/validation/build-validator.js.map +0 -1
- package/dist/lib/validation/index.d.ts +0 -4
- package/dist/lib/validation/index.js +0 -4
- package/dist/lib/validation/index.js.map +0 -1
- package/dist/lib/validation/quick-checks.d.ts +0 -19
- package/dist/lib/validation/quick-checks.js +0 -192
- package/dist/lib/validation/quick-checks.js.map +0 -1
- package/dist/lib/validation/security-checks.d.ts +0 -35
- package/dist/lib/validation/security-checks.js +0 -106
- package/dist/lib/validation/security-checks.js.map +0 -1
- package/dist/lib/validation/types.d.ts +0 -56
- package/dist/lib/validation/types.js +0 -2
- package/dist/lib/validation/types.js.map +0 -1
- package/dist/lib/validation/validator.d.ts +0 -13
- package/dist/lib/validation/validator.js +0 -711
- package/dist/lib/validation/validator.js.map +0 -1
- package/dist/lib/version-check.d.ts +0 -6
- package/dist/lib/version-check.js +0 -46
- package/dist/lib/version-check.js.map +0 -1
- package/dist/lib/workos-api.d.ts +0 -30
- package/dist/lib/workos-api.js +0 -69
- package/dist/lib/workos-api.js.map +0 -1
- package/dist/lib/workos-client.d.ts +0 -58
- package/dist/lib/workos-client.js +0 -140
- package/dist/lib/workos-client.js.map +0 -1
- package/dist/lib/workos-management.d.ts +0 -32
- package/dist/lib/workos-management.js +0 -149
- package/dist/lib/workos-management.js.map +0 -1
- package/dist/nextjs/nextjs-installer-agent.d.ts +0 -5
- package/dist/nextjs/nextjs-installer-agent.js +0 -6
- package/dist/nextjs/nextjs-installer-agent.js.map +0 -1
- package/dist/nextjs/utils.d.ts +0 -4
- package/dist/nextjs/utils.js +0 -5
- package/dist/nextjs/utils.js.map +0 -1
- package/dist/react/react-installer-agent.d.ts +0 -4
- package/dist/react/react-installer-agent.js +0 -5
- package/dist/react/react-installer-agent.js.map +0 -1
- package/dist/react-router/react-router-installer-agent.d.ts +0 -4
- package/dist/react-router/react-router-installer-agent.js +0 -5
- package/dist/react-router/react-router-installer-agent.js.map +0 -1
- package/dist/react-router/utils.d.ts +0 -4
- package/dist/react-router/utils.js +0 -5
- package/dist/react-router/utils.js.map +0 -1
- package/dist/run.d.ts +0 -33
- package/dist/run.js +0 -58
- package/dist/run.js.map +0 -1
- package/dist/smoke-test.ts +0 -881
- package/dist/steps/add-or-update-environment-variables.d.ts +0 -10
- package/dist/steps/add-or-update-environment-variables.js +0 -155
- package/dist/steps/add-or-update-environment-variables.js.map +0 -1
- package/dist/steps/index.d.ts +0 -3
- package/dist/steps/index.js +0 -4
- package/dist/steps/index.js.map +0 -1
- package/dist/steps/run-prettier.d.ts +0 -5
- package/dist/steps/run-prettier.js +0 -50
- package/dist/steps/run-prettier.js.map +0 -1
- package/dist/steps/upload-environment-variables/EnvironmentProvider.d.ts +0 -8
- package/dist/steps/upload-environment-variables/EnvironmentProvider.js +0 -7
- package/dist/steps/upload-environment-variables/EnvironmentProvider.js.map +0 -1
- package/dist/steps/upload-environment-variables/index.d.ts +0 -6
- package/dist/steps/upload-environment-variables/index.js +0 -69
- package/dist/steps/upload-environment-variables/index.js.map +0 -1
- package/dist/steps/upload-environment-variables/providers/vercel.d.ts +0 -14
- package/dist/steps/upload-environment-variables/providers/vercel.js +0 -107
- package/dist/steps/upload-environment-variables/providers/vercel.js.map +0 -1
- package/dist/tanstack-start/tanstack-start-installer-agent.d.ts +0 -4
- package/dist/tanstack-start/tanstack-start-installer-agent.js +0 -5
- package/dist/tanstack-start/tanstack-start-installer-agent.js.map +0 -1
- package/dist/telemetry.d.ts +0 -2
- package/dist/telemetry.js +0 -29
- package/dist/telemetry.js.map +0 -1
- package/dist/test/force-insecure-storage.d.ts +0 -1
- package/dist/test/force-insecure-storage.js +0 -9
- package/dist/test/force-insecure-storage.js.map +0 -1
- package/dist/test/setup.d.ts +0 -1
- package/dist/test/setup.js +0 -38
- package/dist/test/setup.js.map +0 -1
- package/dist/utils/analytics.d.ts +0 -66
- package/dist/utils/analytics.js +0 -330
- package/dist/utils/analytics.js.map +0 -1
- package/dist/utils/bash.d.ts +0 -2
- package/dist/utils/bash.js +0 -17
- package/dist/utils/bash.js.map +0 -1
- package/dist/utils/box.d.ts +0 -9
- package/dist/utils/box.js +0 -15
- package/dist/utils/box.js.map +0 -1
- package/dist/utils/cli-exit.d.ts +0 -15
- package/dist/utils/cli-exit.js +0 -11
- package/dist/utils/cli-exit.js.map +0 -1
- package/dist/utils/cli-symbols.d.ts +0 -44
- package/dist/utils/cli-symbols.js +0 -58
- package/dist/utils/cli-symbols.js.map +0 -1
- package/dist/utils/command-invocation.d.ts +0 -10
- package/dist/utils/command-invocation.js +0 -26
- package/dist/utils/command-invocation.js.map +0 -1
- package/dist/utils/command-telemetry.d.ts +0 -17
- package/dist/utils/command-telemetry.js +0 -67
- package/dist/utils/command-telemetry.js.map +0 -1
- package/dist/utils/crash-reporter.d.ts +0 -13
- package/dist/utils/crash-reporter.js +0 -91
- package/dist/utils/crash-reporter.js.map +0 -1
- package/dist/utils/debug.d.ts +0 -9
- package/dist/utils/debug.js +0 -105
- package/dist/utils/debug.js.map +0 -1
- package/dist/utils/env-parser.d.ts +0 -5
- package/dist/utils/env-parser.js +0 -18
- package/dist/utils/env-parser.js.map +0 -1
- package/dist/utils/environment.d.ts +0 -10
- package/dist/utils/environment.js +0 -69
- package/dist/utils/environment.js.map +0 -1
- package/dist/utils/errors.d.ts +0 -3
- package/dist/utils/errors.js +0 -7
- package/dist/utils/errors.js.map +0 -1
- package/dist/utils/exec-file.d.ts +0 -15
- package/dist/utils/exec-file.js +0 -39
- package/dist/utils/exec-file.js.map +0 -1
- package/dist/utils/exit-codes.d.ts +0 -31
- package/dist/utils/exit-codes.js +0 -69
- package/dist/utils/exit-codes.js.map +0 -1
- package/dist/utils/git-utils.d.ts +0 -23
- package/dist/utils/git-utils.js +0 -86
- package/dist/utils/git-utils.js.map +0 -1
- package/dist/utils/help-json.d.ts +0 -58
- package/dist/utils/help-json.js +0 -1577
- package/dist/utils/help-json.js.map +0 -1
- package/dist/utils/interaction-mode.d.ts +0 -25
- package/dist/utils/interaction-mode.js +0 -99
- package/dist/utils/interaction-mode.js.map +0 -1
- package/dist/utils/lock-art.d.ts +0 -4
- package/dist/utils/lock-art.js +0 -73
- package/dist/utils/lock-art.js.map +0 -1
- package/dist/utils/logging.d.ts +0 -9
- package/dist/utils/logging.js +0 -36
- package/dist/utils/logging.js.map +0 -1
- package/dist/utils/ndjson.d.ts +0 -16
- package/dist/utils/ndjson.js +0 -18
- package/dist/utils/ndjson.js.map +0 -1
- package/dist/utils/output.d.ts +0 -60
- package/dist/utils/output.js +0 -124
- package/dist/utils/output.js.map +0 -1
- package/dist/utils/package-json.d.ts +0 -26
- package/dist/utils/package-json.js +0 -32
- package/dist/utils/package-json.js.map +0 -1
- package/dist/utils/package-manager.d.ts +0 -21
- package/dist/utils/package-manager.js +0 -166
- package/dist/utils/package-manager.js.map +0 -1
- package/dist/utils/paths.d.ts +0 -5
- package/dist/utils/paths.js +0 -18
- package/dist/utils/paths.js.map +0 -1
- package/dist/utils/platform.d.ts +0 -8
- package/dist/utils/platform.js +0 -7
- package/dist/utils/platform.js.map +0 -1
- package/dist/utils/recovery-hints.d.ts +0 -42
- package/dist/utils/recovery-hints.js +0 -92
- package/dist/utils/recovery-hints.js.map +0 -1
- package/dist/utils/redact.d.ts +0 -5
- package/dist/utils/redact.js +0 -29
- package/dist/utils/redact.js.map +0 -1
- package/dist/utils/register-subcommand.d.ts +0 -10
- package/dist/utils/register-subcommand.js +0 -33
- package/dist/utils/register-subcommand.js.map +0 -1
- package/dist/utils/semver.d.ts +0 -10
- package/dist/utils/semver.js +0 -43
- package/dist/utils/semver.js.map +0 -1
- package/dist/utils/string.d.ts +0 -1
- package/dist/utils/string.js +0 -6
- package/dist/utils/string.js.map +0 -1
- package/dist/utils/summary-box.d.ts +0 -25
- package/dist/utils/summary-box.js +0 -211
- package/dist/utils/summary-box.js.map +0 -1
- package/dist/utils/table.d.ts +0 -5
- package/dist/utils/table.js +0 -18
- package/dist/utils/table.js.map +0 -1
- package/dist/utils/telemetry-client.d.ts +0 -43
- package/dist/utils/telemetry-client.js +0 -171
- package/dist/utils/telemetry-client.js.map +0 -1
- package/dist/utils/telemetry-store-forward.d.ts +0 -11
- package/dist/utils/telemetry-store-forward.js +0 -94
- package/dist/utils/telemetry-store-forward.js.map +0 -1
- package/dist/utils/telemetry-types.d.ts +0 -100
- package/dist/utils/telemetry-types.js +0 -6
- package/dist/utils/telemetry-types.js.map +0 -1
- package/dist/utils/types.d.ts +0 -123
- package/dist/utils/types.js +0 -2
- package/dist/utils/types.js.map +0 -1
- package/dist/utils/ui-utils.d.ts +0 -97
- package/dist/utils/ui-utils.js +0 -449
- package/dist/utils/ui-utils.js.map +0 -1
- package/dist/utils/ui.d.ts +0 -148
- package/dist/utils/ui.js +0 -368
- package/dist/utils/ui.js.map +0 -1
- package/dist/utils/urls.d.ts +0 -13
- package/dist/utils/urls.js +0 -14
- package/dist/utils/urls.js.map +0 -1
- package/dist/utils/vendor/is-unicorn-supported.d.ts +0 -1
- package/dist/utils/vendor/is-unicorn-supported.js +0 -21
- package/dist/utils/vendor/is-unicorn-supported.js.map +0 -1
- package/dist/vanilla-js/vanilla-js-installer-agent.d.ts +0 -4
- package/dist/vanilla-js/vanilla-js-installer-agent.js +0 -5
- package/dist/vanilla-js/vanilla-js-installer-agent.js.map +0 -1
package/README.md
CHANGED
|
@@ -1,649 +1,7 @@
|
|
|
1
1
|
# workos
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Thin npm launcher for the WorkOS CLI. Installing this package pulls in the
|
|
4
|
+
prebuilt binary for your platform via an optional dependency and runs it.
|
|
4
5
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
```bash
|
|
8
|
-
# Run the installer directly with npx (recommended)
|
|
9
|
-
npx workos@latest install
|
|
10
|
-
|
|
11
|
-
# Or install globally
|
|
12
|
-
npm install -g workos
|
|
13
|
-
workos install
|
|
14
|
-
```
|
|
15
|
-
|
|
16
|
-
`npx workos@latest install` is recommended because it bypasses stale global shims and older shell-resolved binaries.
|
|
17
|
-
If a global install reports `unknown command "install"`, run the npx command above or reinstall globally and clear your
|
|
18
|
-
shell command cache.
|
|
19
|
-
|
|
20
|
-
## Features
|
|
21
|
-
|
|
22
|
-
- **15 Framework Support:** Next.js, React Router, TanStack Start, React SPA, Vanilla JS, SvelteKit, Node.js (Express), Python (Django), Ruby (Rails), Go, .NET (ASP.NET Core), Kotlin (Spring Boot), Elixir (Phoenix), PHP (Laravel), PHP
|
|
23
|
-
- **AI-Powered:** Uses Claude to intelligently adapt to your project structure
|
|
24
|
-
- **Security-First:** Masks API keys, redacts from logs, saves to .env.local
|
|
25
|
-
- **Smart Detection:** Auto-detects framework, package manager, router type
|
|
26
|
-
- **Greenfield Scaffolding:** Run in an empty directory to scaffold a new Next.js app (via `create-next-app`) before wiring AuthKit
|
|
27
|
-
- **Live Documentation:** Fetches latest SDK docs from WorkOS and GitHub
|
|
28
|
-
- **Full Integration:** Creates routes, middleware, environment vars, and UI
|
|
29
|
-
- **Agent & CI Ready:** Non-TTY auto-detection, JSON output, structured errors, headless installer with NDJSON streaming
|
|
30
|
-
|
|
31
|
-
## What It Creates
|
|
32
|
-
|
|
33
|
-
Depending on your framework, the installer creates:
|
|
34
|
-
|
|
35
|
-
- ✅ Authentication routes (callback, sign-in, sign-out)
|
|
36
|
-
- ✅ Middleware for route protection
|
|
37
|
-
- ✅ Environment variable configuration
|
|
38
|
-
- ✅ SDK installation with correct package manager
|
|
39
|
-
- ✅ UI components showing login status
|
|
40
|
-
- ✅ User info display (name, email)
|
|
41
|
-
|
|
42
|
-
## Credentials
|
|
43
|
-
|
|
44
|
-
Get your credentials from [dashboard.workos.com](https://dashboard.workos.com):
|
|
45
|
-
|
|
46
|
-
- **API Key** (sk_test_xxx or sk_live_xxx) - For server-side frameworks only
|
|
47
|
-
- **Client ID** (client_xxx) - Required for all frameworks
|
|
48
|
-
|
|
49
|
-
**Security:** API keys are masked during input and redacted in logs.
|
|
50
|
-
|
|
51
|
-
## CLI Options
|
|
52
|
-
|
|
53
|
-
```bash
|
|
54
|
-
workos [command]
|
|
55
|
-
|
|
56
|
-
Commands:
|
|
57
|
-
install Install WorkOS AuthKit into your project
|
|
58
|
-
auth Manage authentication (login, logout, status)
|
|
59
|
-
env Manage environment configurations (add, remove, switch, list, claim)
|
|
60
|
-
doctor Diagnose WorkOS integration issues
|
|
61
|
-
skills Manage WorkOS skills for coding agents (install, uninstall, list)
|
|
62
|
-
|
|
63
|
-
Skills auto-install to detected coding agents on `workos install` and `workos auth login`. Use `workos skills list` to check status, `workos doctor` to detect stale skills, or `workos doctor --fix` to refresh them in place (constrained to `workos/` and `workos-widgets/`).
|
|
64
|
-
|
|
65
|
-
Resource Management:
|
|
66
|
-
organization (org) Manage organizations
|
|
67
|
-
user Manage users
|
|
68
|
-
role Manage roles (RBAC)
|
|
69
|
-
permission Manage permissions (RBAC)
|
|
70
|
-
membership Manage organization memberships
|
|
71
|
-
invitation Manage user invitations
|
|
72
|
-
session Manage user sessions
|
|
73
|
-
connection Manage SSO connections
|
|
74
|
-
directory Manage directory sync
|
|
75
|
-
event Query events
|
|
76
|
-
audit-log Manage audit logs
|
|
77
|
-
feature-flag Manage feature flags
|
|
78
|
-
webhook Manage webhooks
|
|
79
|
-
config Manage redirect URIs, CORS, homepage URL
|
|
80
|
-
portal Generate Admin Portal links
|
|
81
|
-
vault Manage encrypted secrets
|
|
82
|
-
api-key Manage per-org API keys
|
|
83
|
-
org-domain Manage organization domains
|
|
84
|
-
|
|
85
|
-
Migrations:
|
|
86
|
-
migrations Migrate users and SSO connections into WorkOS
|
|
87
|
-
|
|
88
|
-
Local Development:
|
|
89
|
-
emulate Start a local WorkOS API emulator
|
|
90
|
-
|
|
91
|
-
Workflows:
|
|
92
|
-
seed Declarative resource provisioning from YAML
|
|
93
|
-
setup-org One-shot organization onboarding
|
|
94
|
-
onboard-user Send invitation and assign role
|
|
95
|
-
debug-sso Diagnose SSO connection issues
|
|
96
|
-
debug-sync Diagnose directory sync issues
|
|
97
|
-
```
|
|
98
|
-
|
|
99
|
-
All management commands support `--json` for structured output (auto-enabled in non-TTY) and `--api-key` to override the active environment's key.
|
|
100
|
-
|
|
101
|
-
### Unclaimed Environments
|
|
102
|
-
|
|
103
|
-
When you run `workos install` without credentials, the CLI automatically provisions a temporary WorkOS environment — no account needed. This lets you try AuthKit immediately.
|
|
104
|
-
|
|
105
|
-
```bash
|
|
106
|
-
# Install with zero setup — environment provisioned automatically
|
|
107
|
-
npx workos@latest install
|
|
108
|
-
|
|
109
|
-
# Check your environment
|
|
110
|
-
workos env list
|
|
111
|
-
# Shows: unclaimed (unclaimed) ← active
|
|
112
|
-
|
|
113
|
-
# Claim the environment to link it to your WorkOS account
|
|
114
|
-
workos env claim
|
|
115
|
-
```
|
|
116
|
-
|
|
117
|
-
Management commands work on unclaimed environments with a warning reminding you to claim.
|
|
118
|
-
|
|
119
|
-
### Workflows
|
|
120
|
-
|
|
121
|
-
The compound workflow commands compose multiple API calls into common operations. These are the highest-value commands for both developers and AI agents.
|
|
122
|
-
|
|
123
|
-
#### seed — Declarative resource provisioning
|
|
124
|
-
|
|
125
|
-
Provision permissions, roles, organizations, and config from a YAML file. Tracks created resources for clean teardown.
|
|
126
|
-
|
|
127
|
-
```bash
|
|
128
|
-
# Apply a seed file
|
|
129
|
-
workos seed --file workos-seed.yml
|
|
130
|
-
|
|
131
|
-
# Tear down everything the seed created (reads .workos-seed-state.json)
|
|
132
|
-
workos seed --clean
|
|
133
|
-
```
|
|
134
|
-
|
|
135
|
-
Example `workos-seed.yml`:
|
|
136
|
-
|
|
137
|
-
```yaml
|
|
138
|
-
permissions:
|
|
139
|
-
- name: Read Posts
|
|
140
|
-
slug: posts:read
|
|
141
|
-
- name: Write Posts
|
|
142
|
-
slug: posts:write
|
|
143
|
-
|
|
144
|
-
roles:
|
|
145
|
-
- name: Editor
|
|
146
|
-
slug: editor
|
|
147
|
-
permissions: [posts:read, posts:write]
|
|
148
|
-
- name: Viewer
|
|
149
|
-
slug: viewer
|
|
150
|
-
permissions: [posts:read]
|
|
151
|
-
|
|
152
|
-
organizations:
|
|
153
|
-
- name: Acme Corp
|
|
154
|
-
domains: [acme.com]
|
|
155
|
-
|
|
156
|
-
config:
|
|
157
|
-
redirect_uris:
|
|
158
|
-
- http://localhost:3000/callback
|
|
159
|
-
cors_origins:
|
|
160
|
-
- http://localhost:3000
|
|
161
|
-
homepage_url: http://localhost:3000
|
|
162
|
-
```
|
|
163
|
-
|
|
164
|
-
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.
|
|
165
|
-
|
|
166
|
-
#### setup-org — One-shot organization onboarding
|
|
167
|
-
|
|
168
|
-
Creates an organization with optional domain verification, roles, and an Admin Portal link in a single command.
|
|
169
|
-
|
|
170
|
-
```bash
|
|
171
|
-
# Minimal: just create the org
|
|
172
|
-
workos setup-org "Acme Corp"
|
|
173
|
-
|
|
174
|
-
# Full: org + domain + roles + portal link
|
|
175
|
-
workos setup-org "Acme Corp" --domain acme.com --roles admin,viewer
|
|
176
|
-
```
|
|
177
|
-
|
|
178
|
-
#### onboard-user — User invitation workflow
|
|
179
|
-
|
|
180
|
-
Sends an invitation to a user with an optional role assignment. With `--wait`, polls until the invitation is accepted.
|
|
181
|
-
|
|
182
|
-
```bash
|
|
183
|
-
# Send invitation
|
|
184
|
-
workos onboard-user alice@acme.com --org org_01ABC123
|
|
185
|
-
|
|
186
|
-
# Send with role and wait for acceptance
|
|
187
|
-
workos onboard-user alice@acme.com --org org_01ABC123 --role admin --wait
|
|
188
|
-
```
|
|
189
|
-
|
|
190
|
-
#### debug-sso — SSO connection diagnostics
|
|
191
|
-
|
|
192
|
-
Inspects an SSO connection's state and recent authentication events. Flags inactive connections and surfaces auth event history for debugging.
|
|
193
|
-
|
|
194
|
-
```bash
|
|
195
|
-
workos debug-sso conn_01ABC123
|
|
196
|
-
```
|
|
197
|
-
|
|
198
|
-
#### debug-sync — Directory sync diagnostics
|
|
199
|
-
|
|
200
|
-
Inspects a directory's sync state, user/group counts, recent events, and detects stalled syncs.
|
|
201
|
-
|
|
202
|
-
```bash
|
|
203
|
-
workos debug-sync directory_01ABC123
|
|
204
|
-
```
|
|
205
|
-
|
|
206
|
-
### Migrations
|
|
207
|
-
|
|
208
|
-
Migrate users and SSO connections from other identity providers into WorkOS. The `migrations` namespace passes through to `@workos/migrations`.
|
|
209
|
-
|
|
210
|
-
```bash
|
|
211
|
-
# Interactive migration wizard
|
|
212
|
-
workos migrations wizard
|
|
213
|
-
|
|
214
|
-
# Export a blank CSV template
|
|
215
|
-
workos migrations export-template saml_connections --output saml_connections.csv
|
|
216
|
-
workos migrations export-template oidc_connections --output oidc_connections.csv
|
|
217
|
-
|
|
218
|
-
# Export from Auth0
|
|
219
|
-
workos migrations export-auth0 --domain your-tenant.auth0.com --client-id <id> --client-secret <secret>
|
|
220
|
-
|
|
221
|
-
# Import users from CSV
|
|
222
|
-
workos migrations import --csv users.csv
|
|
223
|
-
```
|
|
224
|
-
|
|
225
|
-
Run `workos migrations --help` for all available subcommands.
|
|
226
|
-
|
|
227
|
-
### Local Emulation
|
|
228
|
-
|
|
229
|
-
Start a local WorkOS API emulator. The command is backed by [`@workos/emulate`](https://github.com/workos/emulate); the standalone package binary is `workos-emulate`.
|
|
230
|
-
|
|
231
|
-
```bash
|
|
232
|
-
# Start with defaults (port 4100)
|
|
233
|
-
workos emulate
|
|
234
|
-
|
|
235
|
-
# CI-friendly: JSON output, custom port
|
|
236
|
-
workos emulate --port 9100 --json
|
|
237
|
-
|
|
238
|
-
# Pre-load seed data
|
|
239
|
-
workos emulate --seed workos-emulate.config.yaml
|
|
240
|
-
|
|
241
|
-
# Show login pages for SSO/AuthKit browser testing
|
|
242
|
-
workos emulate --interactive
|
|
243
|
-
```
|
|
244
|
-
|
|
245
|
-
### Environment Management
|
|
246
|
-
|
|
247
|
-
```bash
|
|
248
|
-
workos env add [name] [apiKey] # Add environment (interactive if no args)
|
|
249
|
-
workos env remove <name> # Remove an environment
|
|
250
|
-
workos env switch [name] # Switch active environment
|
|
251
|
-
workos env list # List environments with active indicator
|
|
252
|
-
```
|
|
253
|
-
|
|
254
|
-
API keys are stored in the system keychain via `@napi-rs/keyring`, with a JSON file fallback at `~/.workos/config.json`.
|
|
255
|
-
|
|
256
|
-
### Resource Management
|
|
257
|
-
|
|
258
|
-
All resource commands follow the same pattern: `workos <resource> <action> [args] [--options]`. API keys resolve via: `--api-key` flag → `WORKOS_API_KEY` env var → active environment's stored key.
|
|
259
|
-
|
|
260
|
-
#### organization
|
|
261
|
-
|
|
262
|
-
```bash
|
|
263
|
-
workos organization create <name> [domain:state ...]
|
|
264
|
-
workos organization update <orgId> <name> [domain] [state]
|
|
265
|
-
workos organization get <orgId>
|
|
266
|
-
workos organization list [--domain] [--limit] [--before] [--after] [--order]
|
|
267
|
-
workos organization delete <orgId>
|
|
268
|
-
```
|
|
269
|
-
|
|
270
|
-
#### user
|
|
271
|
-
|
|
272
|
-
```bash
|
|
273
|
-
workos user get <userId>
|
|
274
|
-
workos user list [--email] [--organization] [--limit]
|
|
275
|
-
workos user update <userId> [--first-name] [--last-name] [--email-verified] [--password] [--external-id]
|
|
276
|
-
workos user delete <userId>
|
|
277
|
-
```
|
|
278
|
-
|
|
279
|
-
#### role
|
|
280
|
-
|
|
281
|
-
```bash
|
|
282
|
-
workos role list [--org <orgId>]
|
|
283
|
-
workos role get <slug> [--org <orgId>]
|
|
284
|
-
workos role create --slug <slug> --name <name> [--org <orgId>]
|
|
285
|
-
workos role update <slug> [--name] [--description] [--org <orgId>]
|
|
286
|
-
workos role delete <slug> --org <orgId>
|
|
287
|
-
workos role set-permissions <slug> --permissions <slugs> [--org <orgId>]
|
|
288
|
-
workos role add-permission <slug> <permissionSlug> [--org <orgId>]
|
|
289
|
-
workos role remove-permission <slug> <permissionSlug> --org <orgId>
|
|
290
|
-
```
|
|
291
|
-
|
|
292
|
-
#### permission
|
|
293
|
-
|
|
294
|
-
```bash
|
|
295
|
-
workos permission list [--limit]
|
|
296
|
-
workos permission get <slug>
|
|
297
|
-
workos permission create --slug <slug> --name <name> [--description]
|
|
298
|
-
workos permission update <slug> [--name] [--description]
|
|
299
|
-
workos permission delete <slug>
|
|
300
|
-
```
|
|
301
|
-
|
|
302
|
-
#### membership
|
|
303
|
-
|
|
304
|
-
```bash
|
|
305
|
-
workos membership list [--org] [--user] [--limit]
|
|
306
|
-
workos membership get <id>
|
|
307
|
-
workos membership create --org <orgId> --user <userId> [--role]
|
|
308
|
-
workos membership update <id> [--role]
|
|
309
|
-
workos membership delete <id>
|
|
310
|
-
workos membership deactivate <id>
|
|
311
|
-
workos membership reactivate <id>
|
|
312
|
-
```
|
|
313
|
-
|
|
314
|
-
#### invitation
|
|
315
|
-
|
|
316
|
-
```bash
|
|
317
|
-
workos invitation list [--org] [--email] [--limit]
|
|
318
|
-
workos invitation get <id>
|
|
319
|
-
workos invitation send --email <email> [--org] [--role] [--expires-in-days]
|
|
320
|
-
workos invitation revoke <id>
|
|
321
|
-
workos invitation resend <id>
|
|
322
|
-
```
|
|
323
|
-
|
|
324
|
-
#### session
|
|
325
|
-
|
|
326
|
-
```bash
|
|
327
|
-
workos session list <userId> [--limit]
|
|
328
|
-
workos session revoke <sessionId>
|
|
329
|
-
```
|
|
330
|
-
|
|
331
|
-
#### connection
|
|
332
|
-
|
|
333
|
-
```bash
|
|
334
|
-
workos connection list [--org] [--type] [--limit]
|
|
335
|
-
workos connection get <id>
|
|
336
|
-
workos connection delete <id> [--force]
|
|
337
|
-
```
|
|
338
|
-
|
|
339
|
-
#### directory
|
|
340
|
-
|
|
341
|
-
```bash
|
|
342
|
-
workos directory list [--org] [--limit]
|
|
343
|
-
workos directory get <id>
|
|
344
|
-
workos directory delete <id> [--force]
|
|
345
|
-
workos directory list-users [--directory] [--group] [--limit]
|
|
346
|
-
workos directory list-groups --directory <id> [--limit]
|
|
347
|
-
```
|
|
348
|
-
|
|
349
|
-
#### event
|
|
350
|
-
|
|
351
|
-
```bash
|
|
352
|
-
workos event list --events <types> [--org] [--range-start] [--range-end] [--limit]
|
|
353
|
-
```
|
|
354
|
-
|
|
355
|
-
#### audit-log
|
|
356
|
-
|
|
357
|
-
```bash
|
|
358
|
-
workos audit-log create-event <orgId> --action <action> --actor-type <type> --actor-id <id> [--file <json>]
|
|
359
|
-
workos audit-log export --org <orgId> --range-start <date> --range-end <date> [--actions] [--actor-names]
|
|
360
|
-
workos audit-log list-actions
|
|
361
|
-
workos audit-log get-schema <action>
|
|
362
|
-
workos audit-log create-schema <action> --file <schema.json>
|
|
363
|
-
workos audit-log get-retention <orgId>
|
|
364
|
-
```
|
|
365
|
-
|
|
366
|
-
#### feature-flag
|
|
367
|
-
|
|
368
|
-
```bash
|
|
369
|
-
workos feature-flag list [--limit]
|
|
370
|
-
workos feature-flag get <slug>
|
|
371
|
-
workos feature-flag enable <slug>
|
|
372
|
-
workos feature-flag disable <slug>
|
|
373
|
-
workos feature-flag add-target <slug> <targetId>
|
|
374
|
-
workos feature-flag remove-target <slug> <targetId>
|
|
375
|
-
```
|
|
376
|
-
|
|
377
|
-
#### webhook
|
|
378
|
-
|
|
379
|
-
```bash
|
|
380
|
-
workos webhook list
|
|
381
|
-
workos webhook create --url <endpoint> --events <types>
|
|
382
|
-
workos webhook delete <id>
|
|
383
|
-
```
|
|
384
|
-
|
|
385
|
-
#### config
|
|
386
|
-
|
|
387
|
-
```bash
|
|
388
|
-
workos config redirect add <uri>
|
|
389
|
-
workos config cors add <origin>
|
|
390
|
-
workos config homepage-url set <url>
|
|
391
|
-
```
|
|
392
|
-
|
|
393
|
-
#### portal
|
|
394
|
-
|
|
395
|
-
```bash
|
|
396
|
-
workos portal generate-link --intent <intent> --org <orgId> [--return-url] [--success-url]
|
|
397
|
-
```
|
|
398
|
-
|
|
399
|
-
#### vault
|
|
400
|
-
|
|
401
|
-
```bash
|
|
402
|
-
workos vault list [--limit]
|
|
403
|
-
workos vault get <id> [--decrypt]
|
|
404
|
-
workos vault get-by-name <name> [--decrypt]
|
|
405
|
-
workos vault create --name <name> --org <orgId> [--value <secret>] # omit --value to read from stdin
|
|
406
|
-
workos vault update <id> [--value <secret>] [--version-check] # omit --value to read from stdin
|
|
407
|
-
workos vault delete <id>
|
|
408
|
-
workos vault describe <id>
|
|
409
|
-
workos vault list-versions <id>
|
|
410
|
-
workos vault run --secret ENV_VAR=vault-name [...] [--env <name>] [--dry-run] -- <command>
|
|
411
|
-
```
|
|
412
|
-
|
|
413
|
-
#### api-key
|
|
414
|
-
|
|
415
|
-
```bash
|
|
416
|
-
workos api-key list --org <orgId> [--limit]
|
|
417
|
-
workos api-key create --org <orgId> --name <name> [--permissions]
|
|
418
|
-
workos api-key validate <value>
|
|
419
|
-
workos api-key delete <id>
|
|
420
|
-
```
|
|
421
|
-
|
|
422
|
-
#### org-domain
|
|
423
|
-
|
|
424
|
-
```bash
|
|
425
|
-
workos org-domain get <id>
|
|
426
|
-
workos org-domain create <domain> --org <orgId>
|
|
427
|
-
workos org-domain verify <id>
|
|
428
|
-
workos org-domain delete <id>
|
|
429
|
-
```
|
|
430
|
-
|
|
431
|
-
### Installer Options
|
|
432
|
-
|
|
433
|
-
```bash
|
|
434
|
-
workos install [options]
|
|
435
|
-
|
|
436
|
-
--direct, -D Use your own Anthropic API key (bypass llm-gateway)
|
|
437
|
-
--api-key <key> WorkOS API key (required in non-interactive mode)
|
|
438
|
-
--client-id <id> WorkOS client ID (required in non-interactive mode)
|
|
439
|
-
--redirect-uri <uri> Custom redirect URI
|
|
440
|
-
--homepage-url <url> Custom homepage URL
|
|
441
|
-
--install-dir <path> Installation directory
|
|
442
|
-
--scaffold Scaffold a new Next.js app when run in an empty directory
|
|
443
|
-
--pm <manager> Package manager for the scaffolded app: npm, pnpm, yarn, bun
|
|
444
|
-
--no-validate Skip post-installation validation
|
|
445
|
-
--no-branch Skip branch creation (use current branch)
|
|
446
|
-
--no-commit Skip auto-commit after installation
|
|
447
|
-
--create-pr Auto-create pull request after installation
|
|
448
|
-
--no-git-check Skip git dirty working tree check
|
|
449
|
-
--force-install Force install packages even if peer dependency checks fail
|
|
450
|
-
--debug Enable verbose logging
|
|
451
|
-
```
|
|
452
|
-
|
|
453
|
-
**Empty directories:** Running `workos install` in an empty directory scaffolds a new Next.js app with `create-next-app` (App Router, TypeScript, Tailwind, `src/`) and then wires AuthKit into it. This only happens when the directory is empty or contains nothing but VCS/editor metadata (`.git`, `.gitignore`, `LICENSE`, `.idea`, and similar). Any project file — including a `README.md` or a `package.json` — opts out, and the installer treats the directory as an existing project. Interactive runs confirm first (default yes); non-interactive/headless runs (or `--scaffold`) scaffold automatically and report `"scaffolded": true`. The package manager is resolved from how you invoked the CLI (`npm_config_user_agent`) unless you pass `--pm`.
|
|
454
|
-
|
|
455
|
-
## Examples
|
|
456
|
-
|
|
457
|
-
```bash
|
|
458
|
-
# Interactive (recommended)
|
|
459
|
-
npx workos@latest install
|
|
460
|
-
|
|
461
|
-
# Greenfield: scaffold a new Next.js app + AuthKit in an empty directory
|
|
462
|
-
mkdir my-app && cd my-app && npx workos@latest install
|
|
463
|
-
|
|
464
|
-
# With visual dashboard (experimental)
|
|
465
|
-
npx workos@latest dashboard
|
|
466
|
-
|
|
467
|
-
# JSON output (explicit)
|
|
468
|
-
workos org list --json --api-key sk_test_xxx
|
|
469
|
-
|
|
470
|
-
# Pipe-friendly (auto-detects non-TTY)
|
|
471
|
-
workos org list --api-key sk_test_xxx | jq '.data[].name'
|
|
472
|
-
|
|
473
|
-
# Machine-readable command discovery
|
|
474
|
-
workos --help --json | jq '.commands[].name'
|
|
475
|
-
```
|
|
476
|
-
|
|
477
|
-
## Scripting & Automation
|
|
478
|
-
|
|
479
|
-
The CLI separates **output mode** from **interaction mode**:
|
|
480
|
-
|
|
481
|
-
- `--json` (or non-TTY auto-detection) controls **output formatting** only.
|
|
482
|
-
- `--mode human|agent|ci` (or `WORKOS_MODE=...`) controls **interaction behavior** — prompts, browser launch, host trust, destructive confirmation.
|
|
483
|
-
|
|
484
|
-
For coding agents, set both axes explicitly:
|
|
485
|
-
|
|
486
|
-
```bash
|
|
487
|
-
WORKOS_MODE=agent workos doctor --json --skip-ai
|
|
488
|
-
```
|
|
489
|
-
|
|
490
|
-
The CLI also auto-detects non-TTY environments (piped output, CI, coding agents) and falls back to machine-friendly defaults. No flags are required — just pipe it — but explicit mode is recommended for agents.
|
|
491
|
-
|
|
492
|
-
### JSON Output
|
|
493
|
-
|
|
494
|
-
All commands produce structured JSON when piped or with `--json`:
|
|
495
|
-
|
|
496
|
-
```bash
|
|
497
|
-
workos org list --api-key sk_test_xxx | jq .
|
|
498
|
-
# → { "data": [...], "list_metadata": { "before": null, "after": "..." } }
|
|
499
|
-
|
|
500
|
-
workos env list --json
|
|
501
|
-
# → { "data": [{ "name": "prod", "type": "production", "active": true, ... }] }
|
|
502
|
-
```
|
|
503
|
-
|
|
504
|
-
Errors go to stderr as structured JSON:
|
|
505
|
-
|
|
506
|
-
```bash
|
|
507
|
-
workos org list 2>&1
|
|
508
|
-
# → { "error": { "code": "no_api_key", "message": "No API key configured..." } }
|
|
509
|
-
```
|
|
510
|
-
|
|
511
|
-
### Agent Mode
|
|
512
|
-
|
|
513
|
-
When a coding agent drives the CLI, set agent mode explicitly so behavior is deterministic regardless of TTY:
|
|
514
|
-
|
|
515
|
-
```bash
|
|
516
|
-
WORKOS_MODE=agent workos doctor --json --skip-ai
|
|
517
|
-
WORKOS_MODE=agent workos install --api-key ... --client-id ...
|
|
518
|
-
```
|
|
519
|
-
|
|
520
|
-
In agent mode the CLI:
|
|
521
|
-
|
|
522
|
-
- Never prompts. Missing required arguments fail with structured errors instead of opening prompts.
|
|
523
|
-
- Treats browser launch as best-effort. Auth flows always print the manual URL and code.
|
|
524
|
-
- Probes host capabilities (home directory, keychain, browser launch). Host failures emit a `HOST_EXECUTION_UNTRUSTED` issue from `workos doctor` so agents can recognize sandboxed runs.
|
|
525
|
-
- Requires explicit confirmation flags (e.g. `--yes`, `--force`) for destructive operations.
|
|
526
|
-
|
|
527
|
-
In `ci` mode the CLI additionally refuses browser-based auth flows and prefers terse failures over recovery handoff text.
|
|
528
|
-
|
|
529
|
-
Mode resolution notes:
|
|
530
|
-
|
|
531
|
-
- `WORKOS_MODE=agent` sets agent interaction behavior and forces JSON output. (This replaces the removed `WORKOS_NO_PROMPT` alias.)
|
|
532
|
-
- `WORKOS_FORCE_TTY=1` forces human **output** mode but does not change interaction mode.
|
|
533
|
-
- Non-TTY without an explicit mode still defaults output to JSON and interaction to agent.
|
|
534
|
-
|
|
535
|
-
### Headless Installer
|
|
536
|
-
|
|
537
|
-
In non-TTY, the installer streams progress as NDJSON (one JSON object per line):
|
|
538
|
-
|
|
539
|
-
```bash
|
|
540
|
-
workos install --api-key sk_test_xxx --client-id client_xxx --no-commit 2>/dev/null
|
|
541
|
-
# → {"type":"detection:complete","integration":"nextjs","timestamp":"..."}
|
|
542
|
-
# → {"type":"agent:start","timestamp":"..."}
|
|
543
|
-
# → {"type":"agent:progress","message":"...","timestamp":"..."}
|
|
544
|
-
# → {"type":"complete","success":true,"timestamp":"..."}
|
|
545
|
-
```
|
|
546
|
-
|
|
547
|
-
### Exit Codes
|
|
548
|
-
|
|
549
|
-
| Code | Meaning |
|
|
550
|
-
| ---- | ----------------------- |
|
|
551
|
-
| 0 | Success |
|
|
552
|
-
| 1 | General error |
|
|
553
|
-
| 2 | Cancelled |
|
|
554
|
-
| 4 | Authentication required |
|
|
555
|
-
|
|
556
|
-
### Environment Variables
|
|
557
|
-
|
|
558
|
-
| Variable | Effect |
|
|
559
|
-
| ------------------------ | --------------------------------------------------------- |
|
|
560
|
-
| `WORKOS_API_KEY` | API key for management commands (bypasses stored config) |
|
|
561
|
-
| `WORKOS_API_BASE_URL` | Override API base URL (set automatically by `workos dev`) |
|
|
562
|
-
| `WORKOS_MODE` | Interaction mode: `human`, `agent`, or `ci` |
|
|
563
|
-
| `WORKOS_FORCE_TTY=1` | Force human (non-JSON) **output** mode even when piped |
|
|
564
|
-
| `WORKOS_TELEMETRY=false` | Disable telemetry |
|
|
565
|
-
|
|
566
|
-
### Command Discovery
|
|
567
|
-
|
|
568
|
-
Agents can introspect available commands:
|
|
569
|
-
|
|
570
|
-
```bash
|
|
571
|
-
workos --help --json # Full command tree
|
|
572
|
-
workos env --help --json # Subcommand tree
|
|
573
|
-
workos organization --help --json # With positionals and option types
|
|
574
|
-
```
|
|
575
|
-
|
|
576
|
-
## Authentication
|
|
577
|
-
|
|
578
|
-
The CLI uses WorkOS Connect OAuth device flow for authentication:
|
|
579
|
-
|
|
580
|
-
```bash
|
|
581
|
-
# Login (opens browser for authentication)
|
|
582
|
-
npx workos@latest auth login
|
|
583
|
-
|
|
584
|
-
# Check current auth status
|
|
585
|
-
npx workos@latest auth status
|
|
586
|
-
|
|
587
|
-
# Logout (clears stored credentials)
|
|
588
|
-
npx workos@latest auth logout
|
|
589
|
-
```
|
|
590
|
-
|
|
591
|
-
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.
|
|
592
|
-
|
|
593
|
-
## How It Works
|
|
594
|
-
|
|
595
|
-
1. **Detects** your framework and project structure
|
|
596
|
-
2. **Resolves credentials** — uses existing config, or auto-provisions an unclaimed environment if none found
|
|
597
|
-
3. **Auto-configures** WorkOS dashboard (redirect URI, CORS, homepage URL)
|
|
598
|
-
4. **Fetches** latest SDK documentation from workos.com
|
|
599
|
-
5. **Uses AI** (Claude) to generate integration code
|
|
600
|
-
6. **Installs** SDK with detected package manager
|
|
601
|
-
7. **Creates** auth routes, middleware, and UI
|
|
602
|
-
8. **Configures** environment variables securely
|
|
603
|
-
|
|
604
|
-
## Telemetry
|
|
605
|
-
|
|
606
|
-
The CLI collects anonymous usage telemetry to help improve the product:
|
|
607
|
-
|
|
608
|
-
- **Command events** -- command name, duration, success/failure, termination reason, and which flags were used (for telemetry-enabled commands; `install` and `dashboard` use session events instead)
|
|
609
|
-
- **Session events** -- framework detected, step timing, token usage (installer only)
|
|
610
|
-
- **Crash events** -- sanitized error type and stack trace (no secrets, truncated to 4KB)
|
|
611
|
-
|
|
612
|
-
Environment fingerprint (OS, Node version, shell, CI detection) is included on all events. No code, credentials, or personal data is collected.
|
|
613
|
-
|
|
614
|
-
Disable with:
|
|
615
|
-
|
|
616
|
-
```bash
|
|
617
|
-
WORKOS_TELEMETRY=false workos <command>
|
|
618
|
-
```
|
|
619
|
-
|
|
620
|
-
## Logs
|
|
621
|
-
|
|
622
|
-
Detailed logs (with redacted credentials) are saved to:
|
|
623
|
-
|
|
624
|
-
```
|
|
625
|
-
~/.workos/logs/workos-{timestamp}.log
|
|
626
|
-
```
|
|
627
|
-
|
|
628
|
-
Up to 10 session log files are retained. Use `--debug` flag for verbose terminal output.
|
|
629
|
-
|
|
630
|
-
## Development
|
|
631
|
-
|
|
632
|
-
See [DEVELOPMENT.md](./DEVELOPMENT.md) for development setup.
|
|
633
|
-
|
|
634
|
-
Build:
|
|
635
|
-
|
|
636
|
-
```bash
|
|
637
|
-
pnpm build
|
|
638
|
-
```
|
|
639
|
-
|
|
640
|
-
Run locally:
|
|
641
|
-
|
|
642
|
-
```bash
|
|
643
|
-
pnpm dev # Watch mode
|
|
644
|
-
./dist/bin.js --help
|
|
645
|
-
```
|
|
646
|
-
|
|
647
|
-
## License
|
|
648
|
-
|
|
649
|
-
MIT © WorkOS
|
|
6
|
+
Standalone binaries are also available from
|
|
7
|
+
[GitHub Releases](https://github.com/workos/cli/releases/latest).
|
package/bin/workos.js
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
'use strict';
|
|
3
|
+
// Thin launcher: resolves the compiled workos binary for this platform from
|
|
4
|
+
// the matching @workos/cli-<platform>-<arch> optionalDependency and runs it.
|
|
5
|
+
const { spawnSync } = require('node:child_process');
|
|
6
|
+
|
|
7
|
+
// Same musl detection the napi-rs loaders use: Alpine's ldd is a musl script,
|
|
8
|
+
// and glibc processes report a glibcVersionRuntime header.
|
|
9
|
+
function isMusl() {
|
|
10
|
+
if (process.platform !== 'linux') return false;
|
|
11
|
+
try {
|
|
12
|
+
if (require('node:fs').readFileSync('/usr/bin/ldd', 'utf8').includes('musl')) return true;
|
|
13
|
+
} catch {}
|
|
14
|
+
try {
|
|
15
|
+
const report = process.report?.getReport();
|
|
16
|
+
if (report?.header) return !report.header.glibcVersionRuntime;
|
|
17
|
+
} catch {}
|
|
18
|
+
return false;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
const key = `${process.platform}-${process.arch}${isMusl() ? '-musl' : ''}`;
|
|
22
|
+
const executable = process.platform === 'win32' ? 'workos.exe' : 'workos';
|
|
23
|
+
|
|
24
|
+
let binary;
|
|
25
|
+
try {
|
|
26
|
+
binary = require.resolve(`@workos/cli-${key}/bin/${executable}`);
|
|
27
|
+
} catch {
|
|
28
|
+
console.error(`workos: no prebuilt binary for ${key}.`);
|
|
29
|
+
console.error('Supported platforms: darwin-arm64, darwin-x64, linux-x64, linux-arm64, linux-x64-musl, linux-arm64-musl, win32-x64, win32-arm64.');
|
|
30
|
+
console.error('If your platform is listed, reinstall with optional dependencies enabled');
|
|
31
|
+
console.error('(npm install --include=optional), or download a binary directly:');
|
|
32
|
+
console.error('https://github.com/workos/cli/releases/latest');
|
|
33
|
+
process.exit(1);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
const result = spawnSync(binary, process.argv.slice(2), { stdio: 'inherit' });
|
|
37
|
+
if (result.error) {
|
|
38
|
+
console.error(`workos: failed to run ${binary}: ${result.error.message}`);
|
|
39
|
+
process.exit(1);
|
|
40
|
+
}
|
|
41
|
+
if (result.signal) {
|
|
42
|
+
process.kill(process.pid, result.signal);
|
|
43
|
+
}
|
|
44
|
+
process.exit(result.status ?? 1);
|