You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
docs(claude-code): add Bedrock and Vertex examples, tighten README
Review feedback on the README:
- AI Gateway description drops 'MCP policy enforcement' because it is not
shipping yet; keeps the auditing and token usage claims that are live.
- Add a first-class AWS Bedrock example using the env map with either a
bearer token (AWS_BEARER_TOKEN_BEDROCK) or access key pair. Mirrors what
v4 had but composed via env, not dedicated variables.
- Add a first-class Google Vertex AI example. Requires a pre_install_script
to drop the SA JSON and point GOOGLE_APPLICATION_CREDENTIALS at it; keep
gcloud installation as the template author's choice.
- Clarify 'Using a pre-installed binary': claude_binary_path is only
consulted when install_claude_code = false; the official installer
drops the binary at $HOME/.local/bin and does not accept a destination
override.
- Drop the 'Scripts produced' section. It restated an implementation
detail that duplicates the Outputs section and the pre/post-install
extension docs.
- Simplify the Unattended mode section: keep the example and runtime-flag
alternative, drop the keys-verified table and the human-user note.
Point at upstream Claude Code docs for canonical key definitions.
- Drop the Outputs table; keep the composition example. The type and
description already live in the module's output block.
Copy file name to clipboardExpand all lines: registry/coder/modules/claude-code/README.md
+76-32Lines changed: 76 additions & 32 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -72,7 +72,7 @@ module "claude-code" {
72
72
73
73
### Coder AI Gateway
74
74
75
-
Route Claude Code through [Coder AI Gateway](https://coder.com/docs/ai-coder/ai-gateway) for centralized auditing, token usage tracking, and MCP policy enforcement. Requires Coder Premium with the AI Governance add-on and `CODER_AIBRIDGE_ENABLED=true` on the server.
75
+
Route Claude Code through [Coder AI Gateway](https://coder.com/docs/ai-coder/ai-gateway) for centralized auditing and token usage tracking. Requires Coder Premium with the AI Governance add-on and `CODER_AIBRIDGE_ENABLED=true` on the server.
76
76
77
77
Point `ANTHROPIC_BASE_URL` at your deployment's `/api/v2/aibridge/anthropic` endpoint and authenticate with the workspace owner's session token via `ANTHROPIC_AUTH_TOKEN`. Claude Code reads both variables natively; no API key is required.
78
78
@@ -96,7 +96,75 @@ module "claude-code" {
96
96
> [!NOTE]
97
97
> AI Gateway was previously named AI Bridge. The server-side endpoints and environment variables still use the `aibridge` prefix; only the product name changed.
98
98
99
-
### Other custom endpoints (Bedrock, Vertex, LiteLLM, a private proxy)
99
+
### AWS Bedrock
100
+
101
+
Route Claude Code through [AWS Bedrock](https://docs.claude.com/en/docs/claude-code/amazon-bedrock) to access Claude models via your AWS account. Requires an AWS account with Bedrock access, the target Claude models enabled in the Bedrock console, and IAM permissions that allow `bedrock:InvokeModel` and `bedrock:InvokeModelWithResponseStream`.
102
+
103
+
Pick either an access key pair or a Bedrock bearer token for auth; do not set both.
Route Claude Code through [Google Vertex AI](https://docs.claude.com/en/docs/claude-code/google-vertex-ai). Requires a GCP project with Vertex AI enabled, Claude models enabled via Model Garden, and a service account with the Vertex AI User role.
131
+
132
+
The service account JSON has to land on the workspace filesystem where Claude can read it, so authenticating gcloud happens in `pre_install_script`:
133
+
134
+
```tf
135
+
variable "vertex_sa_json" {
136
+
type = string
137
+
description = "Full JSON body of a GCP service account key with Vertex AI User."
Install `gcloud` itself in the workspace image, in `pre_install_script`, or via a separate Coder module; this example leaves that choice to the template author.
166
+
167
+
### Other custom endpoints (LiteLLM, a private proxy)
100
168
101
169
Same pattern with your own endpoint and token. The [Claude Code env-vars reference](https://docs.claude.com/en/docs/claude-code/env-vars) lists every supported name.
102
170
@@ -173,7 +241,9 @@ module "claude-code" {
173
241
174
242
## Using a pre-installed binary
175
243
176
-
Set `install_claude_code = false` and point `claude_binary_path` at the directory containing the binary.
244
+
`claude_binary_path` is only consulted when `install_claude_code = false`. The official installer always drops the binary at `$HOME/.local/bin/claude` and does not accept a custom destination, so combining `install_claude_code = true` with a custom `claude_binary_path` is rejected at plan time.
245
+
246
+
To use a binary you bake into the image (or install via a separate module), set `install_claude_code = false` and point `claude_binary_path` at the directory containing it:
177
247
178
248
```tf
179
249
module "claude-code" {
@@ -185,18 +255,6 @@ module "claude-code" {
185
255
}
186
256
```
187
257
188
-
## Scripts produced
189
-
190
-
By default this module creates exactly one `coder_script` on the agent: `Claude Code: Install Script`. Additional scripts appear only when you opt in:
|`~/.claude/settings.json`|`skipDangerousModePermissionPrompt`| Silences the one-time "enable bypassPermissions mode" consent banner. |
282
-
|`~/.claude.json`|`hasCompletedOnboarding`| Skips the first-run theme picker and welcome screens. |
333
+
Key reference: [`permissions`](https://docs.claude.com/en/docs/claude-code/settings) in `~/.claude/settings.json`, [`hasCompletedOnboarding`](https://docs.claude.com/en/docs/claude-code/settings) in `~/.claude.json`.
283
334
284
-
> [!NOTE]
285
-
> Pre-writing these files makes sense for automation and agents. Human users who expect the usual onboarding and per-project trust dialog should not use this pattern.
286
-
287
-
For one-off non-interactive runs, prefer the runtime flag instead of pre-writing config:
335
+
For one-off non-interactive runs, prefer a runtime flag over pre-writing config:
288
336
289
337
```bash
290
338
claude -p "$PROMPT" --dangerously-skip-permissions --permission-mode bypassPermissions
|`scripts`|`list(string)`|`coder exp sync` names for every `coder_script` this module actually creates, in the run order `coder-utils` enforces (pre-install, install, post-install). Absent scripts are not in the list. |
298
-
299
-
Use `scripts` to gate a downstream module behind Claude Code's install:
343
+
`scripts` is a list of `coder exp sync` names for every `coder_script` this module creates, in the order `coder-utils` runs them. Use it to gate a downstream `coder_script` behind Claude Code's install:
0 commit comments