pub struct Cli {
pub ai_backend: Option<AiBackend>,
pub model: Option<String>,
pub beta_header: Option<String>,
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 profile: Option<String>,
pub repo: 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, --model, --beta-header,
--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 and the
legacy USE_OPENAI/USE_OLLAMA/CLAUDE_CODE_USE_BEDROCK variables
(default forces the direct Anthropic API even when they are set).
model: Option<String>AI model to use for commands that invoke an AI model.
Highest-precedence model selector: it overrides OMNI_DEV_MODEL and
every per-backend model variable (CLAUDE_MODEL, CLAUDE_CODE_MODEL,
ANTHROPIC_MODEL, OPENAI_MODEL, OLLAMA_MODEL). Equivalent to
setting OMNI_DEV_MODEL.
beta_header: Option<String>Beta header to send with AI API requests (format: key:value).
Only sent if the model supports it in the model registry. Equivalent
to setting OMNI_DEV_BETA_HEADER. Ignored when --ai-backend is
claude-cli (the CLI negotiates betas itself).
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. The prompt is built from
untrusted content (diffs, commit messages, JIRA text), so well-known
secret env vars (*_API_KEY, *_TOKEN, etc.) are scrubbed from the
nested session; set OMNI_DEV_CLAUDE_CLI_KEEP_ENV to exempt names.
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.
profile: Option<String>Selects a named credential/config profile from
~/.omni-dev/settings.json (AWS-CLI style).
When set, the profile’s env bundle replaces the base env map in the
settings-fallback chain (process env still wins); the base map is not
consulted. Overrides OMNI_DEV_PROFILE. An unknown name is a hard error
listing the known profiles.
repo: Option<PathBuf>Run as if omni-dev was started in <PATH> instead of the current
working directory.
Resolved exactly once here and threaded explicitly to each command as a
parameter; deliberately not propagated to an environment variable
(unlike the flags above) so the repo location never becomes an ambient
global. Mirrors git -C.
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.