Skip to main content

Cli

Struct Cli 

Source
pub struct Cli {
Show 38 fields pub version: bool, pub provider: Option<String>, pub model: Option<String>, pub api_key: Option<String>, pub models: Option<String>, pub thinking: Option<String>, pub system_prompt: Option<String>, pub append_system_prompt: Option<String>, pub continue: bool, pub resume: bool, pub session: Option<String>, pub session_dir: Option<String>, pub no_session: bool, pub session_durability: Option<String>, pub no_migrations: bool, pub mode: Option<String>, pub print: bool, pub verbose: bool, pub no_tools: bool, pub tools: String, pub extension: Vec<String>, pub no_extensions: bool, pub extension_policy: Option<String>, pub explain_extension_policy: bool, pub repair_policy: Option<String>, pub explain_repair_policy: bool, pub skill: Vec<String>, pub no_skills: bool, pub prompt_template: Vec<String>, pub no_prompt_templates: bool, pub theme: Option<String>, pub theme_path: Vec<String>, pub no_themes: bool, pub export: Option<String>, pub list_models: Option<Option<String>>, pub list_providers: bool, pub command: Option<Commands>, pub args: Vec<String>,
}
Expand description

Pi - AI coding agent CLI

Fields§

§version: bool

Print version information

§provider: Option<String>

LLM provider (e.g., anthropic, openai, google)

§model: Option<String>

Model ID (e.g., claude-opus-4, gpt-4o)

§api_key: Option<String>

API key (overrides environment variable)

§models: Option<String>

Model patterns for Ctrl+P cycling (comma-separated, supports globs)

§thinking: Option<String>

Extended thinking level

§system_prompt: Option<String>

Override system prompt

§append_system_prompt: Option<String>

Append to system prompt (text or file path)

§continue: bool

Continue previous session

§resume: bool

Select session from picker UI

§session: Option<String>

Use specific session file path

§session_dir: Option<String>

Directory for session storage/lookup

§no_session: bool

Don’t save session (ephemeral)

§session_durability: Option<String>

Session durability mode: strict, balanced, or throughput

§no_migrations: bool

Skip startup migrations for legacy config/session/layout paths

§mode: Option<String>

Output mode for print mode (text, json, rpc)

§print: bool

Non-interactive mode (process & exit)

§verbose: bool

Force verbose startup

§no_tools: bool

Disable all built-in tools

§tools: String

Specific tools to enable (comma-separated: read,bash,edit,write,grep,find,ls)

§extension: Vec<String>

Load extension file (can use multiple times)

§no_extensions: bool

Disable extension discovery

§extension_policy: Option<String>

Extension capability policy: safe, balanced, or permissive (legacy alias: standard)

§explain_extension_policy: bool

Print the resolved extension policy with per-capability decisions and exit

§repair_policy: Option<String>

Repair policy mode: off, suggest, auto-safe, or auto-strict

§explain_repair_policy: bool

Print the resolved repair policy and exit

§skill: Vec<String>

Load skill file/directory (can use multiple times)

§no_skills: bool

Disable skill discovery

§prompt_template: Vec<String>

Load prompt template file/directory (can use multiple times)

§no_prompt_templates: bool

Disable prompt template discovery

§theme: Option<String>

Select active theme (built-in name, discovered theme name, or theme JSON path)

§theme_path: Vec<String>

Add theme file/directory to discovery (can use multiple times)

§no_themes: bool

Disable theme discovery

§export: Option<String>

Export session file to HTML

§list_models: Option<Option<String>>

List available models (optional fuzzy search pattern)

§list_providers: bool

List all supported providers with aliases and auth env keys

§command: Option<Commands>§args: Vec<String>

Messages and @file references

Implementations§

Source§

impl Cli

Source

pub fn file_args(&self) -> Vec<&str>

Get file arguments (prefixed with @)

Source

pub fn message_args(&self) -> Vec<&str>

Get message arguments (not prefixed with @)

Source

pub fn enabled_tools(&self) -> Vec<&str>

Get enabled tools as a list

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

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<'a, T, E> AsTaggedExplicit<'a, E> for T
where T: 'a,

Source§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

Source§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where T: 'a,

Source§

fn implicit( self, class: Class, constructed: bool, tag: u32, ) -> TaggedParser<'a, Implicit, Self, E>

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> 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: NoopSpan) -> Self

Instruments this future with a span (no-op when disabled).
Source§

fn in_current_span(self) -> Self

Instruments this future with the current span (no-op when disabled).
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> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

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

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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

impl<T> ParallelSend for T

Source§

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

Source§

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