Skip to main content

WithArgs

Struct WithArgs 

Source
pub struct WithArgs {
Show 22 fields pub global: bool, pub undo: bool, pub non_interactive: bool, pub interactive: bool, pub extend_global_config: bool, pub isolated_config: bool, pub reset_to_default_configuration: bool, pub yes: bool, pub managed: bool, pub server: Option<String>, pub management_server: Option<String>, pub local: bool, pub token: Option<String>, pub token_stdin: bool, pub model: Option<String>, pub pick_model: bool, pub label: Option<String>, pub run_ttl_hours: i64, pub fixed_run_ttl: bool, pub run_max_requests: Option<u64>, pub client: ClientKind, pub client_args: Vec<OsString>,
}
Expand description

Options shared by router with and the standalone with-router binary.

Fields§

§global: bool

Permanently configure the client instead of launching it temporarily.

§undo: bool

Restore the exact configuration saved by a previous --global call.

§non_interactive: bool

Force the client’s non-interactive/one-shot mode.

By default a bare positional is read as a prompt and starts a one-shot run, a flag is read as an option passed to a session, and streams that are not a terminal are one-shot. Reading any forwarded argument as a task turned --resume, --continue and --verbose into batch runs (issue #297).

§interactive: bool

Force the client’s interactive mode.

§extend_global_config: bool

Extend the client’s normal user configuration for this launch.

Claude uses a dedicated persistent Router-owned profile by default. This explicitly restores the older process-overlay behavior, without writing the user’s Claude files. Other extensible clients already use their normal configuration and accept this for compatibility (#536).

§isolated_config: bool

Give the client a configuration directory of its own.

Claude uses a persistent profile owned by Router by default, so onboarding happens once and Router sessions remain resumable without inheriting the user’s theme, permissions, MCP servers, credentials, or model cache. Other clients retain their existing profile behavior.

--extend-global-config explicitly layers Claude routing onto the real profile instead. Nothing the user owns is written or modified.

Isolation remains right for CI and clean-room reproductions, where passing a flag is normal and cheap.

It is a no-op for codex, gemini, opencode and agent: those are routed through a file the router writes, so they never use the user’s own directory with or without it. The run says so rather than accepting the flag silently (issue #312). What they get instead is a profile of their own that persists between runs, so sessions stay resumable (issue #298); --isolated-config makes that profile disposable.

§reset_to_default_configuration: bool

Replace only the persistent Router-owned Claude profile before launch.

§yes: bool

Confirm a requested profile reset without an interactive prompt.

§managed: bool

Start a disposable managed container even if a router is already listening locally.

The default reuses a running local router (issue #250); CI and clean-room reproductions want a fresh instance on purpose.

§server: Option<String>

Router origin. No local server is started when this is supplied.

§management_server: Option<String>

Private management origin when it differs from --server.

§local: bool

Use the router running on this machine, not the selected one.

with had --server and --managed but not --local, so it carried half the target vocabulary every other family has (issue #314).

§token: Option<String>

Router token. Prefer the environment or --token-stdin to shell history.

§token_stdin: bool

Read the router token as one line from standard input.

§model: Option<String>

Model the client is launched with.

Without this the client keeps the model its own configuration selects, and with changes only how that model is reached — the same rule --global follows. A router that picked one by catalog order replaced the user’s choice silently, and the client’s status line then presented the substitution as though the user had made it (issue #295).

A client whose configuration embeds the router’s catalog — opencode, qwen, agent — is always given an id, because it cannot start without one.

§pick_model: bool

Let the router choose a model from the target’s live catalog.

It reports what it picked and why. Without this no model is named and the client’s own configuration decides.

§label: Option<String>

Label recorded on the router for this run’s token.

Each run mints a token on the target and the label is stored there. It defaults to the client name and a short suffix; it used to be the name of the directory the run was launched from, so a deployment accumulated a list of the projects its users work in (issue #316). Anything sent to a router someone else operates should be something you chose to send.

§run_ttl_hours: i64

Lifetime of an automatically minted per-run token, in hours.

--ttl-hours is accepted too, so the name matches tokens issue, tokens rotate and configure (issue #314).

Defaults to a day because this token is revoked when the client exits: the run already bounds its life, and the clock was a second bound that could only fire early. At one hour it routinely did — an interactive session that outlived the hour died mid-work with 401 Token has expired, and the client answered with its own /login advice about an unrelated credential (issue #341).

§fixed_run_ttl: bool

Keep a fixed expiry instead of extending it while the run is in use.

By default the per-run token’s expiry slides: every request served with it pushes the expiry to now + --run-ttl-hours, so a session that is still being used never hits the wall, and one abandoned for longer than the window still expires. That is what the bound is for – the run’s own life already bounds the token, since it is revoked when the client exits, and a fixed clock could only ever fire early (issue #354).

Pass this to keep the old behaviour: the expiry set at issue time is final, whatever the session is doing.

§run_max_requests: Option<u64>

Optional request budget for an automatically minted per-run token.

§client: ClientKind

Client integration to launch or configure.

§client_args: Vec<OsString>

Arguments forwarded to the client. Use -- to make the boundary explicit.

Implementations§

Source§

impl WithArgs

Source

pub fn as_configure(&self) -> ConfigureArgs

The permanent-setup request --global / --undo really is.

with --global predates configure and stays as an accepted spelling, so it maps onto the same arguments rather than keeping a second implementation that can disagree with it (issue #296).

Trait Implementations§

Source§

impl Args for WithArgs

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 WithArgs

Source§

fn clone(&self) -> WithArgs

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 Debug for WithArgs

Source§

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

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

impl FromArgMatches for WithArgs

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.

Auto Trait Implementations§

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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

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<T> Downcast for T
where T: Any,

Source§

fn into_any(self: Box<T>) -> Box<dyn Any>

Convert Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.
Source§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

Convert Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be further downcast into Rc<ConcreteType> where ConcreteType implements Trait.
Source§

fn as_any(&self) -> &(dyn Any + 'static)

Convert &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &Any’s vtable from &Trait’s.
Source§

fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)

Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s.
Source§

impl<T> DowncastSync for T
where T: Any + Send + Sync,

Source§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Send + Sync>

Convert Arc<Trait> (where Trait: Downcast) to Arc<Any>. Arc<Any> can then be further downcast into Arc<ConcreteType> where ConcreteType implements Trait.
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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
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> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
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<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

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