Skip to main content

Crate xurl

Crate xurl 

Source
Expand description

xurl — fast Rust client for the X (Twitter) API.

Ships two consumable surfaces:

Four authentication paths are supported, selected per request from the token store and environment:

  • OAuth2 PKCE (browser-driven or headless copy-paste) — every v2 user-scoped endpoint.
  • OAuth1 HMAC-SHA1 — legacy v1.1 endpoints and some v2 write paths.
  • Bearer (app-only) — v2 read-only endpoints and search; set via XURL_BEARER_TOKEN.

Modules§

api
X API client — request building, response handling, shortcuts, and media.
auth
Authentication orchestration — OAuth2 PKCE, OAuth1 HMAC-SHA1, Bearer.
cli
CLI definition — clap derive with subcommands.
config
Application configuration resolved from environment variables.
envelope
Canonical agent-native JSON envelope shape.
error
Typed error system matching xurl’s error categories.
output
Output formatting helpers for --output, --quiet, --color, and NO_COLOR support.
skill_install
xr skill install <host> — clone the xurl-rs skill bundle into a host’s canonical skills directory using a build-generated host map and a hardened git clone invocation.
store
Token persistence layer — multi-app YAML store at ~/.xurl.

Constants§

API_SPEC_DATE
Date (UTC, YYYY-MM-DD) the vendored OpenAPI spec was last refreshed by scripts/refresh-x-openapi.sh, read from vendor/spec-metadata.json.
API_SPEC_SHA256
SHA-256 of vendor/x-api-openapi.json at the time of its most recent vendoring, read from vendor/spec-metadata.json. Drift-sensitive identifier — changes every time X changes spec content, regardless of API_SPEC_VERSION.
API_SPEC_VERSION
X API OpenAPI spec version (info.version field) of the vendored vendor/x-api-openapi.json at build time, read from the vendor/spec-metadata.json sidecar. X bumps spec content without bumping this field; pair with API_SPEC_SHA256 when drift detection matters.
CRATE_GIT_SHA
Git commit SHA the crate was built from. None when the build had no git context (e.g., cargo install from a crates.io tarball, where .git is not present).
CRATE_VERSION
Version of this crate, from [package].version in Cargo.toml.