Cli

Struct Cli 

Source
pub struct Cli {
Show 23 fields pub color: Color, pub workspace_path: Option<PathBuf>, pub model: Option<String>, pub provider: Option<String>, pub api_key_env: String, pub workspace: Option<PathBuf>, pub enable_tree_sitter: bool, pub performance_monitoring: bool, pub research_preview: bool, pub security_level: String, pub show_file_diffs: bool, pub max_concurrent_ops: usize, pub api_rate_limit: usize, pub max_tool_calls: usize, pub debug: bool, pub verbose: bool, pub config: Option<PathBuf>, pub log_level: String, pub no_color: bool, pub theme: Option<String>, pub skip_confirmations: bool, pub full_auto: bool, pub command: Option<Commands>,
}
Expand description

Main CLI structure for vtcode with advanced features

Fields§

§color: Color

Color output selection (auto, always, never)

§workspace_path: Option<PathBuf>

Optional positional path to run vtcode against a different workspace

§model: Option<String>

LLM Model ID with latest model support

Available providers & models: • gemini-2.5-flash-preview-05-20 - Latest fast Gemini model (default) • gemini-2.5-flash - Fast, cost-effective • gemini-2.5-pro - Latest, most capable • gpt-5 - OpenAI’s latest • claude-sonnet-4-20250514 - Anthropic’s latest • qwen/qwen3-4b-2507 - Qwen3 local model • deepseek-reasoner - DeepSeek reasoning model • x-ai/grok-code-fast-1 - OpenRouter Grok fast coding model • qwen/qwen3-coder - OpenRouter Qwen3 Coder optimized for IDE usage • grok-2-latest - xAI Grok flagship model

§provider: Option<String>

LLM Provider with expanded support

Available providers: • gemini - Google Gemini (default) • openai - OpenAI GPT models • anthropic - Anthropic Claude models • deepseek - DeepSeek models • openrouter - OpenRouter marketplace models • xai - xAI Grok models

Example: –provider deepseek

§api_key_env: String

API key environment variable\n\nAuto-detects based on provider:\n• Gemini: GEMINI_API_KEY\n• OpenAI: OPENAI_API_KEY\n• Anthropic: ANTHROPIC_API_KEY\n• DeepSeek: DEEPSEEK_API_KEY\n• OpenRouter: OPENROUTER_API_KEY\n• xAI: XAI_API_KEY\n\nOverride: –api-key-env CUSTOM_KEY

§workspace: Option<PathBuf>

Workspace root directory for file operations

Security: All file operations restricted to this path Default: Current directory

§enable_tree_sitter: bool

Enable tree-sitter code analysis

Features: • AST-based code parsing • Symbol extraction and navigation • Intelligent refactoring suggestions • Multi-language support (Rust, Python, JS, TS, Go, Java)

§performance_monitoring: bool

Enable performance monitoring

Tracks: • Token usage and API costs • Response times and latency • Tool execution metrics • Memory usage patterns

§research_preview: bool

Enable research-preview features

Includes: • Advanced context compression • Conversation summarization • Enhanced error recovery • Decision transparency tracking

§security_level: String

Security level for tool execution

Options: • strict - Maximum security, prompt for all tools • moderate - Balance security and usability • permissive - Minimal restrictions (not recommended)

§show_file_diffs: bool

Show diffs for file changes in chat interface

Features: • Real-time diff rendering • Syntax highlighting • Line-by-line changes • Before/after comparison

§max_concurrent_ops: usize

Maximum concurrent async operations

Default: 5 Higher values: Better performance but more resource usage

§api_rate_limit: usize

Maximum API requests per minute

Default: 30 Purpose: Prevents rate limiting

§max_tool_calls: usize

Maximum tool calls per session

Default: 10 Purpose: Prevents runaway execution

§debug: bool

Enable debug output for troubleshooting

Shows: • Tool call details • API request/response • Internal agent state • Performance metrics

§verbose: bool

Enable verbose logging

Includes: • Detailed operation logs • Context management info • Agent coordination details

§config: Option<PathBuf>

Configuration file path

Supported formats: TOML Default locations: ./vtcode.toml, ~/.vtcode/vtcode.toml

§log_level: String

Log level (error, warn, info, debug, trace)

Default: info

§no_color: bool

Disable color output

Useful for: Log files, CI/CD pipelines

§theme: Option<String>

Select UI theme for ANSI styling (e.g., ciapre-dark, ciapre-blue)

§skip_confirmations: bool

Skip safety confirmations

Warning: Reduces security, use with caution

§full_auto: bool

Enable full-auto mode (no interaction)

Runs the agent without pausing for approvals. Requires enabling in configuration.

§command: Option<Commands>

Implementations§

Source§

impl Cli

Source

pub fn get_model(&self) -> String

Get the model to use, with fallback to default

Source

pub fn load_config(&self) -> Result<ConfigFile, Box<dyn Error>>

Load configuration from a simple TOML-like file without external deps

Supported keys (top-level): model, api_key_env, verbose, log_level, workspace Example: model = “gemini-2.5-flash-preview-05-20” api_key_env = “GEMINI_API_KEY” verbose = true log_level = “info” workspace = “/path/to/workspace”

Source

pub fn get_workspace(&self) -> PathBuf

Get the effective workspace path

Source

pub fn get_api_key_env(&self) -> String

Get the effective API key environment variable

Automatically infers the API key environment variable based on the provider when the current value matches the default or is not explicitly set.

Source

pub fn is_verbose(&self) -> bool

Check if verbose mode is enabled

Source

pub fn is_tree_sitter_enabled(&self) -> bool

Check if tree-sitter analysis is enabled

Source

pub fn is_performance_monitoring_enabled(&self) -> bool

Check if performance monitoring is enabled

Source

pub fn is_research_preview_enabled(&self) -> bool

Check if research-preview features are enabled

Source

pub fn get_security_level(&self) -> &str

Get the security level

Source

pub fn is_debug_mode(&self) -> bool

Check if debug mode is enabled (includes verbose)

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 Default for Cli

Source§

fn default() -> Self

Returns the “default value” for a type. 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 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<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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
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: 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: 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> Same for T

Source§

type Output = T

Should always be Self
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
Source§

impl<T> ErasedDestructor for T
where T: 'static,