workos 0.8.2 → 0.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (46) hide show
  1. package/README.md +5 -2
  2. package/dist/bin.js +23 -13
  3. package/dist/bin.js.map +1 -1
  4. package/dist/commands/auth-status.d.ts +1 -0
  5. package/dist/commands/auth-status.js +56 -0
  6. package/dist/commands/auth-status.js.map +1 -0
  7. package/dist/commands/login.js +5 -4
  8. package/dist/commands/login.js.map +1 -1
  9. package/dist/doctor/checks/ai-analysis.js +3 -3
  10. package/dist/doctor/checks/ai-analysis.js.map +1 -1
  11. package/dist/lib/adapters/cli-adapter.js +1 -1
  12. package/dist/lib/adapters/cli-adapter.js.map +1 -1
  13. package/dist/lib/agent-interface.js +5 -5
  14. package/dist/lib/agent-interface.js.map +1 -1
  15. package/dist/lib/credential-proxy.js +1 -1
  16. package/dist/lib/credential-proxy.js.map +1 -1
  17. package/dist/lib/ensure-auth.js +3 -3
  18. package/dist/lib/ensure-auth.js.map +1 -1
  19. package/dist/lib/run-with-core.js +1 -1
  20. package/dist/lib/run-with-core.js.map +1 -1
  21. package/dist/lib/token-refresh-client.js +1 -1
  22. package/dist/lib/token-refresh-client.js.map +1 -1
  23. package/dist/lib/token-refresh.js +1 -1
  24. package/dist/lib/token-refresh.js.map +1 -1
  25. package/dist/lib/version-check.js +2 -1
  26. package/dist/lib/version-check.js.map +1 -1
  27. package/dist/utils/exit-codes.js +1 -1
  28. package/dist/utils/exit-codes.js.map +1 -1
  29. package/dist/utils/help-json.js +7 -2
  30. package/dist/utils/help-json.js.map +1 -1
  31. package/package.json +1 -1
  32. package/skills/workos-authkit-nextjs/SKILL.md +1 -1
  33. package/skills/workos-authkit-react/SKILL.md +19 -10
  34. package/skills/workos-authkit-react-router/SKILL.md +18 -8
  35. package/skills/workos-authkit-sveltekit/SKILL.md +55 -7
  36. package/skills/workos-authkit-tanstack-start/SKILL.md +22 -8
  37. package/skills/workos-authkit-vanilla-js/SKILL.md +19 -10
  38. package/skills/workos-elixir/SKILL.md +37 -0
  39. package/skills/workos-go/SKILL.md +36 -1
  40. package/skills/workos-kotlin/SKILL.md +34 -0
  41. package/skills/workos-management/SKILL.md +1 -1
  42. package/skills/workos-node/SKILL.md +33 -0
  43. package/skills/workos-php/SKILL.md +34 -1
  44. package/skills/workos-php-laravel/SKILL.md +36 -1
  45. package/skills/workos-python/SKILL.md +34 -0
  46. package/skills/workos-ruby/SKILL.md +35 -0
package/README.md CHANGED
@@ -470,10 +470,13 @@ The CLI uses WorkOS Connect OAuth device flow for authentication:
470
470
 
471
471
  ```bash
472
472
  # Login (opens browser for authentication)
473
- workos login
473
+ workos auth login
474
+
475
+ # Check current auth status
476
+ workos auth status
474
477
 
475
478
  # Logout (clears stored credentials)
476
- workos logout
479
+ workos auth logout
477
480
  ```
478
481
 
479
482
  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.
package/dist/bin.js CHANGED
@@ -20,7 +20,7 @@ if (!satisfies(process.version, NODE_VERSION_RANGE)) {
20
20
  process.exit(1);
21
21
  }
22
22
  import { isNonInteractiveEnvironment } from './utils/environment.js';
23
- import { resolveOutputMode, setOutputMode, outputJson, exitWithError } from './utils/output.js';
23
+ import { resolveOutputMode, setOutputMode, isJsonMode, outputJson, exitWithError } from './utils/output.js';
24
24
  import clack from './utils/clack.js';
25
25
  import { registerSubcommand } from './utils/register-subcommand.js';
26
26
  // Resolve output mode early from raw argv (before yargs parses)
@@ -163,8 +163,9 @@ const installerOptions = {
163
163
  type: 'boolean',
164
164
  },
165
165
  };
166
- // Check for updates (blocks up to 500ms)
167
- await checkForUpdates();
166
+ // Check for updates (blocks up to 500ms, skip in JSON mode to keep stdout clean)
167
+ if (!isJsonMode())
168
+ await checkForUpdates();
168
169
  yargs(rawArgs)
169
170
  .env('WORKOS_INSTALLER')
170
171
  .option('json', {
@@ -173,16 +174,25 @@ yargs(rawArgs)
173
174
  describe: 'Output results as JSON (auto-enabled in non-TTY)',
174
175
  global: true,
175
176
  })
176
- .command('login', 'Authenticate with WorkOS via browser-based OAuth', insecureStorageOption, async (argv) => {
177
- await applyInsecureStorage(argv.insecureStorage);
178
- const { runLogin } = await import('./commands/login.js');
179
- await runLogin();
180
- process.exit(0);
181
- })
182
- .command('logout', 'Remove stored WorkOS credentials and tokens', insecureStorageOption, async (argv) => {
183
- await applyInsecureStorage(argv.insecureStorage);
184
- const { runLogout } = await import('./commands/logout.js');
185
- await runLogout();
177
+ .command('auth', 'Manage authentication (login, logout, status)', (yargs) => {
178
+ yargs.options(insecureStorageOption);
179
+ registerSubcommand(yargs, 'login', 'Authenticate with WorkOS via browser-based OAuth', (y) => y, async (argv) => {
180
+ await applyInsecureStorage(argv.insecureStorage);
181
+ const { runLogin } = await import('./commands/login.js');
182
+ await runLogin();
183
+ process.exit(0);
184
+ });
185
+ registerSubcommand(yargs, 'logout', 'Remove stored WorkOS credentials and tokens', (y) => y, async (argv) => {
186
+ await applyInsecureStorage(argv.insecureStorage);
187
+ const { runLogout } = await import('./commands/logout.js');
188
+ await runLogout();
189
+ });
190
+ registerSubcommand(yargs, 'status', 'Show current authentication status', (y) => y, async (argv) => {
191
+ await applyInsecureStorage(argv.insecureStorage);
192
+ const { runAuthStatus } = await import('./commands/auth-status.js');
193
+ await runAuthStatus();
194
+ });
195
+ return yargs.demandCommand(1, 'Please specify an auth subcommand').strict();
186
196
  })
187
197
  .command('install-skill', 'Install bundled AuthKit skills to coding agents (Claude Code, Codex, Cursor, Goose)', (yargs) => {
188
198
  return yargs