workos 0.8.2 → 0.10.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 (70) hide show
  1. package/README.md +10 -8
  2. package/dist/bin.js +62 -27
  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/install-skill.d.ts +0 -1
  8. package/dist/commands/install-skill.js +2 -10
  9. package/dist/commands/install-skill.js.map +1 -1
  10. package/dist/commands/list-skills.d.ts +4 -0
  11. package/dist/commands/list-skills.js +52 -0
  12. package/dist/commands/list-skills.js.map +1 -0
  13. package/dist/commands/login.js +5 -4
  14. package/dist/commands/login.js.map +1 -1
  15. package/dist/commands/uninstall-skill.d.ts +11 -0
  16. package/dist/commands/uninstall-skill.js +116 -0
  17. package/dist/commands/uninstall-skill.js.map +1 -0
  18. package/dist/doctor/checks/ai-analysis.js +3 -3
  19. package/dist/doctor/checks/ai-analysis.js.map +1 -1
  20. package/dist/integrations/dotnet/index.js +7 -12
  21. package/dist/integrations/dotnet/index.js.map +1 -1
  22. package/dist/integrations/elixir/index.js +7 -13
  23. package/dist/integrations/elixir/index.js.map +1 -1
  24. package/dist/integrations/go/index.js +5 -11
  25. package/dist/integrations/go/index.js.map +1 -1
  26. package/dist/integrations/python/index.js +7 -13
  27. package/dist/integrations/python/index.js.map +1 -1
  28. package/dist/integrations/ruby/index.js +9 -14
  29. package/dist/integrations/ruby/index.js.map +1 -1
  30. package/dist/lib/adapters/cli-adapter.js +1 -1
  31. package/dist/lib/adapters/cli-adapter.js.map +1 -1
  32. package/dist/lib/agent-interface.js +10 -9
  33. package/dist/lib/agent-interface.js.map +1 -1
  34. package/dist/lib/agent-runner.js +24 -19
  35. package/dist/lib/agent-runner.js.map +1 -1
  36. package/dist/lib/credential-proxy.js +1 -1
  37. package/dist/lib/credential-proxy.js.map +1 -1
  38. package/dist/lib/ensure-auth.js +3 -3
  39. package/dist/lib/ensure-auth.js.map +1 -1
  40. package/dist/lib/run-with-core.js +1 -1
  41. package/dist/lib/run-with-core.js.map +1 -1
  42. package/dist/lib/token-refresh-client.js +1 -1
  43. package/dist/lib/token-refresh-client.js.map +1 -1
  44. package/dist/lib/token-refresh.js +1 -1
  45. package/dist/lib/token-refresh.js.map +1 -1
  46. package/dist/lib/version-check.js +2 -1
  47. package/dist/lib/version-check.js.map +1 -1
  48. package/dist/utils/exit-codes.js +1 -1
  49. package/dist/utils/exit-codes.js.map +1 -1
  50. package/dist/utils/help-json.js +62 -23
  51. package/dist/utils/help-json.js.map +1 -1
  52. package/package.json +2 -3
  53. package/.claude-plugin/plugin.json +0 -13
  54. package/skills/workos-authkit-base/SKILL.md +0 -123
  55. package/skills/workos-authkit-nextjs/SKILL.md +0 -247
  56. package/skills/workos-authkit-react/SKILL.md +0 -91
  57. package/skills/workos-authkit-react-router/SKILL.md +0 -107
  58. package/skills/workos-authkit-sveltekit/SKILL.md +0 -160
  59. package/skills/workos-authkit-tanstack-start/SKILL.md +0 -300
  60. package/skills/workos-authkit-vanilla-js/SKILL.md +0 -83
  61. package/skills/workos-dotnet/SKILL.md +0 -163
  62. package/skills/workos-elixir/SKILL.md +0 -194
  63. package/skills/workos-go/SKILL.md +0 -191
  64. package/skills/workos-kotlin/SKILL.md +0 -161
  65. package/skills/workos-management/SKILL.md +0 -250
  66. package/skills/workos-node/SKILL.md +0 -164
  67. package/skills/workos-php/SKILL.md +0 -127
  68. package/skills/workos-php-laravel/SKILL.md +0 -147
  69. package/skills/workos-python/SKILL.md +0 -159
  70. package/skills/workos-ruby/SKILL.md +0 -163
@@ -1,159 +0,0 @@
1
- ---
2
- name: workos-python
3
- description: Integrate WorkOS AuthKit with Python applications. Adapts to Django, Flask, FastAPI, or vanilla Python. Server-side authentication with redirect-based OAuth flow.
4
- ---
5
-
6
- # WorkOS AuthKit for Python
7
-
8
- ## Step 1: Fetch SDK Documentation (BLOCKING)
9
-
10
- **STOP. Do not proceed until complete.**
11
-
12
- WebFetch: `https://raw.githubusercontent.com/workos/workos-python/main/README.md`
13
-
14
- Also fetch the AuthKit quickstart for reference:
15
- WebFetch: `https://workos.com/docs/authkit/vanilla/python`
16
-
17
- The README is the source of truth for SDK API usage. If this skill conflicts with README, follow README.
18
-
19
- ## Step 2: Detect Framework
20
-
21
- Examine the project to determine which Python web framework is in use:
22
-
23
- ```
24
- manage.py exists? → Django
25
- settings.py has django imports? → Confirmed Django
26
-
27
- Gemfile/requirements has 'fastapi'? → FastAPI
28
- main.py has FastAPI() instance? → Confirmed FastAPI
29
-
30
- requirements has 'flask'? → Flask
31
- server.py/app.py has Flask() instance? → Confirmed Flask
32
-
33
- None of the above? → Vanilla Python (use Flask quickstart pattern)
34
- ```
35
-
36
- **Adapt all subsequent steps to the detected framework.** Do not force one framework onto another.
37
-
38
- ## Step 3: Pre-Flight Validation
39
-
40
- ### Package Manager Detection
41
-
42
- ```
43
- uv.lock exists? → uv add
44
- pyproject.toml has [tool.poetry]? → poetry add
45
- Pipfile exists? → pipenv install
46
- requirements.txt exists? → pip install (+ append to requirements.txt)
47
- else → pip install
48
- ```
49
-
50
- ### Environment Variables
51
-
52
- Check `.env` for:
53
-
54
- - `WORKOS_API_KEY` - starts with `sk_`
55
- - `WORKOS_CLIENT_ID` - starts with `client_`
56
-
57
- ## Step 4: Install SDK
58
-
59
- Install using the detected package manager:
60
-
61
- ```bash
62
- # uv
63
- uv add workos python-dotenv
64
-
65
- # poetry
66
- poetry add workos python-dotenv
67
-
68
- # pip
69
- pip install workos python-dotenv
70
- ```
71
-
72
- If using `requirements.txt`, also append `workos` and `python-dotenv` to it.
73
-
74
- **Verify:** `python -c "import workos; print('OK')"`
75
-
76
- ## Step 5: Integrate Authentication
77
-
78
- ### If Django
79
-
80
- 1. **Configure settings.py** — add `import os` + `from dotenv import load_dotenv` + `load_dotenv()` at top. Add `WORKOS_API_KEY` and `WORKOS_CLIENT_ID` from `os.environ.get()`.
81
- 2. **Create auth views** — create `auth_views.py` (or add to existing views):
82
- - `login_view`: call SDK's `get_authorization_url()` with `provider='authkit'`, redirect
83
- - `callback_view`: call `authenticate_with_code()` with the code param, store user in `request.session`
84
- - `logout_view`: flush session, redirect
85
- 3. **Add URL patterns** — add `auth/login/`, `auth/callback/`, `auth/logout/` to `urls.py`
86
- 4. **Update templates** — add login/logout links using `{% url %}` tags
87
-
88
- ### If Flask
89
-
90
- Follow the quickstart pattern exactly:
91
-
92
- 1. **Initialize WorkOS client** in `server.py` / `app.py`:
93
- ```python
94
- from workos import WorkOSClient
95
- workos = WorkOSClient(api_key=os.getenv("WORKOS_API_KEY"), client_id=os.getenv("WORKOS_CLIENT_ID"))
96
- ```
97
- 2. **Create `/login` route** — call `workos.user_management.get_authorization_url(provider="authkit", redirect_uri="...")`, redirect
98
- 3. **Create `/callback` route** — call `workos.user_management.authenticate_with_code(code=code)`, set session cookie
99
- 4. **Create `/logout` route** — clear session, redirect
100
- 5. **Update home route** — show user info if session exists
101
-
102
- ### If FastAPI
103
-
104
- 1. **Initialize WorkOS client** in main app file
105
- 2. **Create `/login` endpoint** — generate auth URL, return `RedirectResponse`
106
- 3. **Create `/callback` endpoint** — exchange code, store in session/cookie
107
- 4. **Create `/logout` endpoint** — clear session
108
- 5. Use `Depends()` for auth middleware on protected routes
109
-
110
- ### If Vanilla Python (no framework detected)
111
-
112
- Install Flask and follow the Flask pattern above. This matches the official quickstart.
113
-
114
- ## Step 6: Environment Setup
115
-
116
- Create/update `.env` with WorkOS credentials. Do NOT overwrite existing values.
117
-
118
- ```
119
- WORKOS_API_KEY=sk_...
120
- WORKOS_CLIENT_ID=client_...
121
- ```
122
-
123
- ## Step 7: Verification Checklist
124
-
125
- ```bash
126
- # 1. SDK importable
127
- python -c "import workos; print('OK')"
128
-
129
- # 2. Credentials configured
130
- python -c "
131
- from dotenv import load_dotenv; import os; load_dotenv()
132
- assert os.environ.get('WORKOS_API_KEY','').startswith('sk_'), 'Missing WORKOS_API_KEY'
133
- assert os.environ.get('WORKOS_CLIENT_ID','').startswith('client_'), 'Missing WORKOS_CLIENT_ID'
134
- print('Credentials OK')
135
- "
136
-
137
- # 3. Framework-specific check
138
- # Django: python manage.py check
139
- # Flask: python -m py_compile server.py
140
- # FastAPI: python -m py_compile main.py
141
- ```
142
-
143
- ## Error Recovery
144
-
145
- ### "ModuleNotFoundError: No module named 'workos'"
146
-
147
- Re-run the install command for the detected package manager.
148
-
149
- ### Django: "CSRF verification failed"
150
-
151
- Auth callback receives GET requests from WorkOS. Ensure callback view uses GET, not POST. Or add `@csrf_exempt`.
152
-
153
- ### Flask: Session not persisting
154
-
155
- Ensure `app.secret_key` is set (required for Flask sessions).
156
-
157
- ### Virtual environment not active
158
-
159
- Check for `.venv/`, `venv/`, or poetry-managed environments. Activate before running install.
@@ -1,163 +0,0 @@
1
- ---
2
- name: workos-ruby
3
- description: Integrate WorkOS AuthKit with Ruby applications. Adapts to Rails, Sinatra, or vanilla Ruby. Server-side authentication with redirect-based OAuth flow.
4
- ---
5
-
6
- # WorkOS AuthKit for Ruby
7
-
8
- ## Step 1: Fetch SDK Documentation (BLOCKING)
9
-
10
- **STOP — Do not proceed until this fetch is complete.**
11
-
12
- WebFetch: `https://raw.githubusercontent.com/workos/workos-ruby/main/README.md`
13
-
14
- Also fetch the AuthKit quickstart for reference:
15
- WebFetch: `https://workos.com/docs/authkit/vanilla/ruby`
16
-
17
- The README is the **source of truth** for gem API usage. If this skill conflicts with the README, **follow the README**.
18
-
19
- ## Step 2: Detect Framework
20
-
21
- Examine the project to determine which Ruby web framework is in use:
22
-
23
- ```
24
- config/routes.rb exists? → Rails
25
- Gemfile has 'rails' gem? → Confirmed Rails
26
-
27
- Gemfile has 'sinatra' gem? → Sinatra
28
- server.rb/app.rb has Sinatra routes? → Confirmed Sinatra
29
-
30
- None of the above? → Vanilla Ruby (use Sinatra quickstart pattern)
31
- ```
32
-
33
- **Adapt all subsequent steps to the detected framework.** Do not force Rails on a Sinatra project or vice versa.
34
-
35
- ## Step 3: Install WorkOS Gem
36
-
37
- ```bash
38
- bundle add workos
39
- ```
40
-
41
- If `dotenv` is not in the Gemfile:
42
-
43
- ```bash
44
- # Rails
45
- bundle add dotenv-rails --group development,test
46
-
47
- # Sinatra / other
48
- bundle add dotenv
49
- ```
50
-
51
- **Verify:** `bundle show workos`
52
-
53
- ## Step 4: Integrate Authentication
54
-
55
- ### If Rails
56
-
57
- 1. **Create initializer** — `config/initializers/workos.rb`:
58
-
59
- ```ruby
60
- WorkOS.configure do |config|
61
- config.api_key = ENV.fetch("WORKOS_API_KEY")
62
- config.client_id = ENV.fetch("WORKOS_CLIENT_ID")
63
- end
64
- ```
65
-
66
- 2. **Create AuthController** — `app/controllers/auth_controller.rb`:
67
- - `login` action: call `WorkOS::UserManagement.get_authorization_url(provider: "authkit", redirect_uri: ...)`, redirect
68
- - `callback` action: call `WorkOS::UserManagement.authenticate_with_code(code: params[:code])`, store user in session
69
- - `logout` action: clear session, redirect
70
-
71
- 3. **Add routes** to `config/routes.rb`:
72
-
73
- ```ruby
74
- get "/auth/login", to: "auth#login"
75
- get "/auth/callback", to: "auth#callback"
76
- get "/auth/logout", to: "auth#logout"
77
- ```
78
-
79
- 4. **Add current_user helper** to `ApplicationController` (optional):
80
-
81
- ```ruby
82
- helper_method :current_user
83
- def current_user
84
- @current_user ||= session[:user] && JSON.parse(session[:user])
85
- end
86
- ```
87
-
88
- 5. **Verify:** `bundle exec rails routes | grep auth`
89
-
90
- ### If Sinatra
91
-
92
- Follow the quickstart pattern exactly:
93
-
94
- 1. **Configure WorkOS** in `server.rb`:
95
-
96
- ```ruby
97
- require "dotenv/load"
98
- require "workos"
99
- require "sinatra"
100
-
101
- WorkOS.configure do |config|
102
- config.key = ENV["WORKOS_API_KEY"]
103
- end
104
- ```
105
-
106
- 2. **Create `/login` route** — call `WorkOS::UserManagement.authorization_url(provider: "authkit", client_id: ..., redirect_uri: ...)`, redirect
107
-
108
- 3. **Create `/callback` route** — call `WorkOS::UserManagement.authenticate_with_code(client_id: ..., code: ...)`, store in session cookie
109
-
110
- 4. **Create `/logout` route** — clear session cookie, redirect
111
-
112
- 5. **Update home route** — read session, show user info if present
113
-
114
- 6. **Verify:** `ruby -c server.rb`
115
-
116
- ### If Vanilla Ruby (no framework detected)
117
-
118
- Install Sinatra and follow the Sinatra pattern above. This matches the official quickstart.
119
-
120
- ## Step 5: Environment Setup
121
-
122
- Create/update `.env` with WorkOS credentials. Do NOT overwrite existing values.
123
-
124
- ```
125
- WORKOS_API_KEY=sk_...
126
- WORKOS_CLIENT_ID=client_...
127
- ```
128
-
129
- ## Step 6: Verification
130
-
131
- ### Rails
132
-
133
- ```bash
134
- bundle show workos
135
- bundle exec rails routes | grep auth
136
- grep WORKOS .env
137
- ```
138
-
139
- ### Sinatra
140
-
141
- ```bash
142
- bundle show workos
143
- ruby -c server.rb
144
- grep WORKOS .env
145
- ```
146
-
147
- ## Error Recovery
148
-
149
- ### "uninitialized constant WorkOS"
150
-
151
- Gem not loaded. Verify `bundle show workos` succeeds. For Rails, ensure initializer exists. For Sinatra, ensure `require "workos"` is at top of server file.
152
-
153
- ### "NoMethodError" on WorkOS methods
154
-
155
- SDK API may differ from this skill. Re-read the README (Step 1) and use exact method names.
156
-
157
- ### Routes not working (Rails)
158
-
159
- Run `bundle exec rails routes | grep auth`. Verify routes are inside `Rails.application.routes.draw` block.
160
-
161
- ### Session not persisting (Sinatra)
162
-
163
- Enable sessions: `enable :sessions` in server.rb, or use `rack-session` gem.