xurl-rs
A fast, ergonomic CLI for the X (Twitter) API. OAuth1, OAuth2 PKCE, Bearer auth. Media upload. Streaming. Agent-native.
Rust port of xurl — faster, type-safe, with shell completions and machine-readable output.
Install
Homebrew
Pre-built Binary
Download from GitHub Releases for Linux, macOS, and Windows.
Cargo
From Source
# Binary at ./target/release/xr
Quick Start
# Set up OAuth2 (browser-based, 30 seconds)
# Post
# Read
# Search
# Check your profile
Commands
Posting
Reading
Engagement
Social Graph
Direct Messages
Raw API Access
Media Upload
Authentication
OAuth2 (Recommended)
OAuth1
Bearer Token (App-Only)
Multi-App Management
Agent-Native Features
Built for AI agents and automation:
Machine-Readable Output
# Default to JSON
Quiet Mode
Non-Interactive Mode
# Exit code 2 if auth needed: "authentication required: run xr auth login"
Structured Exit Codes
| Code | Meaning | Agent Action |
|---|---|---|
| 0 | Success | Continue |
| 1 | General error | Log and handle |
| 2 | Auth required | Run xr auth oauth2 |
| 3 | Rate limited | Retry with backoff |
| 4 | Not found | Resource doesn't exist |
| 5 | Network error | Check connectivity |
NO_COLOR Support
NO_COLOR=1
Shell Completions
# Bash
# Zsh
# Fish
# PowerShell
# Elvish
Pre-generated scripts are also available in completions/.
vs Go Original
| Feature | Go xurl | xurl-rs |
|---|---|---|
| Language | Go | Rust |
| Memory safety | GC | Compile-time |
| Binary size | ~15 MB | ~8 MB |
| Shell completions | Built-in (cobra) | Built-in (clap_complete) |
--output json |
❌ | ✅ |
--quiet |
❌ | ✅ |
--no-interactive |
❌ | ✅ |
| Structured exit codes | ❌ | ✅ |
NO_COLOR support |
❌ | ✅ |
XURL_OUTPUT env var |
❌ | ✅ |
Contributing
See RELEASING.md for release procedures.
License
Licensed under either of Apache License, Version 2.0 or MIT license at your option.