Skip to content

Commit a106652

Browse files
committed
Improve AI Bridge config documentation
1 parent 1630046 commit a106652

File tree

1 file changed

+22
-9
lines changed

1 file changed

+22
-9
lines changed

docs/ai-coder/ai-bridge/client-config.md

Lines changed: 22 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,28 @@ Again, the exact environment variable or setting naming may differ from tool to
2424

2525
## Configuring In-Workspace Tools
2626

27-
Template admins can pre-configure workspaces to route all AI tool requests through AI Bridge, providing a seamless and secure experience for users. This can be done with either [Coder Tasks](../tasks.md) or AI agents running in the workspace.
27+
AI coding tools running inside a Coder workspace, such as IDE extensions, can be configured to use AI Bridge.
28+
29+
While users can manually configure these tools with a long-lived API key, template admins can provide a more seamless experience by pre-configuring them. Similar to the Coder Tasks example, admins can use Terraform data sources like `data.coder_workspace_owner.me.session_token` to automatically inject the user's session token and the AI Bridge base URL into the workspace environment.
30+
31+
This is the fastest way to bring existing agents like Roo Code, Cursor, or Claude Code into compliance without adopting Coder Tasks.
32+
33+
```hcl
34+
data "coder_workspace_owner" "me" {}
35+
36+
data "coder_workspace" "me" {}
37+
38+
resource "coder_agent" "dev" {
39+
arch = "amd64"
40+
os = "linux"
41+
dir = local.repo_dir
42+
env = {
43+
ANTHROPIC_BASE_URL : "${data.coder_workspace.me.url}/api/v2/aibridge/anthropic",
44+
ANTHROPIC_AUTH_TOKEN : data.coder_workspace_owner.me.session_token
45+
}
46+
... # other agent configuration
47+
}
48+
```
2849

2950
### Using Coder Tasks
3051

@@ -59,14 +80,6 @@ module "claude-code" {
5980
}
6081
```
6182

62-
### Other IDEs and Tools
63-
64-
AI coding tools running inside a Coder workspace, such as IDE extensions, can be configured to use AI Bridge.
65-
66-
While users can manually configure these tools with a long-lived API key, template admins can provide a more seamless experience by pre-configuring them. Similar to the Coder Tasks example, admins can use Terraform data sources like `data.coder_workspace_owner.me.session_token` to automatically inject the user's session token and the AI Bridge base URL into the workspace environment.
67-
68-
This is the fastest way to bring existing agents like Roo Code, Cursor, or Claude Code into compliance without adopting Coder Tasks.
69-
7083
## External and Desktop Clients
7184

7285
You can also configure AI tools running outside of a Coder workspace, such as local IDE extensions or desktop applications, to connect to AI Bridge.

0 commit comments

Comments
 (0)