Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "1.12.1"
".": "1.12.2"
}
6 changes: 3 additions & 3 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
configured_endpoints: 116
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/anthropic/anthropic-5ce93251152bd7c4c288dacdf5a445383825ba50bc472ff9e9821ee9455e3564.yml
openapi_spec_hash: 989d596f7660ce55a7cea748a9292b45
config_hash: 44acd8a997dff056931fb4466201cdeb
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/anthropic/anthropic-a548d120cebb4d68d46c828028d51d04b4d4abb868a7bad21dad960cb72cbd18.yml
openapi_spec_hash: 2b3214760a4e23a9704779ac99bce417
config_hash: ce2cd5d2f03228adacf04ebcceb14465
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
# Changelog

## 1.12.2 (2026-06-24)

Full Changelog: [v1.12.1...v1.12.2](https://github.com/anthropics/anthropic-cli/compare/v1.12.1...v1.12.2)

### Chores

* **api:** add support for sending User Profile ID in request headers ([2a9ec20](https://github.com/anthropics/anthropic-cli/commit/2a9ec20801996eb19686496cebfbdfb3a9420d37))
* **internal:** codegen related update ([70616f5](https://github.com/anthropics/anthropic-cli/commit/70616f54b54e6a48daab449acb3a9e99c42508da))


### Documentation

* **model-release:** model-ID-launch checklist ([62562f3](https://github.com/anthropics/anthropic-cli/commit/62562f3cf05adb984e844d831d2db8d461157775))

## 1.12.1 (2026-06-10)

Full Changelog: [v1.12.0...v1.12.1](https://github.com/anthropics/anthropic-cli/compare/v1.12.0...v1.12.1)
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module github.com/anthropics/anthropic-cli
go 1.25

require (
github.com/anthropics/anthropic-sdk-go v1.50.1
github.com/anthropics/anthropic-sdk-go v1.51.1
github.com/charmbracelet/bubbles v0.21.0
github.com/charmbracelet/bubbletea v1.3.6
github.com/charmbracelet/lipgloss v1.1.0
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
github.com/anthropics/anthropic-sdk-go v1.50.1 h1:XTd1RkdeHCPusPpzcBY5RIWj/WW6ZktjftxrHvQBJfU=
github.com/anthropics/anthropic-sdk-go v1.50.1/go.mod h1:3EfIfmFqxH6rbiLcIP4tPFyXL/IHakx2wDG4OU+TIEI=
github.com/anthropics/anthropic-sdk-go v1.51.1 h1:V6VJb6lHMXw25i0bITGCj2fHHCq1WCg76s7XAQYOgSs=
github.com/anthropics/anthropic-sdk-go v1.51.1/go.mod h1:3EfIfmFqxH6rbiLcIP4tPFyXL/IHakx2wDG4OU+TIEI=
github.com/aymanbagabas/go-osc52/v2 v2.0.1 h1:HwpRHbFMcZLEVr42D4p7XBqjyuxQH5SMiErDT4WkJ2k=
github.com/aymanbagabas/go-osc52/v2 v2.0.1/go.mod h1:uYgXzlJ7ZpABp8OJ+exZzJJhRNQ2ASbcXHWsFqH8hp8=
github.com/aymanbagabas/go-udiff v0.2.0 h1:TK0fH4MteXUDspT88n8CKzvK0X9O2xu9yQjWpi6yML8=
Expand Down
4 changes: 2 additions & 2 deletions pkg/cmd/betaagent.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ var betaAgentsCreate = requestflag.WithInnerFlags(cli.Command{
},
&requestflag.Flag[[]map[string]any]{
Name: "mcp-server",
Usage: "MCP servers this agent connects to. Maximum 20. Names must be unique within the array.",
Usage: "MCP servers this agent connects to. Maximum 20. Names must be unique within the array. Every server must be referenced by an `mcp_toolset` in `tools`; unreferenced servers are rejected. See the [MCP connector guide](https://platform.claude.com/docs/en/managed-agents/mcp-connector).",
BodyPath: "mcp_servers",
},
&requestflag.Flag[map[string]any]{
Expand Down Expand Up @@ -155,7 +155,7 @@ var betaAgentsUpdate = requestflag.WithInnerFlags(cli.Command{
},
&requestflag.Flag[any]{
Name: "mcp-server",
Usage: "MCP servers. Full replacement. Omit to preserve; send empty array or null to clear. Names must be unique. Maximum 20.",
Usage: "MCP servers. Full replacement. Omit to preserve; send empty array or `null` to clear. Names must be unique. Maximum 20. Every server must be referenced by an `mcp_toolset` in the agent's resulting `tools`; unreferenced servers are rejected. See the [MCP connector guide](https://platform.claude.com/docs/en/managed-agents/mcp-connector).",
BodyPath: "mcp_servers",
},
&requestflag.Flag[map[string]any]{
Expand Down
14 changes: 7 additions & 7 deletions pkg/cmd/betamessage.go
Original file line number Diff line number Diff line change
Expand Up @@ -142,16 +142,16 @@ var betaMessagesCreate = requestflag.WithInnerFlags(cli.Command{
Usage: "Use nucleus sampling.\n\nIn nucleus sampling, we compute the cumulative distribution over all the options for each subsequent token in decreasing probability order and cut it off once it reaches a particular probability specified by `top_p`.\n\nRecommended for advanced use cases only.",
BodyPath: "top_p",
},
&requestflag.Flag[*string]{
Name: "user-profile-id",
Usage: "The user profile ID to attribute this request to. Use when acting on behalf of a party other than your organization.",
BodyPath: "user_profile_id",
},
&requestflag.Flag[[]string]{
Name: "beta",
Usage: "Optional header to specify the beta version(s) you want to use.",
HeaderPath: "anthropic-beta",
},
&requestflag.Flag[string]{
Name: "user-profile-id",
Usage: "The user profile ID to attribute this request to. Use when acting on behalf of a party other than your organization. Requires the `user-profiles` beta header.",
HeaderPath: "anthropic-user-profile-id",
},
&requestflag.Flag[int64]{
Name: "max-items",
Usage: "The maximum number of items to return (use -1 for unlimited).",
Expand Down Expand Up @@ -179,7 +179,7 @@ var betaMessagesCreate = requestflag.WithInnerFlags(cli.Command{
},
&requestflag.InnerFlag[string]{
Name: "cache-control.ttl",
Usage: "The time-to-live for the cache control breakpoint.\n\nThis may be one the following values:\n- `5m`: 5 minutes\n- `1h`: 1 hour\n\nDefaults to `5m`.",
Usage: "The time-to-live for the cache control breakpoint.\n\nThis may be one the following values:\n- `5m`: 5 minutes\n- `1h`: 1 hour\n\nDefaults to `5m`. See [prompt caching pricing](https://docs.claude.com/en/docs/build-with-claude/prompt-caching) for details.",
InnerField: "ttl",
},
},
Expand Down Expand Up @@ -377,7 +377,7 @@ var betaMessagesCountTokens = requestflag.WithInnerFlags(cli.Command{
},
&requestflag.InnerFlag[string]{
Name: "cache-control.ttl",
Usage: "The time-to-live for the cache control breakpoint.\n\nThis may be one the following values:\n- `5m`: 5 minutes\n- `1h`: 1 hour\n\nDefaults to `5m`.",
Usage: "The time-to-live for the cache control breakpoint.\n\nThis may be one the following values:\n- `5m`: 5 minutes\n- `1h`: 1 hour\n\nDefaults to `5m`. See [prompt caching pricing](https://docs.claude.com/en/docs/build-with-claude/prompt-caching) for details.",
InnerField: "ttl",
},
},
Expand Down
8 changes: 4 additions & 4 deletions pkg/cmd/betamessage_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ func TestBetaMessagesCreate(t *testing.T) {
"--tool", "{input_schema: {type: object, properties: {location: bar, unit: bar}, required: [location]}, name: name, allowed_callers: [direct], cache_control: {type: ephemeral, ttl: 5m}, defer_loading: true, description: Get the current weather in a given location, eager_input_streaming: true, input_examples: [{foo: bar}], strict: true, type: custom}",
"--top-k", "5",
"--top-p", "0.7",
"--user-profile-id", "user_profile_id",
"--beta", "message-batches-2024-09-24",
"--user-profile-id", "anthropic-user-profile-id",
)
})

Expand Down Expand Up @@ -94,8 +94,8 @@ func TestBetaMessagesCreate(t *testing.T) {
"--tool", "{input_schema: {type: object, properties: {location: bar, unit: bar}, required: [location]}, name: name, allowed_callers: [direct], cache_control: {type: ephemeral, ttl: 5m}, defer_loading: true, description: Get the current weather in a given location, eager_input_streaming: true, input_examples: [{foo: bar}], strict: true, type: custom}",
"--top-k", "5",
"--top-p", "0.7",
"--user-profile-id", "user_profile_id",
"--beta", "message-batches-2024-09-24",
"--user-profile-id", "anthropic-user-profile-id",
)
})

Expand Down Expand Up @@ -237,14 +237,14 @@ func TestBetaMessagesCreate(t *testing.T) {
" strict: true\n" +
" type: custom\n" +
"top_k: 5\n" +
"top_p: 0.7\n" +
"user_profile_id: user_profile_id\n")
"top_p: 0.7\n")
mocktest.TestRunMockTestWithPipeAndFlags(
t, pipeData,
"--api-key", "string",
"beta:messages", "create",
"--max-items", "10",
"--beta", "message-batches-2024-09-24",
"--user-profile-id", "anthropic-user-profile-id",
)
})
}
Expand Down
5 changes: 5 additions & 0 deletions pkg/cmd/betamessagebatch.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@ var betaMessagesBatchesCreate = requestflag.WithInnerFlags(cli.Command{
Usage: "Optional header to specify the beta version(s) you want to use.",
HeaderPath: "anthropic-beta",
},
&requestflag.Flag[string]{
Name: "user-profile-id",
Usage: "The user profile ID to attribute the requests in this batch to. Use when acting on behalf of a party other than your organization. Requires the `user-profiles` beta header. Applies to every request in the batch; an individual request whose `user_profile_id` body field conflicts with this header is errored.",
HeaderPath: "anthropic-user-profile-id",
},
},
Action: handleBetaMessagesBatchesCreate,
HideHelpCommand: true,
Expand Down
12 changes: 7 additions & 5 deletions pkg/cmd/betamessagebatch_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,9 @@ func TestBetaMessagesBatchesCreate(t *testing.T) {
t,
"--api-key", "string",
"beta:messages:batches", "create",
"--request", "{custom_id: my-custom-id-1, params: {max_tokens: 1024, messages: [{content: [{text: x, type: text, cache_control: {type: ephemeral, ttl: 5m}, citations: [{cited_text: cited_text, document_index: 0, document_title: x, end_char_index: 0, start_char_index: 0, type: char_location}]}], role: user}], model: claude-opus-4-6, cache_control: {type: ephemeral, ttl: 5m}, container: {id: id, skills: [{skill_id: pdf, type: anthropic, version: latest}]}, context_management: {edits: [{type: clear_tool_uses_20250919, clear_at_least: {type: input_tokens, value: 0}, clear_tool_inputs: true, exclude_tools: [string], keep: {type: tool_uses, value: 0}, trigger: {type: input_tokens, value: 1}}]}, diagnostics: {previous_message_id: previous_message_id}, fallback_credit_token: x, fallbacks: [{model: claude-fable-5, max_tokens: 0, output_config: {effort: low, format: {schema: {foo: bar}, type: json_schema}, task_budget: {total: 1024, type: tokens, remaining: 0}}, speed: standard, thinking: {budget_tokens: 1024, type: enabled, display: summarized}}], inference_geo: inference_geo, mcp_servers: [{name: name, type: url, url: url, authorization_token: authorization_token, tool_configuration: {allowed_tools: [string], enabled: true}}], metadata: {user_id: 13803d75-b4b5-4c3e-b2a2-6f21399b021b}, output_config: {effort: low, format: {schema: {foo: bar}, type: json_schema}, task_budget: {total: 1024, type: tokens, remaining: 0}}, output_format: {schema: {foo: bar}, type: json_schema}, service_tier: auto, speed: standard, stop_sequences: [string], stream: true, system: [{text: Today's date is 2024-06-01., type: text, cache_control: {type: ephemeral, ttl: 5m}, citations: [{cited_text: cited_text, document_index: 0, document_title: x, end_char_index: 0, start_char_index: 0, type: char_location}]}], temperature: 1, thinking: {type: adaptive, display: summarized}, tool_choice: {type: auto, disable_parallel_tool_use: true}, tools: [{input_schema: {type: object, properties: {location: bar, unit: bar}, required: [location]}, name: name, allowed_callers: [direct], cache_control: {type: ephemeral, ttl: 5m}, defer_loading: true, description: Get the current weather in a given location, eager_input_streaming: true, input_examples: [{foo: bar}], strict: true, type: custom}], top_k: 5, top_p: 0.7, user_profile_id: user_profile_id}}",
"--request", "{custom_id: my-custom-id-1, params: {max_tokens: 1024, messages: [{content: [{text: x, type: text, cache_control: {type: ephemeral, ttl: 5m}, citations: [{cited_text: cited_text, document_index: 0, document_title: x, end_char_index: 0, start_char_index: 0, type: char_location}]}], role: user}], model: claude-opus-4-6, cache_control: {type: ephemeral, ttl: 5m}, container: {id: id, skills: [{skill_id: pdf, type: anthropic, version: latest}]}, context_management: {edits: [{type: clear_tool_uses_20250919, clear_at_least: {type: input_tokens, value: 0}, clear_tool_inputs: true, exclude_tools: [string], keep: {type: tool_uses, value: 0}, trigger: {type: input_tokens, value: 1}}]}, diagnostics: {previous_message_id: previous_message_id}, fallback_credit_token: x, fallbacks: [{model: claude-fable-5, max_tokens: 0, output_config: {effort: low, format: {schema: {foo: bar}, type: json_schema}, task_budget: {total: 1024, type: tokens, remaining: 0}}, speed: standard, thinking: {budget_tokens: 1024, type: enabled, display: summarized}}], inference_geo: inference_geo, mcp_servers: [{name: name, type: url, url: url, authorization_token: authorization_token, tool_configuration: {allowed_tools: [string], enabled: true}}], metadata: {user_id: 13803d75-b4b5-4c3e-b2a2-6f21399b021b}, output_config: {effort: low, format: {schema: {foo: bar}, type: json_schema}, task_budget: {total: 1024, type: tokens, remaining: 0}}, output_format: {schema: {foo: bar}, type: json_schema}, service_tier: auto, speed: standard, stop_sequences: [string], stream: false, system: [{text: Today's date is 2024-06-01., type: text, cache_control: {type: ephemeral, ttl: 5m}, citations: [{cited_text: cited_text, document_index: 0, document_title: x, end_char_index: 0, start_char_index: 0, type: char_location}]}], temperature: 1, thinking: {type: adaptive, display: summarized}, tool_choice: {type: auto, disable_parallel_tool_use: true}, tools: [{input_schema: {type: object, properties: {location: bar, unit: bar}, required: [location]}, name: name, allowed_callers: [direct], cache_control: {type: ephemeral, ttl: 5m}, defer_loading: true, description: Get the current weather in a given location, eager_input_streaming: true, input_examples: [{foo: bar}], strict: true, type: custom}], top_k: 5, top_p: 0.7}}",
"--beta", "message-batches-2024-09-24",
"--user-profile-id", "anthropic-user-profile-id",
)
})

Expand All @@ -30,8 +31,9 @@ func TestBetaMessagesBatchesCreate(t *testing.T) {
"--api-key", "string",
"beta:messages:batches", "create",
"--request.custom-id", "my-custom-id-1",
"--request.params", "{max_tokens: 1024, messages: [{content: [{text: x, type: text, cache_control: {type: ephemeral, ttl: 5m}, citations: [{cited_text: cited_text, document_index: 0, document_title: x, end_char_index: 0, start_char_index: 0, type: char_location}]}], role: user}], model: claude-opus-4-6, cache_control: {type: ephemeral, ttl: 5m}, container: {id: id, skills: [{skill_id: pdf, type: anthropic, version: latest}]}, context_management: {edits: [{type: clear_tool_uses_20250919, clear_at_least: {type: input_tokens, value: 0}, clear_tool_inputs: true, exclude_tools: [string], keep: {type: tool_uses, value: 0}, trigger: {type: input_tokens, value: 1}}]}, diagnostics: {previous_message_id: previous_message_id}, fallback_credit_token: x, fallbacks: [{model: claude-fable-5, max_tokens: 0, output_config: {effort: low, format: {schema: {foo: bar}, type: json_schema}, task_budget: {total: 1024, type: tokens, remaining: 0}}, speed: standard, thinking: {budget_tokens: 1024, type: enabled, display: summarized}}], inference_geo: inference_geo, mcp_servers: [{name: name, type: url, url: url, authorization_token: authorization_token, tool_configuration: {allowed_tools: [string], enabled: true}}], metadata: {user_id: 13803d75-b4b5-4c3e-b2a2-6f21399b021b}, output_config: {effort: low, format: {schema: {foo: bar}, type: json_schema}, task_budget: {total: 1024, type: tokens, remaining: 0}}, output_format: {schema: {foo: bar}, type: json_schema}, service_tier: auto, speed: standard, stop_sequences: [string], stream: true, system: [{text: Today's date is 2024-06-01., type: text, cache_control: {type: ephemeral, ttl: 5m}, citations: [{cited_text: cited_text, document_index: 0, document_title: x, end_char_index: 0, start_char_index: 0, type: char_location}]}], temperature: 1, thinking: {type: adaptive, display: summarized}, tool_choice: {type: auto, disable_parallel_tool_use: true}, tools: [{input_schema: {type: object, properties: {location: bar, unit: bar}, required: [location]}, name: name, allowed_callers: [direct], cache_control: {type: ephemeral, ttl: 5m}, defer_loading: true, description: Get the current weather in a given location, eager_input_streaming: true, input_examples: [{foo: bar}], strict: true, type: custom}], top_k: 5, top_p: 0.7, user_profile_id: user_profile_id}",
"--request.params", "{max_tokens: 1024, messages: [{content: [{text: x, type: text, cache_control: {type: ephemeral, ttl: 5m}, citations: [{cited_text: cited_text, document_index: 0, document_title: x, end_char_index: 0, start_char_index: 0, type: char_location}]}], role: user}], model: claude-opus-4-6, cache_control: {type: ephemeral, ttl: 5m}, container: {id: id, skills: [{skill_id: pdf, type: anthropic, version: latest}]}, context_management: {edits: [{type: clear_tool_uses_20250919, clear_at_least: {type: input_tokens, value: 0}, clear_tool_inputs: true, exclude_tools: [string], keep: {type: tool_uses, value: 0}, trigger: {type: input_tokens, value: 1}}]}, diagnostics: {previous_message_id: previous_message_id}, fallback_credit_token: x, fallbacks: [{model: claude-fable-5, max_tokens: 0, output_config: {effort: low, format: {schema: {foo: bar}, type: json_schema}, task_budget: {total: 1024, type: tokens, remaining: 0}}, speed: standard, thinking: {budget_tokens: 1024, type: enabled, display: summarized}}], inference_geo: inference_geo, mcp_servers: [{name: name, type: url, url: url, authorization_token: authorization_token, tool_configuration: {allowed_tools: [string], enabled: true}}], metadata: {user_id: 13803d75-b4b5-4c3e-b2a2-6f21399b021b}, output_config: {effort: low, format: {schema: {foo: bar}, type: json_schema}, task_budget: {total: 1024, type: tokens, remaining: 0}}, output_format: {schema: {foo: bar}, type: json_schema}, service_tier: auto, speed: standard, stop_sequences: [string], stream: false, system: [{text: Today's date is 2024-06-01., type: text, cache_control: {type: ephemeral, ttl: 5m}, citations: [{cited_text: cited_text, document_index: 0, document_title: x, end_char_index: 0, start_char_index: 0, type: char_location}]}], temperature: 1, thinking: {type: adaptive, display: summarized}, tool_choice: {type: auto, disable_parallel_tool_use: true}, tools: [{input_schema: {type: object, properties: {location: bar, unit: bar}, required: [location]}, name: name, allowed_callers: [direct], cache_control: {type: ephemeral, ttl: 5m}, defer_loading: true, description: Get the current weather in a given location, eager_input_streaming: true, input_examples: [{foo: bar}], strict: true, type: custom}], top_k: 5, top_p: 0.7}",
"--beta", "message-batches-2024-09-24",
"--user-profile-id", "anthropic-user-profile-id",
)
})

Expand Down Expand Up @@ -133,7 +135,7 @@ func TestBetaMessagesBatchesCreate(t *testing.T) {
" speed: standard\n" +
" stop_sequences:\n" +
" - string\n" +
" stream: true\n" +
" stream: false\n" +
" system:\n" +
" - text: Today's date is 2024-06-01.\n" +
" type: text\n" +
Expand Down Expand Up @@ -176,13 +178,13 @@ func TestBetaMessagesBatchesCreate(t *testing.T) {
" strict: true\n" +
" type: custom\n" +
" top_k: 5\n" +
" top_p: 0.7\n" +
" user_profile_id: user_profile_id\n")
" top_p: 0.7\n")
mocktest.TestRunMockTestWithPipeAndFlags(
t, pipeData,
"--api-key", "string",
"beta:messages:batches", "create",
"--beta", "message-batches-2024-09-24",
"--user-profile-id", "anthropic-user-profile-id",
)
})
}
Expand Down
Loading
Loading