Skip to main content

Cli

Struct Cli 

Source
pub struct Cli {
Show 19 fields pub config: Option<String>, pub agent_card: Option<String>, pub endpoint: Option<String>, pub base_url: String, pub transport: Vec<Binding>, pub a2a_version: Option<String>, pub bearer: Option<String>, pub api_key: Option<String>, pub svc_params: Vec<HeaderArg>, pub insecure: bool, pub debug: bool, pub tenant: Option<String>, pub output: OutputFormat, pub compact: bool, pub async_mode: bool, pub wait: bool, pub poll_interval: Duration, pub timeout: Duration, pub command: Command,
}

Fields§

§config: Option<String>

Load configuration from an explicit .env file in place of the local .env (found by walking up from the working directory). Real environment variables still take precedence over it (§6.5).

§agent_card: Option<String>

The agent to talk to, as an Agent Card reference (§7.2): a bare host or origin (the well-known path is appended), a full card URL (used as-is), or a local file path (file://… or a plain path).

§endpoint: Option<String>

Connect straight to an agent interface URL, skipping Agent Card resolution (§7.2). MUST be used with exactly one –transport, since there is no card to name the binding. Mutually exclusive with –agent-card.

§base_url: String

Deprecated alias for the bare-origin form of –agent-card, kept so pre-#178 invocations keep working. Hidden: --agent-card is the flag the specification defines.

§transport: Vec<Binding>

Client transport preference, repeatable and ordered (highest first): e.g. --transport jsonrpc --transport rest. Overrides the agent card’s own preference order; a binding the card doesn’t offer is skipped.

§a2a_version: Option<String>

Bearer token attached to the agent-card fetch and client calls. Protocol version to signal to the server on every request (§13.2). Absent this flag the version is negotiated down to the highest one both a2acli and the agent’s selected interface declare. Must be 1.x: A2A reads an empty or pre-1.0 value as 0.3.

§bearer: Option<String>§api_key: Option<String>

API key attached to the agent-card fetch and client calls (as an X-API-Key header — a2acli does not yet read the agent card’s declared security scheme to place it elsewhere per A2A §4.5.2).

§svc_params: Vec<HeaderArg>

Add an A2A service parameter (a transport-level key-value pair, e.g. a header or gRPC metadata) — general-purpose, not authentication- specific. Distinct from --metadata, which travels in the request payload.

§insecure: bool

Disable TLS certificate verification for the negotiated transport. Development only — always prints a warning, and never disables verification silently.

§debug: bool

Verbose diagnostics to stderr: the outcome of each call plus the raw protocol messages exchanged on the wire — request and response bodies, and each streamed event (§7.2). Never includes credential material (bearer token, API key, or any –svc-param value): header names stay visible so their attachment can be confirmed, but values are replaced, and that redaction cannot be defeated by this or any other verbosity flag.

§tenant: Option<String>

Optional tenant forwarded to A2A requests that support it. Overrides the routing tenant the selected Agent Card interface may itself declare (A2A §8.3.2); omit this to use the interface’s own value, if it has one.

§output: OutputFormat

Output format: human-readable text (default) or the protocol’s own json types. Cardinality (one document vs. JSONL) follows --stream, not this flag (§11.3).

§compact: bool

With -o json (and no --stream), emit compact JSON instead of pretty-printed JSON. Has no effect on -o text or on --stream JSONL, which is always one compact object per line regardless of this flag (§11.3).

§async_mode: bool

Do not wait: return the task identifiers immediately instead of blocking until the task reaches a terminal or interrupted state (the default).

Note: the spec lists --return-immediately as an OPTIONAL alias for this flag, but that name is already this CLI’s flag for the distinct protocol-level SendMessageConfiguration.return_immediately (a request to the agent to return early on queued work, not a client-side “don’t poll” instruction) — so it is deliberately not reused here to avoid conflating the two.

§wait: bool

Explicitly block until the task reaches a terminal or interrupted state. This is already the default for send; on task get it turns the one-shot read into a poll loop.

§poll_interval: Duration

Delay between polls while waiting for a task to settle (e.g. “2s”, “500ms”).

§timeout: Duration

Overall time budget for a blocking wait before reporting a timeout (e.g. “30s”, “2m”).

§command: Command

Trait Implementations§

Source§

impl Args for Cli

Source§

fn group_id() -> Option<Id>

Report the ArgGroup::id for this set of arguments
Source§

fn augment_args<'b>(__clap_app: Command) -> Command

Append to Command so it can instantiate Self via FromArgMatches::from_arg_matches_mut Read more
Source§

fn augment_args_for_update<'b>(__clap_app: Command) -> Command

Append to Command so it can instantiate self via FromArgMatches::update_from_arg_matches_mut Read more
Source§

impl Clone for Cli

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl CommandFactory for Cli

Source§

fn command<'b>() -> Command

Build a Command that can instantiate Self. Read more
Source§

fn command_for_update<'b>() -> Command

Build a Command that can update self. Read more
Source§

impl Debug for Cli

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for Cli

Source§

impl FromArgMatches for Cli

Source§

fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>

Instantiate Self from ArgMatches, parsing the arguments as needed. Read more
Source§

fn from_arg_matches_mut( __clap_arg_matches: &mut ArgMatches, ) -> Result<Self, Error>

Instantiate Self from ArgMatches, parsing the arguments as needed. Read more
Source§

fn update_from_arg_matches( &mut self, __clap_arg_matches: &ArgMatches, ) -> Result<(), Error>

Assign values from ArgMatches to self.
Source§

fn update_from_arg_matches_mut( &mut self, __clap_arg_matches: &mut ArgMatches, ) -> Result<(), Error>

Assign values from ArgMatches to self.
Source§

impl Parser for Cli

Source§

fn parse() -> Self

Parse from std::env::args_os(), exit on error.
Source§

fn try_parse() -> Result<Self, Error>

Parse from std::env::args_os(), return Err on error.
Source§

fn parse_from<I, T>(itr: I) -> Self
where I: IntoIterator<Item = T>, T: Into<OsString> + Clone,

Parse from iterator, exit on error.
Source§

fn try_parse_from<I, T>(itr: I) -> Result<Self, Error>
where I: IntoIterator<Item = T>, T: Into<OsString> + Clone,

Parse from iterator, return Err on error.
Source§

fn update_from<I, T>(&mut self, itr: I)
where I: IntoIterator<Item = T>, T: Into<OsString> + Clone,

Update from iterator, exit on error. Read more
Source§

fn try_update_from<I, T>(&mut self, itr: I) -> Result<(), Error>
where I: IntoIterator<Item = T>, T: Into<OsString> + Clone,

Update from iterator, return Err on error.
Source§

impl PartialEq for Cli

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for Cli

Auto Trait Implementations§

§

impl Freeze for Cli

§

impl RefUnwindSafe for Cli

§

impl Send for Cli

§

impl Sync for Cli

§

impl Unpin for Cli

§

impl UnsafeUnpin for Cli

§

impl UnwindSafe for Cli

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> FromRef<T> for T
where T: Clone,

Source§

fn from_ref(input: &T) -> T

Converts to this type from a reference to the input type.
Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoRequest<T> for T

Source§

fn into_request(self) -> Request<T>

Wrap the input message T in a tonic::Request
Source§

impl<L> LayerExt<L> for L

Source§

fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>
where L: Layer<S>,

Applies the layer to a service and wraps it in Layered.
Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more