pub struct Cli {Show 26 fields
pub method: Option<String>,
pub headers: Vec<String>,
pub data: Option<String>,
pub auth_type: Option<String>,
pub username: Option<String>,
pub verbose: bool,
pub trace: bool,
pub stream: bool,
pub file: Option<String>,
pub app: Option<String>,
pub output: OutputFormat,
pub json: bool,
pub jsonl: bool,
pub raw: bool,
pub no_pager: bool,
pub quiet: bool,
pub no_interactive: bool,
pub timeout: u64,
pub color: ColorChoice,
pub dry_run: bool,
pub limit: Option<i32>,
pub cursor: Option<String>,
pub page: Option<String>,
pub after: Option<String>,
pub command: Option<Commands>,
pub url: Option<String>,
}Expand description
Auth-enabled curl-like interface for the X API.
Fields§
§method: Option<String>HTTP method (GET by default)
headers: Vec<String>Request headers
data: Option<String>Request body data
auth_type: Option<String>Authentication type (oauth1, oauth2, app)
username: Option<String>Username for OAuth2 authentication
verbose: boolPrint verbose information
trace: boolAdd trace header to request
stream: boolForce streaming mode
file: Option<String>File to upload (for multipart requests)
app: Option<String>Use a specific registered app (overrides default)
output: OutputFormatOutput format. text (default), json, jsonl, ndjson (alias of jsonl),
yaml (.yml), csv, tsv. Formats not in the value enum (e.g. toml,
xml) are not supported — xurl emits a JSON envelope with reason
invalid-args if requested.
json: boolShorthand for --output json (P2 alias).
jsonl: boolShorthand for --output jsonl (P2 alias).
raw: boolEmit unstyled, compact output. Strips ANSI in text mode; compact (no pretty-printing) JSON in json/jsonl modes.
no_pager: boolDocumented no-op. xr writes directly to stdout and never invokes
$PAGER; this flag is advertised so agents can pass --no-pager
unconditionally without xr rejecting it.
quiet: boolSuppress all non-essential output (errors still go to stderr)
no_interactive: boolDisable interactive prompts; fail with error instead
timeout: u64Request timeout in seconds
color: ColorChoiceColorize output: auto (TTY-aware), always, or never
dry_run: boolValidate inputs and skip the API call (U7).
Honored by every write op; emits a canonical dry-run envelope on
stdout under --output json / --output jsonl, or a “Would …” line
under --output text. Read ops ignore it.
limit: Option<i32>Global result-set limit, clamped to 1..=100 (U7).
Applies to every list-style command. The per-command -n/--max-results
flag takes precedence when both are set.
cursor: Option<String>Pagination cursor / pagination_token for list endpoints.
The X API uses cursor-based pagination: each list response carries a
meta.next_token field, and the next page is fetched by re-running
the same command with --cursor <token> (or XURL_CURSOR=<token>).
Threads through to the pagination_token query parameter on every
search, timeline, mentions, bookmarks, likes, following,
followers, and dms invocation.
page: Option<String>Documented alias for --cursor.
X’s API does not offer offset-style pagination (--page 2 is not
addressable). Passing --page returns a canonical
unsupported-pagination envelope on stderr suggesting --cursor
instead. Exposed so agents trained on offset-pagination conventions
get a structured error rather than a silent no-op.
after: Option<String>Documented alias for --cursor (--after <token>).
Threads through to the same pagination_token query parameter as
--cursor. Exposed so agents that picked up “after-style” pagination
from other CLIs (gh, kubectl) get a working flag.
command: Option<Commands>Subcommand to run
url: Option<String>URL for raw mode (positional, only when no subcommand)
Implementations§
Source§impl Cli
impl Cli
Sourcepub fn effective_output(&self) -> OutputFormat
pub fn effective_output(&self) -> OutputFormat
Resolves the effective output format after applying --json /
--jsonl aliases.
--jsonl wins over --json if both were set (they conflict via
clap, so at most one survives parsing); either alias overrides
--output.
Trait Implementations§
Source§impl Args for Cli
impl Args for Cli
Source§fn augment_args<'b>(__clap_app: Command) -> Command
fn augment_args<'b>(__clap_app: Command) -> Command
Source§fn augment_args_for_update<'b>(__clap_app: Command) -> Command
fn augment_args_for_update<'b>(__clap_app: Command) -> Command
Command so it can instantiate self via
FromArgMatches::update_from_arg_matches_mut Read moreSource§impl CommandFactory for Cli
impl CommandFactory for Cli
Source§impl FromArgMatches for Cli
impl FromArgMatches for Cli
Source§fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>
fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>
Source§fn from_arg_matches_mut(
__clap_arg_matches: &mut ArgMatches,
) -> Result<Self, Error>
fn from_arg_matches_mut( __clap_arg_matches: &mut ArgMatches, ) -> Result<Self, Error>
Source§fn update_from_arg_matches(
&mut self,
__clap_arg_matches: &ArgMatches,
) -> Result<(), Error>
fn update_from_arg_matches( &mut self, __clap_arg_matches: &ArgMatches, ) -> Result<(), Error>
ArgMatches to self.Source§fn update_from_arg_matches_mut(
&mut self,
__clap_arg_matches: &mut ArgMatches,
) -> Result<(), Error>
fn update_from_arg_matches_mut( &mut self, __clap_arg_matches: &mut ArgMatches, ) -> Result<(), Error>
ArgMatches to self.