permissions: --yolo, command-aware allow rules, load allow.json
ci / check (push) Canceled after 0s
ci / check (pull_request) Canceled after 0s

This commit is contained in:
hermes committed 2026-10-02 21:37:49 +00:00
1 parent b36559bd95
commit 23dc8cd36e
6 files changed
+148 -36

No files matched your search

+7
View File
@@ -36,6 +36,9 @@ struct Cli {
/// Resume: no value opens the session picker; with a query resumes the best title match.
#[arg(short, long, num_args = 0..=1, default_missing_value = "")]
resume: Option<String>,
/// Skip permission prompts for bash/write/edit (also `permissions = "yolo"` in config.toml).
#[arg(long)]
yolo: bool,
/// Output mode: text (default for -p), json (NDJSON events on stdout; needs -p), rpc (JSON-RPC on stdio).
#[arg(long, value_enum, default_value_t = Mode::Text)]
mode: Mode,
@@ -79,6 +82,8 @@ struct Config {
explore_model: Option<String>,
/// Capture the mouse for wheel scrolling (default true; false = terminal selection works without shift).
mouse: Option<bool>,
/// "ask" (default) or "yolo": whether bash/write/edit prompt in the TUI.
permissions: Option<String>,
/// Replaces the built-in system prompt (AGENTS.md etc. are still appended).
system_prompt: Option<String>,
lsp: Option<LspCfg>,
@@ -124,6 +129,7 @@ impl Config {
max_tokens: o.max_tokens.or(c.max_tokens),
explore_model: o.explore_model.or(c.explore_model),
mouse: o.mouse.or(c.mouse),
permissions: o.permissions.or(c.permissions),
system_prompt: o.system_prompt.or(c.system_prompt),
lsp: o.lsp.or(c.lsp),
extensions: [c.extensions, o.extensions].concat(),
@@ -616,6 +622,7 @@ async fn main() -> Result<()> {
pricing,
specs,
open_sessions,
yolo: cli.yolo || cfg.permissions.as_deref() == Some("yolo"),
mcp: mcp
.servers
.iter()