pub struct Cli {
pub ai_backend: Option<AiBackend>,
pub claude_cli_allow_tools: bool,
pub claude_cli_allow_mcp: bool,
pub claude_cli_max_budget_usd: Option<f64>,
pub models_yaml: Option<PathBuf>,
pub command: Commands,
}Expand description
Top-level clap-derived CLI struct; the library entry point for embedding omni-dev programmatically.
Global flags (--ai-backend, --claude-cli-allow-tools,
--claude-cli-allow-mcp, --claude-cli-max-budget-usd, --models-yaml)
are propagated to environment variables read by downstream factories
before dispatching to a Commands variant.
Fields§
§ai_backend: Option<AiBackend>Selects the AI backend used by commands that invoke an AI model.
Overrides the OMNI_DEV_AI_BACKEND environment variable.
claude_cli_allow_tools: boolWeakens the claude-cli sandbox by allowing the nested claude -p
session to use its default built-in tools (Read, Edit, Write, Bash,
Glob, Grep).
Only use for deliberately tool-capable use cases. By default the
nested session runs with --tools "" and cannot touch the
file system. This flag removes that guard. Equivalent to setting
OMNI_DEV_CLAUDE_CLI_ALLOW_TOOLS=true. Independent of
--claude-cli-allow-mcp.
Ignored when --ai-backend is not claude-cli.
claude_cli_allow_mcp: boolWeakens the claude-cli sandbox by allowing the nested claude -p
session to load MCP servers from ~/.claude/settings.json.
Only use deliberately. MCP servers commonly hold OAuth tokens
(Gmail, Drive, Slack) and may be arbitrary network-attached services;
enabling this exposes them to the nested session. By default the
session runs with --strict-mcp-config and no MCP servers load.
Equivalent to setting OMNI_DEV_CLAUDE_CLI_ALLOW_MCP=true.
Independent of --claude-cli-allow-tools.
Ignored when --ai-backend is not claude-cli.
claude_cli_max_budget_usd: Option<f64>Per-invocation spending cap in USD for the claude-cli backend.
Forwarded to claude -p --max-budget-usd. When the nested session
exceeds this budget it aborts rather than running away with cost.
Equivalent to setting OMNI_DEV_CLAUDE_CLI_MAX_BUDGET_USD.
Ignored when --ai-backend is not claude-cli.
models_yaml: Option<PathBuf>Path to a single user-side models.yaml that short-circuits the
standard ./.omni-dev/models.yaml and ~/.omni-dev/models.yaml
lookup. The file is still merged over the embedded catalog.
Equivalent to setting OMNI_DEV_MODELS_YAML.
command: CommandsThe main command to execute.
Implementations§
Trait Implementations§
Source§impl Args for Cli
impl Args for Cli
Source§fn augment_args<'b>(__clap_app: Command) -> Command
fn augment_args<'b>(__clap_app: Command) -> Command
Source§fn augment_args_for_update<'b>(__clap_app: Command) -> Command
fn augment_args_for_update<'b>(__clap_app: Command) -> Command
Command so it can instantiate self via
FromArgMatches::update_from_arg_matches_mut Read moreSource§impl CommandFactory for Cli
impl CommandFactory for Cli
Source§impl FromArgMatches for Cli
impl FromArgMatches for Cli
Source§fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>
fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>
Source§fn from_arg_matches_mut(
__clap_arg_matches: &mut ArgMatches,
) -> Result<Self, Error>
fn from_arg_matches_mut( __clap_arg_matches: &mut ArgMatches, ) -> Result<Self, Error>
Source§fn update_from_arg_matches(
&mut self,
__clap_arg_matches: &ArgMatches,
) -> Result<(), Error>
fn update_from_arg_matches( &mut self, __clap_arg_matches: &ArgMatches, ) -> Result<(), Error>
ArgMatches to self.Source§fn update_from_arg_matches_mut(
&mut self,
__clap_arg_matches: &mut ArgMatches,
) -> Result<(), Error>
fn update_from_arg_matches_mut( &mut self, __clap_arg_matches: &mut ArgMatches, ) -> Result<(), Error>
ArgMatches to self.Source§impl Parser for Cli
impl Parser for Cli
Source§fn parse_from<I, T>(itr: I) -> Self
fn parse_from<I, T>(itr: I) -> Self
Source§fn try_parse_from<I, T>(itr: I) -> Result<Self, Error>
fn try_parse_from<I, T>(itr: I) -> Result<Self, Error>
Source§fn update_from<I, T>(&mut self, itr: I)
fn update_from<I, T>(&mut self, itr: I)
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> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
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>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
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)
fn as_any(&self) -> &(dyn Any + 'static)
&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)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&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
impl<T> DowncastSync for T
Source§impl<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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