@profoundlogic/coderflow-server 0.2.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.
Files changed (202) hide show
  1. package/LICENSE.txt +322 -0
  2. package/README.md +158 -0
  3. package/dist/LICENSE.txt +322 -0
  4. package/dist/README.md +158 -0
  5. package/dist/base-image/Dockerfile +184 -0
  6. package/dist/base-image/agent-wrapper.sh +143 -0
  7. package/dist/base-image/apply-local-state.sh +357 -0
  8. package/dist/base-image/coder-git-credential-helper +307 -0
  9. package/dist/base-image/entrypoint.sh +942 -0
  10. package/dist/base-image/ssh_config_template +41 -0
  11. package/dist/base-image/start-code-server.sh +76 -0
  12. package/dist/base-image/sync-repos.sh +170 -0
  13. package/dist/base-image/vscode-extensions.txt +10 -0
  14. package/dist/base-image/vscode-settings.json +41 -0
  15. package/dist/coder-server.js +2 -0
  16. package/dist/config/cli-models.json +45 -0
  17. package/dist/config/imported-skills.schema.json +83 -0
  18. package/dist/config/skill-catalog.json +18 -0
  19. package/dist/config/skill-catalog.schema.json +140 -0
  20. package/dist/config.js +1 -0
  21. package/dist/examples/oidc.json.example +11 -0
  22. package/dist/lib/agent-keepalive.js +1 -0
  23. package/dist/lib/api-keys.js +1 -0
  24. package/dist/lib/apiKeys.js +1 -0
  25. package/dist/lib/auto-judge.js +1 -0
  26. package/dist/lib/basic-auth.js +1 -0
  27. package/dist/lib/build-history.js +1 -0
  28. package/dist/lib/build-output-service.js +1 -0
  29. package/dist/lib/build-scheduler.js +1 -0
  30. package/dist/lib/build-service.js +1 -0
  31. package/dist/lib/claude-oauth-refresh.js +1 -0
  32. package/dist/lib/cli/build.js +1 -0
  33. package/dist/lib/cli/config-command.js +1 -0
  34. package/dist/lib/cli/config.js +1 -0
  35. package/dist/lib/cli/create-user.js +1 -0
  36. package/dist/lib/cli/init.js +1 -0
  37. package/dist/lib/cli/jira.js +1 -0
  38. package/dist/lib/cli/license.js +1 -0
  39. package/dist/lib/cli/server-manager.js +1 -0
  40. package/dist/lib/container-tokens.js +1 -0
  41. package/dist/lib/data-dir.js +1 -0
  42. package/dist/lib/deployment-history.js +1 -0
  43. package/dist/lib/deployment-service.js +1 -0
  44. package/dist/lib/docker-utils.js +1 -0
  45. package/dist/lib/email.js +1 -0
  46. package/dist/lib/emailTemplates.js +1 -0
  47. package/dist/lib/entitlement.js +1 -0
  48. package/dist/lib/fetch-utils.js +1 -0
  49. package/dist/lib/git-provider-service.js +1 -0
  50. package/dist/lib/git-provider-setup/assets/coderflow_github_app.png +0 -0
  51. package/dist/lib/git-provider-setup/github-setup-handler.js +1 -0
  52. package/dist/lib/git-provider-setup/index.js +1 -0
  53. package/dist/lib/git-provider-setup/setup-factory.js +1 -0
  54. package/dist/lib/git-provider-setup/setup-interface.js +1 -0
  55. package/dist/lib/git-providers/azure-devops-provider.js +1 -0
  56. package/dist/lib/git-providers/github-app-provider.js +1 -0
  57. package/dist/lib/git-providers/index.js +1 -0
  58. package/dist/lib/git-providers/provider-factory.js +1 -0
  59. package/dist/lib/git-providers/provider-interface.js +1 -0
  60. package/dist/lib/jira-client.js +1 -0
  61. package/dist/lib/logger.js +1 -0
  62. package/dist/lib/model-fetcher.js +1 -0
  63. package/dist/lib/notifications.js +1 -0
  64. package/dist/lib/oidc-auth.js +1 -0
  65. package/dist/lib/oidc-device-flow.js +1 -0
  66. package/dist/lib/passwordTokens.js +1 -0
  67. package/dist/lib/pin-cascade.js +1 -0
  68. package/dist/lib/provider-accounts.js +1 -0
  69. package/dist/lib/provider-oauth.js +1 -0
  70. package/dist/lib/provider-profile.js +1 -0
  71. package/dist/lib/provider-token-refresh.js +1 -0
  72. package/dist/lib/roles.js +1 -0
  73. package/dist/lib/secrets.js +1 -0
  74. package/dist/lib/state-capture.js +1 -0
  75. package/dist/lib/static-files.js +1 -0
  76. package/dist/lib/task-name-generator.js +1 -0
  77. package/dist/lib/users.js +1 -0
  78. package/dist/middleware/requireAuth.js +1 -0
  79. package/dist/middleware/requireInit.js +1 -0
  80. package/dist/middleware/requirePermission.js +1 -0
  81. package/dist/package-lock.json +4151 -0
  82. package/dist/package.json +50 -0
  83. package/dist/routes/apiKeys.js +1 -0
  84. package/dist/routes/auth-oidc.js +1 -0
  85. package/dist/routes/auth.js +1 -0
  86. package/dist/routes/build.js +1 -0
  87. package/dist/routes/containers.js +1 -0
  88. package/dist/routes/deploy-task.js +1 -0
  89. package/dist/routes/environment-management.js +1 -0
  90. package/dist/routes/environments.js +1 -0
  91. package/dist/routes/external-skills.js +1 -0
  92. package/dist/routes/git-credentials.js +1 -0
  93. package/dist/routes/git-provider-setup.js +1 -0
  94. package/dist/routes/health.js +1 -0
  95. package/dist/routes/jira.js +1 -0
  96. package/dist/routes/objective-management.js +1 -0
  97. package/dist/routes/password.js +1 -0
  98. package/dist/routes/prompt.js +1 -0
  99. package/dist/routes/provider-auth.js +1 -0
  100. package/dist/routes/qa.js +1 -0
  101. package/dist/routes/settings.js +1 -0
  102. package/dist/routes/skill-management.js +1 -0
  103. package/dist/routes/skills.js +1 -0
  104. package/dist/routes/tasks.js +2 -0
  105. package/dist/routes/templates.js +1 -0
  106. package/dist/routes/test-task.js +1 -0
  107. package/dist/routes/test.js +1 -0
  108. package/dist/routes/users.js +1 -0
  109. package/dist/routes/visualizations.js +1 -0
  110. package/dist/schemas/template-metadata.schema.json +178 -0
  111. package/dist/scripts/create-user.js +2 -0
  112. package/dist/shipped-skills/environment-instructions/SKILL.md +154 -0
  113. package/dist/shipped-skills/environment-templates/SKILL.md +282 -0
  114. package/dist/shipped-skills/objective-management/SKILL.md +238 -0
  115. package/dist/shipped-skills/skill-editor/SKILL.md +326 -0
  116. package/dist/start.js +2 -0
  117. package/dist/web-ui/public/activity-detail-modal.js +1 -0
  118. package/dist/web-ui/public/activity-feed.js +1 -0
  119. package/dist/web-ui/public/activity-formatters.js +1 -0
  120. package/dist/web-ui/public/agent-event-parser.js +1 -0
  121. package/dist/web-ui/public/app.js +1 -0
  122. package/dist/web-ui/public/approve-dialog.js +1 -0
  123. package/dist/web-ui/public/coderflow-logo-reversed.svg +46 -0
  124. package/dist/web-ui/public/coderflow-logo.svg +46 -0
  125. package/dist/web-ui/public/comments-widget.js +1 -0
  126. package/dist/web-ui/public/docs/.nojekyll +0 -0
  127. package/dist/web-ui/public/docs/README.md +26 -0
  128. package/dist/web-ui/public/docs/_sidebar.md +47 -0
  129. package/dist/web-ui/public/docs/admin/ai-providers.md +132 -0
  130. package/dist/web-ui/public/docs/admin/email-notifications.md +69 -0
  131. package/dist/web-ui/public/docs/admin/environments.md +215 -0
  132. package/dist/web-ui/public/docs/admin/git-providers.md +147 -0
  133. package/dist/web-ui/public/docs/admin/installation.md +313 -0
  134. package/dist/web-ui/public/docs/admin/skills.md +35 -0
  135. package/dist/web-ui/public/docs/admin/sso.md +241 -0
  136. package/dist/web-ui/public/docs/admin/users-and-roles.md +57 -0
  137. package/dist/web-ui/public/docs/code/cli.md +102 -0
  138. package/dist/web-ui/public/docs/code/files-and-editing.md +86 -0
  139. package/dist/web-ui/public/docs/code/terminal-access.md +110 -0
  140. package/dist/web-ui/public/docs/code/vscode-extension.md +58 -0
  141. package/dist/web-ui/public/docs/getting-started/core-concepts.md +129 -0
  142. package/dist/web-ui/public/docs/getting-started/overview.md +46 -0
  143. package/dist/web-ui/public/docs/index.html +151 -0
  144. package/dist/web-ui/public/docs/integrations/custom.md +58 -0
  145. package/dist/web-ui/public/docs/integrations/ibmi/overview.md +58 -0
  146. package/dist/web-ui/public/docs/integrations/overview.md +48 -0
  147. package/dist/web-ui/public/docs/objectives/qa-mode.md +90 -0
  148. package/dist/web-ui/public/docs/objectives/staged-tasks.md +60 -0
  149. package/dist/web-ui/public/docs/objectives/working-with-objectives.md +102 -0
  150. package/dist/web-ui/public/docs/tasks/approval-and-deployment.md +83 -0
  151. package/dist/web-ui/public/docs/tasks/creating-tasks.md +111 -0
  152. package/dist/web-ui/public/docs/tasks/judging.md +114 -0
  153. package/dist/web-ui/public/docs/tasks/providing-feedback.md +41 -0
  154. package/dist/web-ui/public/docs/tasks/task-groups.md +73 -0
  155. package/dist/web-ui/public/docs/tasks/winner-selection.md +75 -0
  156. package/dist/web-ui/public/docs/templates/batch-processing.md +152 -0
  157. package/dist/web-ui/public/docs/templates/task-templates.md +44 -0
  158. package/dist/web-ui/public/docs/templates/template-examples.md +93 -0
  159. package/dist/web-ui/public/docs/testing/profound-automated-testing.md +77 -0
  160. package/dist/web-ui/public/docs/testing/task-visualizations.md +42 -0
  161. package/dist/web-ui/public/docs/testing/testing-menu.md +118 -0
  162. package/dist/web-ui/public/environments.css +3942 -0
  163. package/dist/web-ui/public/environments.html +1791 -0
  164. package/dist/web-ui/public/environments.js +1 -0
  165. package/dist/web-ui/public/favicon-16.png +0 -0
  166. package/dist/web-ui/public/favicon-32.png +0 -0
  167. package/dist/web-ui/public/favicon.ico +0 -0
  168. package/dist/web-ui/public/feedback-widget.css +3133 -0
  169. package/dist/web-ui/public/feedback-widget.js +1 -0
  170. package/dist/web-ui/public/git-history.css +2663 -0
  171. package/dist/web-ui/public/git-history.html +272 -0
  172. package/dist/web-ui/public/git-history.js +1 -0
  173. package/dist/web-ui/public/git-status.js +1 -0
  174. package/dist/web-ui/public/index.html +1459 -0
  175. package/dist/web-ui/public/index.js +1 -0
  176. package/dist/web-ui/public/login.html +346 -0
  177. package/dist/web-ui/public/login.js +1 -0
  178. package/dist/web-ui/public/markdown-editor.js +1 -0
  179. package/dist/web-ui/public/markdown-file-editor.js +1 -0
  180. package/dist/web-ui/public/modal-maximize.js +1 -0
  181. package/dist/web-ui/public/notifications.js +1 -0
  182. package/dist/web-ui/public/server-health.js +1 -0
  183. package/dist/web-ui/public/settings.css +761 -0
  184. package/dist/web-ui/public/settings.html +1044 -0
  185. package/dist/web-ui/public/settings.js +1 -0
  186. package/dist/web-ui/public/setup-password.html +355 -0
  187. package/dist/web-ui/public/setup-password.js +1 -0
  188. package/dist/web-ui/public/skills.css +1949 -0
  189. package/dist/web-ui/public/skills.html +820 -0
  190. package/dist/web-ui/public/skills.js +1 -0
  191. package/dist/web-ui/public/sse-client.js +1 -0
  192. package/dist/web-ui/public/sse-shared-worker.js +1 -0
  193. package/dist/web-ui/public/styles.css +18614 -0
  194. package/dist/web-ui/public/task.html +1779 -0
  195. package/dist/web-ui/public/task.js +1 -0
  196. package/dist/web-ui/public/terminal.html +45 -0
  197. package/dist/web-ui/public/terminal.js +1 -0
  198. package/dist/web-ui/public/theme.js +1 -0
  199. package/dist/web-ui/public/users.html +298 -0
  200. package/dist/web-ui/public/users.js +1 -0
  201. package/dist/web-ui/public/variant-grouping.js +1 -0
  202. package/package.json +63 -0
@@ -0,0 +1,313 @@
1
+ # Installation
2
+
3
+ This guide walks you through setting up a CoderFlow server.
4
+
5
+ ## Prerequisites
6
+
7
+ A Linux server with the following installed:
8
+
9
+ - **Docker** — [Install Docker Engine](https://docs.docker.com/engine/install/)
10
+ - **Git** — Available via your distribution's package manager
11
+
12
+ Optionally, if you'd like the server to listen on a port below 1024 (such as 443 or 80):
13
+
14
+ - **On Ubuntu and Debian-based distros** - Install [authbind](https://manpages.ubuntu.com/manpages/noble/man1/authbind.1.html) via APT package manager.
15
+ - **Other distros** - See your distro's documentation for enabling non-root users to bind network services to privileged ports
16
+
17
+ ## Root Permissions
18
+
19
+ > [!IMPORTANT]
20
+ > Only a few parts of the installation process require root permissions.
21
+ > Do not use root permissions (i.e. `sudo` or `su`) except where specifically instructed.
22
+ > The server installs and runs as a non-root user.
23
+
24
+ ## Create a Dedicated Linux User For Each Installation
25
+
26
+ Each installation of CoderFlow server should run under a unique and dedicated user account, rather than your personal account or root. This provides better security isolation and makes it easier to manage the service.
27
+
28
+ Create a dedicated user (we suggest `coder`, but any name works):
29
+
30
+ ```bash
31
+ # Create the user with a home directory
32
+ sudo useradd -m -s /bin/bash coder
33
+
34
+ # Set a password (optional, if you need interactive login)
35
+ sudo passwd coder
36
+
37
+ # Add the user to the docker group so it can manage containers
38
+ sudo usermod -aG docker coder
39
+ ```
40
+
41
+ If `coder` conflicts with an existing user on your system, choose a different name — the server works the same regardless of the username.
42
+
43
+ ## Optional: If Using Server Listen Port Below 1024
44
+
45
+ If you'd like to use a server listen port below 1024 (e.g. 443), configure `authbind` to allow the dedicated CoderFlow user to use the port:
46
+
47
+ For example, for port 443:
48
+
49
+ ```bash
50
+ sudo touch /etc/authbind/byport/443
51
+ sudo chown coder /etc/authbind/byport/443
52
+ sudo chmod 500 /etc/authbind/byport/443
53
+ ```
54
+
55
+ ## Switch to Dedicated CoderFlow User
56
+
57
+ Switch to the dedicated user before proceeding with installation:
58
+
59
+ ```bash
60
+ sudo su - coder
61
+ ```
62
+
63
+ ## Install Node.js via NVS
64
+
65
+ Use the [installation guide](https://github.com/jasongin/nvs?tab=readme-ov-file#mac-linux) to install Node Version Switcher (NVS) in the dedicated user's home directory. This allows each CoderFlow installation/user to use a separate version of Node.js. If you prefer, you can use `nvm` instead, but NVS will be used in this documentation.
66
+
67
+ After installing NVS, exit and restart your shell and then install Node 24:
68
+
69
+ ```bash
70
+ nvs add node/24
71
+ nvs use node/24
72
+ nvs link node/24
73
+ ```
74
+
75
+ ## Setup
76
+
77
+ ### Install the Server
78
+
79
+ ```bash
80
+ npm install -g @profoundlogic/coderflow-server
81
+ ```
82
+
83
+ ### Create a Setup Repository
84
+
85
+ The setup repository contains your environments, task templates, and configuration.
86
+
87
+ If your organization already has a setup repository, clone it:
88
+
89
+ ```bash
90
+ git clone https://github.com/your-org/mycompany-coder-setup.git
91
+ ```
92
+
93
+ Otherwise, create a new one:
94
+
95
+ ```bash
96
+ coder-server init mycompany-coder-setup
97
+ ```
98
+
99
+ This creates a `mycompany-coder-setup` directory with the required structure and initializes it as a git repository.
100
+
101
+ ### Install License
102
+
103
+ ```bash
104
+ coder-server license set <your-license-key> --setup-path=mycompany-coder-setup
105
+ ```
106
+
107
+ ### Create Admin User
108
+
109
+ ```bash
110
+ coder-server create-user --username=admin --email=admin@example.com --name="Admin User" --role=admin
111
+ ```
112
+
113
+ You'll be prompted to set a password.
114
+
115
+ ### Optional: Configure Server Listen Port and SSL
116
+
117
+ By default the server listens on port 3000. To configure an alternate port (e.g. 443):
118
+
119
+ ```bash
120
+ coder-server config set server_port 443
121
+ ```
122
+
123
+ To configure a certificate for SSL:
124
+
125
+ > [!INFO]
126
+ > Certificate and key files must be in PEM format.
127
+ > Concatenate certificate, intermediate, and root into a single file, in that order.
128
+ > File paths can be given as absolute or relative.
129
+ > Files must be readable by the dedicated CoderFlow user.
130
+
131
+ ```bash
132
+ coder-server config set ssl_cert_path mycert.pem
133
+ coder-server config set ssl_key_path mykey.pem
134
+ ```
135
+
136
+ ### Start the Server
137
+
138
+ ```bash
139
+ coder-server start
140
+ ```
141
+
142
+ If using a listen port below 1024 (e.g. 443, 80) and using `authbind` to allow that, the server must be started like this instead:
143
+
144
+ ```bash
145
+ authbind --deep coder-server start
146
+ ```
147
+
148
+ Once running, log in to the Web UI (default port 3000) with the admin user you created.
149
+
150
+ ## Set Up Git Providers
151
+
152
+ To allow CoderFlow access to your Git hosting service (e.g., GitHub), follow the instructions in [Git Providers](admin/git-providers.md).
153
+
154
+ ## Configure Your Environment
155
+
156
+ The `coder-server init` command created a default environment with placeholder values. Configure it through the Web UI:
157
+
158
+ 1. Navigate to **Environments** in the Web UI
159
+ 2. Click on the **default** environment, if it isn't already selected
160
+ 3. Update each section:
161
+
162
+ ### Repos
163
+
164
+ Click **Add Repository** to add your GitHub repository:
165
+ - **Git Provider**: Choose a Git provider from the list
166
+ - **URL**: URL (e.g., `https://github.com/acme/my-project.git`)
167
+ - **Branch**: Default branch (e.g., `main`)
168
+
169
+ ## Build Docker Images
170
+
171
+ Docker images must be built before you can run tasks. There are two ways to build images: through the Web UI or using the CLI.
172
+
173
+ ### Build Base Image
174
+
175
+ Build the base image that all environments inherit from.
176
+
177
+ **Web UI:**
178
+ 1. Navigate to **Settings → Environments**
179
+ 2. Select your environment, if it's not already selected
180
+ 3. Click **Actions → Build Base Image**
181
+ 4. Optionally check "Build without cache" for a clean rebuild
182
+ 5. Click **Build**
183
+
184
+ **CLI:**
185
+ ```bash
186
+ coder-server build base
187
+ ```
188
+
189
+ ### Build Environment Image
190
+
191
+ Build your environment's Docker image.
192
+
193
+ **Web UI:**
194
+ 1. Navigate to **Settings → Environments**
195
+ 2. Select your environment, if it's not already selected
196
+ 3. Go to the **Build** tab
197
+ 4. Click **Build Now**
198
+
199
+ **CLI:**
200
+ ```bash
201
+ coder-server build default
202
+ ```
203
+
204
+ Rebuild after making changes to the Dockerfile or setup.sh.
205
+
206
+ ## Set Up LLM Access
207
+
208
+ Before running tasks, configure access to AI providers. Authentication can be performed by both OAuth and API keys.
209
+
210
+ To authenticate task execution using your subscription accounts (OAuth), follow the instructions in [AI Provider Authentication](admin/ai-providers.md).
211
+
212
+ Authentication using AI keys can be used for task execution as well as auto-generating task names. To authenticate using AI keys, do the following:
213
+
214
+ 1. Navigate to **Settings → Server Settings → API Keys** in the Web UI
215
+ 2. For each provider, enter the corresponding API key (the default agent's API key will be used when auto-generating task names)
216
+ 3. To execute tasks for a provider using API keys, switch its toggle on
217
+
218
+ Supported providers:
219
+ - **Claude** (Anthropic)
220
+ - **Codex** (OpenAI)
221
+ - **Gemini** (Google)
222
+
223
+ ## Verify Installation
224
+
225
+ The best way to verify everything works is to submit a task:
226
+
227
+ 1. Open the Web UI in your browser
228
+ 2. Select your environment and enter a simple task (e.g., "List the files in the repository")
229
+ 3. Submit and watch the task run
230
+
231
+ If the task completes successfully, your installation is working.
232
+
233
+ ## Server Management
234
+
235
+ ### Running as a Daemon
236
+
237
+ Use the `--daemon` flag to run the server in the background:
238
+
239
+ ```bash
240
+ coder-server start --daemon
241
+ ```
242
+
243
+ Manage the daemon with:
244
+
245
+ ```bash
246
+ # View logs
247
+ coder-server logs
248
+
249
+ # Stop server
250
+ coder-server stop
251
+
252
+ # Restart
253
+ coder-server restart
254
+
255
+ # Check health
256
+ curl http://your-server:3000/health
257
+ ```
258
+
259
+ ### Using PM2
260
+
261
+ As an alternative to the built-in daemon mode, you can use [PM2](https://pm2.keymetrics.io/) for process management.
262
+
263
+ PM2 provides additional features like automatic restarts on crash and system boot persistence.
264
+
265
+ #### Install PM2 Globally
266
+
267
+ ```bash
268
+ npm install -g pm2
269
+ ```
270
+
271
+ #### Start CoderFlow with PM2
272
+
273
+ If using a listen port below 1024 (e.g. 443, 80) and using `authbind` to allow that, the server must be started like this:
274
+
275
+ ```bash
276
+ pm2 start --name coderflow authbind -- --deep coder-server start
277
+ ```
278
+
279
+ Otherwise start like this:
280
+
281
+ ```bash
282
+ pm2 start --name coderflow coder-server -- start
283
+ ```
284
+
285
+ #### View Logs
286
+
287
+ ```bash
288
+ pm2 logs coderflow
289
+ ```
290
+
291
+ #### Stop/Restart
292
+
293
+ ```bash
294
+ pm2 stop coderflow
295
+ pm2 start coderflow
296
+ pm2 restart coderflow
297
+ ```
298
+
299
+ #### Auto-start On System Boot
300
+
301
+ Save the PM2 process list to disk:
302
+
303
+ ```bash
304
+ pm2 save
305
+ ```
306
+
307
+ Generate a PM2 startup script:
308
+
309
+ ```bash
310
+ pm2 startup
311
+ ```
312
+
313
+ `pm2 startup` outputs a commmand string to your terminal, which must be run as root, to configure the system's service manager to start up PM2 at system boot.
@@ -0,0 +1,35 @@
1
+ # Skills
2
+
3
+ Skills are reusable, prompt-based actions that agents can invoke during tasks. Each skill lives in your coder setup repository under `skills/<skill-id>/` with a `SKILL.md` file and optional supporting files (templates, scripts, references).
4
+
5
+ ## Managing Skills
6
+
7
+ Open **Administration -> Skills** in the Web UI to create and manage skills. The Skills page includes the same git workflow as environments:
8
+
9
+ - **Save** changes without committing
10
+ - **Commit & Push** to version skills in your coder setup repository
11
+ - **Pull** and **Discard** to sync with teammates
12
+
13
+ ### Create or Edit Skills
14
+
15
+ Use **New Skill** to create a skill ID, display name, and description. Each skill includes:
16
+
17
+ - **Metadata** (name, description, model/tools hints)
18
+ - **Prompt** (the instructions in `SKILL.md`)
19
+ - **Supporting Files** (optional files referenced by the prompt)
20
+
21
+ ### Import External Skills
22
+
23
+ You can also import skills from external sources:
24
+
25
+ - **Catalog** — curated skills bundled with CoderFlow
26
+ - **Git repository** — import a skill directory from a repo
27
+ - **Local folder** — import from a path on the server
28
+
29
+ Imported skills stay synced with their source. Git-based imports can be updated from the Skills page when updates are available.
30
+
31
+ ## Assign Skills to Environments
32
+
33
+ Skills become available to agents only after they are assigned to an environment. In **Environments -> Overview**, click **Add Skills** and select the skills to include. The selected skills propagate to every new task launched in that environment.
34
+
35
+ If you update skill assignments, save the environment and launch a new task for the changes to take effect.
@@ -0,0 +1,241 @@
1
+ # Single Sign-On (SSO)
2
+
3
+ CoderFlow supports Single Sign-On via OpenID Connect (OIDC), allowing users to authenticate with your organization's identity provider.
4
+
5
+ ## Overview
6
+
7
+ SSO provides:
8
+
9
+ - **Centralized authentication** — Users log in with existing corporate credentials
10
+ - **Automatic user provisioning** — New users are created on first login
11
+ - **Security compliance** — Leverage your IdP's MFA, conditional access, and audit logging
12
+
13
+ CoderFlow works with any OIDC-compliant identity provider, including Microsoft Entra ID, Okta, Google Workspace, and Auth0.
14
+
15
+ ## VS Code Extension
16
+
17
+ When SSO is enabled, the VS Code extension profile manager shows a **Sign in with SSO** option. The extension opens a browser window to complete the SSO flow, then exchanges the approved session for an API key to store in the profile. This works even if local username/password login is disabled.
18
+
19
+ ## Configuration Methods
20
+
21
+ SSO can be configured in two ways:
22
+
23
+ - **Web UI** — Configure through the Settings page (recommended)
24
+ - **Configuration file** — Edit `oidc.json` directly in your setup repository
25
+
26
+ Both methods produce the same result. The Web UI is recommended for most users as it provides validation and a guided setup experience.
27
+
28
+ ## Configuring via Web UI
29
+
30
+ 1. Navigate to **Settings → Single Sign-On**
31
+ 2. Configure the **Connection** tab:
32
+ - Enable SSO
33
+ - Select your identity provider (or Custom for other providers)
34
+ - Enter your Client ID, Client Secret, and Issuer URL
35
+ - Use **Test Connection** to verify your settings
36
+ 5. Configure the **User Provisioning** tab:
37
+ - Enable/disable auto-provisioning
38
+ - Set the default role for new users
39
+ - Choose whether to allow local login alongside SSO
40
+ 6. Click **Save** to save and apply changes immediately
41
+
42
+ ## Configuring via File
43
+
44
+ Create an `oidc.json` file in your setup repository root:
45
+
46
+ ```json
47
+ {
48
+ "enabled": true,
49
+ "display_name": "Sign in with Microsoft",
50
+ "client_id": "your-client-id",
51
+ "client_secret": "your-client-secret",
52
+ "issuer": "https://login.microsoftonline.com/{tenant-id}/v2.0",
53
+ "scopes": ["openid", "profile", "email"],
54
+ "auto_provision": true,
55
+ "default_role": "developer",
56
+ "allow_local_auth": true
57
+ }
58
+ ```
59
+
60
+ After saving the file, restart CoderFlow or use the Web UI to reload the configuration.
61
+
62
+ > **Security Note**: The `oidc.json` file contains secrets and is automatically excluded from git via `.gitignore`.
63
+
64
+ ### Configuration Reference
65
+
66
+ | Option | Required | Default | Description |
67
+ |--------|----------|---------|-------------|
68
+ | `enabled` | Yes | — | Set to `true` to enable SSO |
69
+ | `display_name` | No | `"Sign in with SSO"` | Text displayed on the SSO button |
70
+ | `client_id` | Yes | — | Application/client ID from your identity provider |
71
+ | `client_secret` | Yes | — | Client secret from your identity provider |
72
+ | `issuer` | Yes | — | OIDC issuer URL (used for discovery) |
73
+ | `scopes` | No | `["openid", "profile", "email"]` | OAuth scopes to request |
74
+ | `auto_provision` | No | `true` | Automatically create users on first SSO login |
75
+ | `default_role` | No | `"developer"` | Role assigned to auto-provisioned users |
76
+ | `allow_local_auth` | No | `true` | Show local login form alongside SSO button |
77
+
78
+ ## Microsoft Entra ID Setup
79
+
80
+ ### 1. Create App Registration
81
+
82
+ 1. Go to [Azure Portal](https://portal.azure.com)
83
+ 2. Navigate to **Microsoft Entra ID** > **App registrations** > **New registration**
84
+ 3. Configure the registration:
85
+ - **Name**: `CoderFlow` (or your preferred name)
86
+ - **Supported account types**: Single tenant (recommended for enterprise)
87
+ - **Redirect URI**: Select **Web** and enter `https://{your-coderflow-host}/auth/oidc/callback`
88
+ 4. Click **Register**
89
+ 5. Note the **Application (client) ID** and **Directory (tenant) ID** from the Overview page
90
+
91
+ ### 2. Create Client Secret
92
+
93
+ 1. In your app registration, go to **Certificates & secrets**
94
+ 2. Click **New client secret**
95
+ 3. Add a description and select an expiration period
96
+ 4. Click **Add**
97
+ 5. Copy the secret **Value** immediately (it won't be shown again)
98
+
99
+ ### 3. Configure CoderFlow
100
+
101
+ **Via Web UI:**
102
+ 1. Go to **Settings → Single Sign-On**
103
+ 2. Select **Microsoft Entra ID (Azure AD)** as the provider
104
+ 3. Enter your Client ID and Client Secret
105
+ 4. Replace `{tenant-id}` in the Issuer URL with your Directory (tenant) ID
106
+ 5. Click **Save**
107
+
108
+ **Via configuration file:**
109
+
110
+ Create `oidc.json` in your setup repository:
111
+
112
+ ```json
113
+ {
114
+ "enabled": true,
115
+ "display_name": "Sign in with Microsoft",
116
+ "client_id": "{your-application-client-id}",
117
+ "client_secret": "{your-client-secret-value}",
118
+ "issuer": "https://login.microsoftonline.com/{your-tenant-id}/v2.0",
119
+ "scopes": ["openid", "profile", "email"],
120
+ "auto_provision": true,
121
+ "default_role": "developer",
122
+ "allow_local_auth": true
123
+ }
124
+ ```
125
+
126
+ ## Other Identity Providers
127
+
128
+ ### Okta
129
+
130
+ **Issuer URL:** `https://{your-okta-domain}/oauth2/default`
131
+
132
+ In Okta Admin Console:
133
+ 1. Create a new **Web** application
134
+ 2. Set the redirect URI to `https://{your-coderflow-host}/auth/oidc/callback`
135
+ 3. Copy the Client ID and Client Secret
136
+
137
+ ### Google Workspace
138
+
139
+ **Issuer URL:** `https://accounts.google.com`
140
+
141
+ In Google Cloud Console:
142
+ 1. Create OAuth 2.0 credentials (Web application type)
143
+ 2. Add `https://{your-coderflow-host}/auth/oidc/callback` to authorized redirect URIs
144
+ 3. Copy the Client ID and Client Secret
145
+
146
+ ### Generic OIDC Provider
147
+
148
+ For other OIDC-compliant providers, you need:
149
+
150
+ - **Issuer URL**: Must support OIDC discovery (`.well-known/openid-configuration`)
151
+ - **Client ID and Secret**: From your provider's application registration
152
+ - **Redirect URI**: `https://{your-coderflow-host}/auth/oidc/callback`
153
+
154
+ ## User Provisioning
155
+
156
+ ### Auto-Provisioning Enabled (Default)
157
+
158
+ When auto-provisioning is enabled, CoderFlow automatically creates a user account on first SSO login:
159
+
160
+ - **Username**: Derived from email (e.g., `john.doe@company.com` becomes `johndoe`)
161
+ - **Email**: From the identity provider's claims
162
+ - **Name**: From the identity provider's claims
163
+ - **Role**: Set to the configured default role (defaults to `developer`)
164
+
165
+ The user can immediately access CoderFlow based on their assigned role.
166
+
167
+ ### Auto-Provisioning Disabled
168
+
169
+ When auto-provisioning is disabled, users must be created in CoderFlow before they can log in via SSO. Create users with matching email addresses:
170
+
171
+ ```bash
172
+ coder-server create-user --username=johndoe --email=john.doe@company.com --name="John Doe" --role=developer
173
+ ```
174
+
175
+ SSO login will fail with "user not found" if no matching user exists.
176
+
177
+ ### Updating User Information
178
+
179
+ When an existing user logs in via SSO, CoderFlow updates their display name if it changed in the identity provider. Other fields (username, role, permissions) are managed within CoderFlow.
180
+
181
+ ## SSO-Only Mode
182
+
183
+ To enforce SSO and hide the local login form, disable "Allow local login" in the Web UI or set `allow_local_auth` to `false` in the configuration file.
184
+
185
+ > **Important**: Ensure at least one admin user can authenticate via SSO before disabling local auth. If locked out, re-enable local auth through the configuration file and restart the server.
186
+
187
+ ## Removing SSO
188
+
189
+ To disable SSO:
190
+
191
+ **Via Web UI:**
192
+ 1. Go to **Settings → Single Sign-On**
193
+ 2. Click **Remove SSO**
194
+
195
+ **Via file:**
196
+ Delete the `oidc.json` file from your setup repository and restart CoderFlow.
197
+
198
+ ## Troubleshooting
199
+
200
+ ### "Redirect URI mismatch" Error
201
+
202
+ The redirect URI in your identity provider must exactly match CoderFlow's callback URL:
203
+
204
+ ```
205
+ https://{your-host}/auth/oidc/callback
206
+ ```
207
+
208
+ Common issues:
209
+ - HTTP vs HTTPS mismatch
210
+ - Missing or extra trailing slash
211
+ - Wrong port number
212
+ - Hostname mismatch (e.g., `localhost` vs `127.0.0.1`)
213
+
214
+ ### "Invalid or expired state" Error
215
+
216
+ This occurs when:
217
+ - The login took too long (over 10 minutes)
218
+ - The user refreshed the page during login
219
+ - Browser cookies are blocked
220
+
221
+ Solution: Return to the login page and try again.
222
+
223
+ ### "User not found" Error
224
+
225
+ This appears when auto-provisioning is disabled and no user with the SSO email exists in CoderFlow. Either:
226
+ - Enable auto-provisioning, or
227
+ - Create the user manually with the correct email address
228
+
229
+ ### "Missing email claim" Error
230
+
231
+ The identity provider isn't returning the user's email. Ensure:
232
+ - The `email` scope is included in your configuration
233
+ - The user has an email address in the identity provider
234
+ - The app registration has permission to read email (check API permissions in Azure)
235
+
236
+ ### SSO Button Not Appearing
237
+
238
+ Verify that:
239
+ - SSO is enabled in the configuration
240
+ - The server has loaded the configuration (check server logs)
241
+ - Use **Test Connection** in the Web UI to verify the issuer URL is accessible
@@ -0,0 +1,57 @@
1
+ # Users & Roles
2
+
3
+ CoderFlow includes role-based access control with four predefined roles. Administrators manage users through the Web UI.
4
+
5
+ ## Roles
6
+
7
+ ### Administrator
8
+
9
+ Full system access. Administrators can:
10
+ - Manage all users, roles, and permissions
11
+ - Configure environments and system settings
12
+ - Access all tasks across the organization
13
+ - View audit logs and server health
14
+
15
+ ### Manager
16
+
17
+ Team oversight and task management. Managers can:
18
+ - Create and manage users (up to Manager level)
19
+ - View and manage all tasks
20
+ - Judge, approve, or reject tasks
21
+ - Assign tasks to other users
22
+
23
+ ### Developer
24
+
25
+ Standard permissions for development work. Developers can:
26
+ - Create and execute tasks
27
+ - View and manage their own tasks
28
+ - Access environments for development
29
+ - Manage their own API keys
30
+
31
+ ### Viewer
32
+
33
+ Read-only access for monitoring. Viewers can:
34
+ - View their own tasks (read-only)
35
+ - View environment details
36
+ - Manage their own API keys
37
+
38
+ ## Role Hierarchy
39
+
40
+ Users can only manage others at or below their privilege level:
41
+ - Administrators can manage anyone
42
+ - Managers can manage Developers and Viewers
43
+ - Developers and Viewers cannot manage other users
44
+
45
+ ## Custom Permissions
46
+
47
+ Beyond role-based permissions, administrators can assign additional permissions to individual users. This allows fine-tuned access control—for example, granting a Developer the ability to judge tasks without promoting them to Manager.
48
+
49
+ ## Managing Users
50
+
51
+ User management is done through the Web UI:
52
+ - Create new users with username, email, and role
53
+ - Edit user details and change roles
54
+ - Assign custom permissions as needed
55
+ - Deactivate or remove users
56
+
57
+ For initial setup or automation, users can also be created via command-line scripts or the REST API.