Skip to main content

ai_agent/commands/
model.rs

1// Source: /data/home/swei/claudecode/openclaudecode/src/utils/model/model.ts
2use super::{Command, CommandCallResult};
3use crate::constants::env::ai;
4
5pub fn create_model_command() -> Command {
6    Command::prompt("model", "Set the AI model for Claude Code").argument_hint("[model]")
7}
8
9pub fn get_main_loop_model() -> String {
10    std::env::var(ai::MODEL).unwrap_or_else(|_| "claude-sonnet-4-20250514".to_string())
11}
12
13pub fn render_model_name(model: &str) -> String {
14    model.to_string()
15}