Skip to main content

Args

Struct Args 

Source
pub struct Args {
Show 48 fields pub provider: Option<String>, pub model: Option<String>, pub api_key: Option<String>, pub base_url: Option<String>, pub system_prompt: Option<String>, pub append_system_prompt: Vec<String>, pub theme: Option<String>, pub thinking: Option<ThinkingLevel>, pub print: bool, pub mode: Mode, pub tui_mode: TuiMode, pub list_models: Option<String>, pub offline: bool, pub export: Option<PathBuf>, pub trust_override: Option<bool>, pub continue_session: bool, pub resume: bool, pub session: Option<String>, pub session_id: Option<String>, pub fork: Option<String>, pub models: Option<Vec<String>>, pub session_dir: Option<PathBuf>, pub no_session: bool, pub name: Option<String>, pub tools: Option<Vec<String>>, pub exclude_tools: Option<Vec<String>>, pub no_tools: bool, pub no_builtin_tools: bool, pub no_skills: bool, pub no_prompt_templates: bool, pub no_context_files: bool, pub no_extensions: bool, pub enable_pi_packages: bool, pub no_themes: bool, pub extensions_dir: Vec<PathBuf>, pub extension: Vec<PathBuf>, pub skill: Vec<PathBuf>, pub prompt_template: Vec<PathBuf>, pub dev_local_only: bool, pub verbose: bool, pub help: bool, pub version: bool, pub debug_system_prompt: bool, pub messages: Vec<String>, pub file_args: Vec<PathBuf>, pub unknown_flags: BTreeMap<String, Value>, pub ignored: Vec<String>, pub errors: Vec<String>,
}
Expand description

The parsed argument set. Mirrors TS Args. Unknown long flags are retained for extension consumption; unknown short flags remain hard errors.

Fields§

§provider: Option<String>§model: Option<String>§api_key: Option<String>§base_url: Option<String>

--base-url — overrides ANTHROPIC_BASE_URL + each model’s base URL, for third-party Anthropic-compatible gateways/proxies.

§system_prompt: Option<String>§append_system_prompt: Vec<String>§theme: Option<String>

--theme — built-in theme name or a static package theme name/path.

§thinking: Option<ThinkingLevel>§print: bool§mode: Mode§tui_mode: TuiMode

--tui-mode regular|fullscreen controls the interactive terminal buffer. The default remains fullscreen for compatibility with rpi.

§list_models: Option<String>

--list-models [search]: list the merged model catalog and exit. Some("") represents the bare flag; None means absent.

§offline: bool

--offline: disable best-effort startup network checks.

§export: Option<PathBuf>

--export <session-file>: export a JSONL session to HTML (or copy it when the destination ends in .jsonl).

§trust_override: Option<bool>

Explicit project trust override. --approve trusts the current project; --no-approve keeps project-local resources disabled.

§continue_session: bool§resume: bool§session: Option<String>§session_id: Option<String>

--session-id <id>: use the EXACT project session id, creating it if missing (pi --session-id). Unlike --session (partial match), this is an exact-id open-or-create.

§fork: Option<String>

--fork <path|id>: fork the given session into a new one and start in the fork (pi --fork).

§models: Option<Vec<String>>

--models <patterns>: comma-separated model patterns for the Ctrl+M cycle (globs/fuzzy in pi; v1 writes the matched ids to settings.json’s scopedModels — the same set /scoped-models edits). Empty = all models.

§session_dir: Option<PathBuf>§no_session: bool§name: Option<String>§tools: Option<Vec<String>>§exclude_tools: Option<Vec<String>>§no_tools: bool§no_builtin_tools: bool§no_skills: bool

--no-skills/-ns: skip skill discovery + the <available_skills> system-prompt listing.

§no_prompt_templates: bool

--no-prompt-templates/-np: skip prompt-template discovery (templates are on-demand only; this suppresses populating the resource registry).

§no_context_files: bool

--no-context-files/-nc: skip context-file (AGENTS.md/CLAUDE.md) discovery + the <project_context> system-prompt block.

§no_extensions: bool

--no-extensions/-ne: skip Rust cdylib extension loading and act as a final kill switch for Pi JS/TS packages when enabled. Honored by session.rs (Part B2): when set, no extension directory is scanned and no plugin tools/handlers are registered.

§enable_pi_packages: bool

--enable-pi-packages: opt into discovery and loading of configured Pi JavaScript/TypeScript packages. This is intentionally opt-in because loading a package may start a Node runtime and execute package code.

§no_themes: bool

--no-themes: disable package/custom theme discovery and loading. Built-in presets remain available unless a custom --theme is given.

§extensions_dir: Vec<PathBuf>

--extensions-dir/-ed: an extra directory to scan for cdylib plugins (.dll/.so/.dylib), in addition to project .rpi/extensions (with legacy .pi/extensions compatibility) and global agent_dir()/extensions defaults. May be repeated; scanned after the defaults (so a same-named tool in a default dir wins first, mirroring pi’s registration order). RPI_EXTENSIONS_DIR (colon-separated on Unix, semicolon on Windows) provides the same list via env.

§extension: Vec<PathBuf>

--extension/-e <path>: load an explicit extension cdylib file (may be repeated). Loaded in addition to the discovered dirs.

§skill: Vec<PathBuf>

--skill <path>: load an explicit skill file or directory (repeated).

§prompt_template: Vec<PathBuf>

--prompt-template <path>: load an explicit prompt-template file or directory (repeated).

§dev_local_only: bool

Internal scope set by rpi dev-local / rpi dev --local-only. Only the freshly staged development extension and resources it discovers are loaded; normal project/global/package discovery is skipped. This is intentionally not parsed by the regular CLI parser.

§verbose: bool§help: bool§version: bool§debug_system_prompt: bool

--debug-system-prompt: print the resolved system-prompt sections (base, append, context, skills listing) + resource counts to stderr at harness build time, then proceed normally. A verification affordance for resource-discovery (Part A) — lets a smoke confirm <available_skills> + <project_context> + appended text reached the prompt without a full round-trip parse. Mirrors the plan’s “add –debug-system-prompt if absent”.

§messages: Vec<String>

Positional prompt text (one or more messages). Mirrors TS messages.

§file_args: Vec<PathBuf>

@file attachments (prefix stripped), as raw paths for the caller to expand. Mirrors TS fileArgs.

§unknown_flags: BTreeMap<String, Value>

Extension-declared or otherwise unknown long flags. Values are either JSON booleans (a bare flag) or strings (a flag with a value), matching Pi’s unknownFlags contract so an extension can claim its own options.

§ignored: Vec<String>

Warnings about recognized-but-ignored flags (v1 scope cuts). Surfaced to the user on startup when --verbose.

§errors: Vec<String>

Hard parse errors (unknown short flags, missing values). Non-empty ⇒ main prints them + help and exits non-zero.

Trait Implementations§

Source§

impl Clone for Args

Source§

fn clone(&self) -> Args

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 Args

Source§

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

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

impl Default for Args

Source§

fn default() -> Args

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl Freeze for Args

§

impl RefUnwindSafe for Args

§

impl Send for Args

§

impl Sync for Args

§

impl Unpin for Args

§

impl UnsafeUnpin for Args

§

impl UnwindSafe for Args

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> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

Source§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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> MaybeSendSync for T

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> 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