Skip to content

Set custom user agent with version for Cloud API calls#23

Merged
sdairs merged 3 commits intomainfrom
issue-22-custom-user-agent
Mar 11, 2026
Merged

Set custom user agent with version for Cloud API calls#23
sdairs merged 3 commits intomainfrom
issue-22-custom-user-agent

Conversation

@sdairs
Copy link
Copy Markdown
Collaborator

@sdairs sdairs commented Mar 11, 2026

Summary

  • Updates the Cloud API client user agent from static clickhousectl-cli to clickhousectl/{version} (e.g. clickhousectl/0.1.11)
  • Uses env!("CARGO_PKG_VERSION") so the version stays in sync with Cargo.toml automatically

Closes #22

Test plan

  • cargo build passes
  • cargo test passes (12/12)

🤖 Generated with Claude Code

sdairs and others added 3 commits March 11, 2026 18:20
Uses CARGO_PKG_VERSION to include the crate version in the user agent
string, making it easy to identify which CLI version made an API call.

Closes #22

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Moves the user agent string construction into a standalone function
so it can be unit tested. Test verifies the format is
clickhousectl/{version} with a valid version string.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@sdairs sdairs merged commit d99edc6 into main Mar 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Use a descriptive user agent to identify the CLI in ClickHouse Cloud API calls

1 participant