Skip to main content

Cli

Struct Cli 

Source
pub struct Cli {
Show 18 fields pub prompt: Option<String>, pub cwd: Option<PathBuf>, pub harness: Option<Harness>, pub api_schema: Option<String>, pub model: Option<String>, pub settings: Option<String>, pub no_session_persistence: bool, pub continue_session: bool, pub resume: Option<String>, pub max_turns: Option<u32>, pub output_format: OutputFormat, pub restricted: bool, pub dangerously_skip_permissions: bool, pub strip_identity: bool, pub stream: bool, pub no_project_instructions: bool, pub add_dir: Vec<PathBuf>, pub effort: Option<EffortArg>,
}
Expand description

Minimal headless runner for the locode engine: one JSON report on stdout (ADR-0009), diagnostics on stderr, exit code from the run’s status.

Fields§

§prompt: Option<String>

The task prompt. - or omitted reads the prompt from stdin.

§cwd: Option<PathBuf>

Workspace root / working directory (the path-jail root). Defaults to the current directory.

§harness: Option<Harness>

Harness pack selecting the toolset + system prompt. Omitted ⇒ the settings harness default (ADR-0024 §1.4), else claude.

§api_schema: Option<String>

Provider wire schema: anthropic, openai-responses, or mock (keyless CI) — plus any custom providers the binary registered (ADR-0015). Unknown names fail pre-run listing the available set. Omitted ⇒ the settings api_schema default (ADR-0024 §1.4 — the project layers may not set it), else anthropic.

§model: Option<String>

Model id override. Omitted ⇒ the settings model default, else the wire’s built-in default (ADR-0024 §1.4 — same precedence chain as every other knob; there is deliberately no model env var).

§settings: Option<String>

Extra settings layer: a path to a JSON file, or inline JSON (highest- precedence settings layer, ADR-0024 §1.2).

§no_session_persistence: bool

Do not write (or append to) a session trace for this run — nothing lands under ~/.locode/sessions (ADR-0024 §2; Claude Code’s --no-session-persistence). --continue/--resume still read.

§continue_session: bool

Continue the newest session started in this cwd (ADR-0024 §2.5): the recovered transcript seeds the run and the same rollout keeps appending.

§resume: Option<String>

Resume the session with this id — found in this cwd’s sessions first, then anywhere (ADR-0024 §2.5).

§max_turns: Option<u32>

Hard ceiling on sample→dispatch turns. Unlimited when omitted (ADR-0005 amendment — no studied harness caps turns by default).

§output_format: OutputFormat

stdout contract: json = one Report; stream-json = Event JSONL; text = the final message.

§restricted: bool

Restrict file access to the working directory and ask before each tool call. Incomplete — there is no way to record an answer yet, so every call asks again. Off by default.

§dangerously_skip_permissions: bool

Accepted for compatibility and does nothing — this is the default now. Use --restricted to turn the restrictions on.

§strip_identity: bool

Strip harness identity sentences from the rendered system prompt (A/B contamination control; default = faithful reproduction).

§stream: bool

Stream the model turn (SSE) instead of one buffered call (ADR-0021). Needed for unbounded output — Anthropic rejects non-streaming requests that may exceed ~10 min. The stream-json trace stays whole-message: token deltas are assembled but not written to it.

§no_project_instructions: bool

Skip project-instruction loading (AGENTS.md) — the --bare-style disable (ADR-0023). Auto-discovery is otherwise on by default.

§add_dir: Vec<PathBuf>

Add a directory the agent may read and write, beyond the working directory. Repeatable. Its AGENTS.md and .agents/skills are picked up too — the point of pointing at a subtree of a large monorepo.

§effort: Option<EffortArg>

How hard the model should think. Omitted uses the effort setting, then the API’s own default.

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