pub struct ClientOptions {Show 15 fields
pub cli_path: Option<PathBuf>,
pub cli_args: Option<Vec<String>>,
pub cwd: Option<PathBuf>,
pub port: u16,
pub use_stdio: bool,
pub cli_url: Option<String>,
pub log_level: LogLevel,
pub auto_start: bool,
pub auto_restart: bool,
pub environment: Option<HashMap<String, String>>,
pub github_token: Option<String>,
pub use_logged_in_user: Option<bool>,
pub deny_tools: Option<Vec<String>>,
pub allow_tools: Option<Vec<String>>,
pub allow_all_tools: bool,
}Expand description
Options for creating a CopilotClient.
Fields§
§cli_path: Option<PathBuf>§cli_args: Option<Vec<String>>§cwd: Option<PathBuf>§port: u16§use_stdio: bool§cli_url: Option<String>§log_level: LogLevel§auto_start: bool§auto_restart: bool§environment: Option<HashMap<String, String>>§github_token: Option<String>GitHub personal access token for authentication.
Cannot be used together with cli_url.
use_logged_in_user: Option<bool>Whether to use the logged-in user for auth.
Defaults to true when github_token is empty. Cannot be used with cli_url.
deny_tools: Option<Vec<String>>Tool specifications to deny (passed as --deny-tool arguments to the CLI).
Each entry follows the CLI’s tool specification format:
"shell(git push)"— deny a specific shell command"shell(git)"— deny all git commands"shell(rm)"— deny rm commands"shell"— deny all shell commands"write"— deny file write operations"MCP_SERVER(tool_name)"— deny a specific MCP tool
--deny-tool takes precedence over --allow-tool and --allow-all-tools.
allow_tools: Option<Vec<String>>Tool specifications to allow without manual approval
(passed as --allow-tool arguments to the CLI).
Each entry follows the same format as deny_tools.
allow_all_tools: boolIf true, passes --allow-all-tools to the CLI.
This allows Copilot to use any tool without asking for approval.
Use deny_tools in combination to create an allowlist with exceptions.
Trait Implementations§
Source§impl Clone for ClientOptions
impl Clone for ClientOptions
Source§fn clone(&self) -> ClientOptions
fn clone(&self) -> ClientOptions
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ClientOptions
impl Debug for ClientOptions
Auto Trait Implementations§
impl Freeze for ClientOptions
impl RefUnwindSafe for ClientOptions
impl Send for ClientOptions
impl Sync for ClientOptions
impl Unpin for ClientOptions
impl UnsafeUnpin for ClientOptions
impl UnwindSafe for ClientOptions
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<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