Skip to content
Open
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.2"
".": "1.12.3"
}
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-a548d120cebb4d68d46c828028d51d04b4d4abb868a7bad21dad960cb72cbd18.yml
openapi_spec_hash: 2b3214760a4e23a9704779ac99bce417
config_hash: ce2cd5d2f03228adacf04ebcceb14465
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/anthropic/anthropic-6b10a63cce1116e5b2166c09f6bea8f6ec2c05cb030b4b16bcd290cd14406042.yml
openapi_spec_hash: b1b68cfdc57f6ce83736bd7fa8219305
config_hash: a27692815fb054f08cbc5fdf2296eee5
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# Changelog

## 1.12.3 (2026-06-25)

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

### Chores

* **api:** accept user profile ID's when counting tokens ([ac6bf4b](https://github.com/anthropics/anthropic-cli/commit/ac6bf4b7c0b702d1886394a9bc4c61ab441c7354))
* **docs:** updates to descriptions and example values ([7708932](https://github.com/anthropics/anthropic-cli/commit/77089320c047ef10a0b5a81d00d4bbfd546bcc7a))

## 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)
Expand Down
36 changes: 18 additions & 18 deletions pkg/cmd/betadeployment_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ func TestBetaDeploymentsCreate(t *testing.T) {
"--description", "description",
"--metadata", "{foo: string}",
"--resource", "{file_id: file_011CNha8iCJcU1wXNR6q4V8w, type: file, mount_path: /uploads/receipt.pdf}",
"--schedule", "{expression: x, timezone: x, type: cron}",
"--schedule", "{expression: 0 9 * * 1-5, timezone: America/Los_Angeles, type: cron}",
"--vault-id", "string",
"--beta", "message-batches-2024-09-24",
)
Expand All @@ -44,8 +44,8 @@ func TestBetaDeploymentsCreate(t *testing.T) {
"--description", "description",
"--metadata", "{foo: string}",
"--resource", "{file_id: file_011CNha8iCJcU1wXNR6q4V8w, type: file, mount_path: /uploads/receipt.pdf}",
"--schedule.expression", "x",
"--schedule.timezone", "x",
"--schedule.expression", "0 9 * * 1-5",
"--schedule.timezone", "America/Los_Angeles",
"--schedule.type", "cron",
"--vault-id", "string",
"--beta", "message-batches-2024-09-24",
Expand All @@ -71,8 +71,8 @@ func TestBetaDeploymentsCreate(t *testing.T) {
" type: file\n" +
" mount_path: /uploads/receipt.pdf\n" +
"schedule:\n" +
" expression: x\n" +
" timezone: x\n" +
" expression: 0 9 * * 1-5\n" +
" timezone: America/Los_Angeles\n" +
" type: cron\n" +
"vault_ids:\n" +
" - string\n")
Expand All @@ -92,7 +92,7 @@ func TestBetaDeploymentsRetrieve(t *testing.T) {
t,
"--api-key", "string",
"beta:deployments", "retrieve",
"--deployment-id", "deployment_id",
"--deployment-id", "depl_011CZkZcDH3vPqd7xnEfwTai",
"--beta", "message-batches-2024-09-24",
)
})
Expand All @@ -104,15 +104,15 @@ func TestBetaDeploymentsUpdate(t *testing.T) {
t,
"--api-key", "string",
"beta:deployments", "update",
"--deployment-id", "deployment_id",
"--deployment-id", "depl_011CZkZcDH3vPqd7xnEfwTai",
"--agent", "string",
"--description", "description",
"--environment-id", "environment_id",
"--initial-event", "{content: [{text: 'Where is my order #1234?', type: text}], type: user.message}",
"--metadata", "{foo: string}",
"--name", "name",
"--resource", "[{file_id: file_011CNha8iCJcU1wXNR6q4V8w, type: file, mount_path: /uploads/receipt.pdf}]",
"--schedule", "{expression: x, timezone: x, type: cron}",
"--schedule", "{expression: 0 9 * * 1-5, timezone: America/Los_Angeles, type: cron}",
"--vault-id", "[string]",
"--beta", "message-batches-2024-09-24",
)
Expand All @@ -127,16 +127,16 @@ func TestBetaDeploymentsUpdate(t *testing.T) {
t,
"--api-key", "string",
"beta:deployments", "update",
"--deployment-id", "deployment_id",
"--deployment-id", "depl_011CZkZcDH3vPqd7xnEfwTai",
"--agent", "string",
"--description", "description",
"--environment-id", "environment_id",
"--initial-event", "{content: [{text: 'Where is my order #1234?', type: text}], type: user.message}",
"--metadata", "{foo: string}",
"--name", "name",
"--resource", "[{file_id: file_011CNha8iCJcU1wXNR6q4V8w, type: file, mount_path: /uploads/receipt.pdf}]",
"--schedule.expression", "x",
"--schedule.timezone", "x",
"--schedule.expression", "0 9 * * 1-5",
"--schedule.timezone", "America/Los_Angeles",
"--schedule.type", "cron",
"--vault-id", "[string]",
"--beta", "message-batches-2024-09-24",
Expand All @@ -162,16 +162,16 @@ func TestBetaDeploymentsUpdate(t *testing.T) {
" type: file\n" +
" mount_path: /uploads/receipt.pdf\n" +
"schedule:\n" +
" expression: x\n" +
" timezone: x\n" +
" expression: 0 9 * * 1-5\n" +
" timezone: America/Los_Angeles\n" +
" type: cron\n" +
"vault_ids:\n" +
" - string\n")
mocktest.TestRunMockTestWithPipeAndFlags(
t, pipeData,
"--api-key", "string",
"beta:deployments", "update",
"--deployment-id", "deployment_id",
"--deployment-id", "depl_011CZkZcDH3vPqd7xnEfwTai",
"--beta", "message-batches-2024-09-24",
)
})
Expand Down Expand Up @@ -203,7 +203,7 @@ func TestBetaDeploymentsArchive(t *testing.T) {
t,
"--api-key", "string",
"beta:deployments", "archive",
"--deployment-id", "deployment_id",
"--deployment-id", "depl_011CZkZcDH3vPqd7xnEfwTai",
"--beta", "message-batches-2024-09-24",
)
})
Expand All @@ -215,7 +215,7 @@ func TestBetaDeploymentsPause(t *testing.T) {
t,
"--api-key", "string",
"beta:deployments", "pause",
"--deployment-id", "deployment_id",
"--deployment-id", "depl_011CZkZcDH3vPqd7xnEfwTai",
"--beta", "message-batches-2024-09-24",
)
})
Expand All @@ -227,7 +227,7 @@ func TestBetaDeploymentsRun(t *testing.T) {
t,
"--api-key", "string",
"beta:deployments", "run",
"--deployment-id", "deployment_id",
"--deployment-id", "depl_011CZkZcDH3vPqd7xnEfwTai",
"--beta", "message-batches-2024-09-24",
)
})
Expand All @@ -239,7 +239,7 @@ func TestBetaDeploymentsUnpause(t *testing.T) {
t,
"--api-key", "string",
"beta:deployments", "unpause",
"--deployment-id", "deployment_id",
"--deployment-id", "depl_011CZkZcDH3vPqd7xnEfwTai",
"--beta", "message-batches-2024-09-24",
)
})
Expand Down
5 changes: 5 additions & 0 deletions pkg/cmd/betamessage.go
Original file line number Diff line number Diff line change
Expand Up @@ -354,6 +354,11 @@ var betaMessagesCountTokens = 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 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",
},
},
Action: handleBetaMessagesCountTokens,
HideHelpCommand: true,
Expand Down
3 changes: 3 additions & 0 deletions pkg/cmd/betamessage_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,7 @@ func TestBetaMessagesCountTokens(t *testing.T) {
"--tool-choice", "{type: auto, disable_parallel_tool_use: true}",
"--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}",
"--beta", "message-batches-2024-09-24",
"--user-profile-id", "anthropic-user-profile-id",
)
})

Expand Down Expand Up @@ -302,6 +303,7 @@ func TestBetaMessagesCountTokens(t *testing.T) {
"--tool-choice", "{type: auto, disable_parallel_tool_use: true}",
"--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}",
"--beta", "message-batches-2024-09-24",
"--user-profile-id", "anthropic-user-profile-id",
)
})

Expand Down Expand Up @@ -411,6 +413,7 @@ func TestBetaMessagesCountTokens(t *testing.T) {
"--api-key", "string",
"beta:messages", "count-tokens",
"--beta", "message-batches-2024-09-24",
"--user-profile-id", "anthropic-user-profile-id",
)
})
}
5 changes: 5 additions & 0 deletions pkg/cmd/message.go
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,11 @@ var messagesCountTokens = requestflag.WithInnerFlags(cli.Command{
Usage: "Definitions of tools that the model may use.\n\nIf you include `tools` in your API request, the model may return `tool_use` content blocks that represent the model's use of those tools. You can then run those tools using the tool input generated by the model and then optionally return results back to the model using `tool_result` content blocks.\n\nThere are two types of tools: **client tools** and **server tools**. The behavior described below applies to client tools. For [server tools](https://docs.claude.com/en/docs/agents-and-tools/tool-use/overview#server-tools), see their individual documentation as each has its own behavior (e.g., the [web search tool](https://docs.claude.com/en/docs/agents-and-tools/tool-use/web-search-tool)).\n\nEach tool definition includes:\n\n* `name`: Name of the tool.\n* `description`: Optional, but strongly-recommended description of the tool.\n* `input_schema`: [JSON schema](https://json-schema.org/draft/2020-12) for the tool `input` shape that the model will produce in `tool_use` output content blocks.\n\nFor example, if you defined `tools` as:\n\n```json\n[\n {\n \"name\": \"get_stock_price\",\n \"description\": \"Get the current stock price for a given ticker symbol.\",\n \"input_schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"ticker\": {\n \"type\": \"string\",\n \"description\": \"The stock ticker symbol, e.g. AAPL for Apple Inc.\"\n }\n },\n \"required\": [\"ticker\"]\n }\n }\n]\n```\n\nAnd then asked the model \"What's the S&P 500 at today?\", the model might produce `tool_use` content blocks in the response like this:\n\n```json\n[\n {\n \"type\": \"tool_use\",\n \"id\": \"toolu_01D7FLrfh4GYq7yT1ULFeyMV\",\n \"name\": \"get_stock_price\",\n \"input\": { \"ticker\": \"^GSPC\" }\n }\n]\n```\n\nYou might then run your `get_stock_price` tool with `{\"ticker\": \"^GSPC\"}` as an input, and return the following back to the model in a subsequent `user` message:\n\n```json\n[\n {\n \"type\": \"tool_result\",\n \"tool_use_id\": \"toolu_01D7FLrfh4GYq7yT1ULFeyMV\",\n \"content\": \"259.75 USD\"\n }\n]\n```\n\nTools can be used for workflows that include running client-side tools and functions, or more generally whenever you want the model to produce a particular JSON structure of output.\n\nSee our [guide](https://docs.claude.com/en/docs/tool-use) for more details.",
BodyPath: "tools",
},
&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",
},
},
Action: handleMessagesCountTokens,
HideHelpCommand: true,
Expand Down
3 changes: 3 additions & 0 deletions pkg/cmd/message_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,7 @@ func TestMessagesCountTokens(t *testing.T) {
"--thinking", "{type: adaptive, display: summarized}",
"--tool-choice", "{type: auto, disable_parallel_tool_use: true}",
"--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}",
"--user-profile-id", "anthropic-user-profile-id",
)
})

Expand All @@ -200,6 +201,7 @@ func TestMessagesCountTokens(t *testing.T) {
"--thinking", "{type: adaptive, display: summarized}",
"--tool-choice", "{type: auto, disable_parallel_tool_use: true}",
"--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}",
"--user-profile-id", "anthropic-user-profile-id",
)
})

Expand Down Expand Up @@ -275,6 +277,7 @@ func TestMessagesCountTokens(t *testing.T) {
t, pipeData,
"--api-key", "string",
"messages", "count-tokens",
"--user-profile-id", "anthropic-user-profile-id",
)
})
}
2 changes: 1 addition & 1 deletion pkg/cmd/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

package cmd

const Version = "1.12.2" // x-release-please-version
const Version = "1.12.3" // x-release-please-version
Loading