pub enum AiBackend {
Default,
ClaudeCli,
OpenAi,
Ollama,
Bedrock,
}Expand description
The AI backend used by commands that invoke an AI model.
One enum serves both the --ai-backend CLI flag (via
clap::ValueEnum) and the resolved dispatch in the client factory and
preflight (STYLE-0019). Selection precedence is documented on
resolve_backend.
Variants§
Default
Direct HTTP to the Anthropic API. Selecting this explicitly overrides
the legacy USE_* env vars.
ClaudeCli
Shell out to the claude -p CLI (reuses an existing Claude Code auth
session). Equivalent to setting OMNI_DEV_AI_BACKEND=claude-cli.
OpenAi
OpenAI API. Equivalent to setting OMNI_DEV_AI_BACKEND=openai
(legacy selector: USE_OPENAI=true).
Ollama
Local Ollama (or another OpenAI-compatible local server). Equivalent
to setting OMNI_DEV_AI_BACKEND=ollama (legacy: USE_OLLAMA=true).
Bedrock
AWS Bedrock with Claude models. Equivalent to setting
OMNI_DEV_AI_BACKEND=bedrock (legacy: CLAUDE_CODE_USE_BEDROCK=true).
Implementations§
Source§impl AiBackend
impl AiBackend
Sourcepub fn env_value(self) -> &'static str
pub fn env_value(self) -> &'static str
Returns the canonical AI_BACKEND_ENV value for this backend.
Sourcepub fn from_env_value(value: &str) -> Option<Self>
pub fn from_env_value(value: &str) -> Option<Self>
Parses an AI_BACKEND_ENV value.
Accepts the canonical kebab-case values plus the legacy claude_cli
underscore alias. Returns None for anything else.
Trait Implementations§
impl Copy for AiBackend
impl Eq for AiBackend
impl StructuralPartialEq for AiBackend
Auto Trait Implementations§
impl Freeze for AiBackend
impl RefUnwindSafe for AiBackend
impl Send for AiBackend
impl Sync for AiBackend
impl Unpin for AiBackend
impl UnsafeUnpin for AiBackend
impl UnwindSafe for AiBackend
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.