diff --git a/.release-please-manifest.json b/.release-please-manifest.json index a80c237..1ed7be9 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "1.12.2" + ".": "1.12.3" } \ No newline at end of file diff --git a/.stats.yml b/.stats.yml index e7f771c..6313bf9 100644 --- a/.stats.yml +++ b/.stats.yml @@ -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 diff --git a/CHANGELOG.md b/CHANGELOG.md index c3037b4..0ce1f51 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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) diff --git a/pkg/cmd/betadeployment_test.go b/pkg/cmd/betadeployment_test.go index 678c90a..029c005 100644 --- a/pkg/cmd/betadeployment_test.go +++ b/pkg/cmd/betadeployment_test.go @@ -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", ) @@ -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", @@ -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") @@ -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", ) }) @@ -104,7 +104,7 @@ 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", @@ -112,7 +112,7 @@ func TestBetaDeploymentsUpdate(t *testing.T) { "--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", ) @@ -127,7 +127,7 @@ 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", @@ -135,8 +135,8 @@ func TestBetaDeploymentsUpdate(t *testing.T) { "--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", @@ -162,8 +162,8 @@ 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") @@ -171,7 +171,7 @@ func TestBetaDeploymentsUpdate(t *testing.T) { t, pipeData, "--api-key", "string", "beta:deployments", "update", - "--deployment-id", "deployment_id", + "--deployment-id", "depl_011CZkZcDH3vPqd7xnEfwTai", "--beta", "message-batches-2024-09-24", ) }) @@ -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", ) }) @@ -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", ) }) @@ -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", ) }) @@ -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", ) }) diff --git a/pkg/cmd/betamessage.go b/pkg/cmd/betamessage.go index e0c59eb..ed43c84 100644 --- a/pkg/cmd/betamessage.go +++ b/pkg/cmd/betamessage.go @@ -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, diff --git a/pkg/cmd/betamessage_test.go b/pkg/cmd/betamessage_test.go index b53388d..a199bd2 100644 --- a/pkg/cmd/betamessage_test.go +++ b/pkg/cmd/betamessage_test.go @@ -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", ) }) @@ -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", ) }) @@ -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", ) }) } diff --git a/pkg/cmd/message.go b/pkg/cmd/message.go index 4cf999f..e728562 100644 --- a/pkg/cmd/message.go +++ b/pkg/cmd/message.go @@ -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, diff --git a/pkg/cmd/message_test.go b/pkg/cmd/message_test.go index 1969a23..1ad3b4d 100644 --- a/pkg/cmd/message_test.go +++ b/pkg/cmd/message_test.go @@ -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", ) }) @@ -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", ) }) @@ -275,6 +277,7 @@ func TestMessagesCountTokens(t *testing.T) { t, pipeData, "--api-key", "string", "messages", "count-tokens", + "--user-profile-id", "anthropic-user-profile-id", ) }) } diff --git a/pkg/cmd/version.go b/pkg/cmd/version.go index e8d823c..28c1f15 100644 --- a/pkg/cmd/version.go +++ b/pkg/cmd/version.go @@ -2,4 +2,4 @@ package cmd -const Version = "1.12.2" // x-release-please-version +const Version = "1.12.3" // x-release-please-version