pub struct Cli {Show 15 fields
pub command: Option<String>,
pub version: Option<bool>,
pub level: Option<String>,
pub cwd: Option<String>,
pub root: Option<String>,
pub session_id: Option<String>,
pub explain: bool,
pub suggest: bool,
pub list_commands: bool,
pub generate_book: bool,
pub setup: bool,
pub tool: Option<String>,
pub auto_detect: bool,
pub list_tools: bool,
pub subcommand: Option<Subcommand>,
}Fields§
§command: Option<String>Command string to check (omit for Claude hook mode via stdin)
version: Option<bool>Print version information.
level: Option<String>Safety level threshold; only commands at or below it auto-approve. Levels, locked → open: paranoid, reader, editor, developer, local-admin, network-admin, yolo. The legacy names inert / safe-read / safe-write still work (mapped to paranoid / reader / developer, with a notice). Default: developer.
cwd: Option<String>Working directory to resolve relative paths against (as a harness hook would pass).
Pair with –root so e.g. cd-relative writes classify against the real directory.
root: Option<String>Project root, so a relative path under it is worktree-local and one outside it (the cwd having escaped the project) is scored as its real absolute target.
session_id: Option<String>The harness session id (as a hook would pass), used to recognize this session’s scratchpad
under a temp root as a trusted working area rather than anonymous /tmp.
explain: boolPrint a per-segment breakdown of why a command would or would not auto-approve. For a single command it also prints the behavior it resolved to and, when it does not approve, names the facet that refused it.
suggest: boolOffer to support a command safe-chains doesn’t recognize yet. Pass the command as the
argument: safe-chains --suggest "<command>". It writes (or upgrades) the project’s local
.safe-chains.toml with a definition for the unrecognized command, then prints the
[[trusted]] pin for you to add to ~/.config/safe-chains.toml so that file takes effect.
list_commands: boolList all supported commands in Markdown format
generate_book: boolGenerate mdBook command reference pages in docs/src/commands/
setup: boolConfigure the hook for the named tool (default: claude). Use –auto-detect for every installed tool.
tool: Option<String>Pair with –setup to select the target tool by name. See –list-tools.
auto_detect: boolPair with –setup to install for every installed tool detected on this machine.
list_tools: boolPrint the names of every supported integration target.
subcommand: Option<Subcommand>Hook subcommand: read this tool’s stdin envelope, validate the command, write the response.
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.