From 18008de7f18b5c34156c7708f1bf3093bac88670 Mon Sep 17 00:00:00 2001 From: worldmozara Date: Fri, 17 Jul 2026 14:55:34 +0800 Subject: [PATCH] docs: document /yolo and --yes soft-confirm overrides --- CLAUDE.md | 6 +++--- README.md | 5 +++-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/CLAUDE.md b/CLAUDE.md index b2dce36..b37b638 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -75,7 +75,7 @@ Module-level `@tool` handlers. Call `set_workspace_root()` before use. - **`process`**: `run_command` (argv, no shell, timeout, optional stdin/env); PTY `open_pty` / `read_pty` / `write_pty` / `close_pty` (POSIX: `pty`+`fork`; Windows: ConPTY via `pywinpty` env marker dep). - PTY: backend in `pty_backend.py`; structured status (`alive`/`exit_code`/`data`); `read_pty(..., until=)`; session limit/idle TTL/output budget; close terminate→kill. - CLI limit hooks: interactive confirm to raise tool-loop rounds, PTY session cap, or PTY output budget. -- Destructive confirms: `classify_danger` + `ToolRegistry(on_confirm=…)`; CLI default deny; config `confirm_destructive` / `path_denylist`. +- Destructive confirms: `classify_danger` + `ToolRegistry(on_confirm=…)`; CLI default deny; config `confirm_destructive` / `path_denylist`. Session YOLO: `/yolo on|off|once` and `--yes` (skip soft confirms; hard denylists unchanged; `once` expires after the next user turn). - **`vcs`**: read-only VCS tools (`vcs_kind` / `vcs_status` / `vcs_diff` / `vcs_log` / `vcs_branch`) via `VcsBackend` protocol; **git** implemented; detectors are pluggable for other systems. - **`chat`**: human prompts as tools — `ask_user`, `choose_user`, `form_user` (shared `prompting` core). - **`DEFAULT_TOOLS`**: file + process + vcs + chat tool list for a `ToolRegistry`. @@ -88,8 +88,8 @@ Shared interactive I/O: `ask` / `choose` / `form` / `confirm` with pluggable bac Click app + readline REPL. Entry: `plyngent` / `python -m plyngent`. -- **`plyngent chat`**: provider/model (flags or interactive; Tab via readline in `prompting`); sessions store `provider_name`/`model` and restore on resume; SQLite via `[database]` (file DB under user data if unset/`:memory:`); workspace-bound; resume latest for cwd/`--workspace` by default (`--new` / `--session`). One-shot: `-p/--prompt` and non-TTY stdin; exit codes 0/1/2/3; `--yes`, `--stream/--no-stream`, `--quiet`. Root `--log-level`. -- Slash: Click group in `cli/slash.py` + `awaitlet` for async work; Tab completer from registry + ParamType `shell_complete`. Multiline `"""` … `"""`; `/edit` via `$EDITOR`. +- **`plyngent chat`**: provider/model (flags or interactive; Tab via readline in `prompting`); sessions store `provider_name`/`model` and restore on resume; SQLite via `[database]` (file DB under user data if unset/`:memory:`); workspace-bound; resume latest for cwd/`--workspace` by default (`--new` / `--session`). One-shot: `-p/--prompt` and non-TTY stdin; exit codes 0/1/2/3; `--yes` (YOLO on), `--stream/--no-stream`, `--quiet`. Root `--log-level`. +- Slash: Click group in `cli/slash.py` + `awaitlet` for async work; Tab completer from registry + ParamType `shell_complete`. Multiline `"""` … `"""`; `/edit` via `$EDITOR`. `/yolo on|off|once` for soft destructive confirms. - Explicit `/resume` or `--session` from another workspace prompts: **keep** / **update** / **abort**. - Failed/cancelled turns: user kept; **committed tool rounds kept** (side effects not re-run on `/retry`); only unfinished assistant rolled back; Ctrl+C cancels; TTY confirms off-loop; auto-retry 10s/20s/30s then `/retry`. - **`plyngent providers`**, **`config path|edit`**. No providers + `$EDITOR` → optional edit then reload. diff --git a/README.md b/README.md index 0e0f822..572fd2a 100644 --- a/README.md +++ b/README.md @@ -152,7 +152,7 @@ plyngent chat --session 3 | `--max-rounds` | Tool-loop rounds per turn (default 32) | | `--stream` / `--no-stream` | Streaming deltas (default on) | | `--quiet` | Less status on stderr | -| `--yes` | Allow destructive tools without confirm (also for one-shot) | +| `--yes` | YOLO on: skip destructive-tool confirms for this process | | `--log-level` | On the root CLI: `DEBUG`, `INFO`, `WARNING`, … | Sessions resume the **most recently updated** session for the current workspace unless you pass `--new` or `--session`. Each session remembers the last **provider** and **model** (restored on resume so you are not re-prompted). @@ -192,6 +192,7 @@ Type `/help` in the REPL for the live list. Common ones: | `/export [md\|json] [path]` | Transcript from DB (no secrets) | | `/compact` | Soft-compact + model summary into a **new** session | | `/stream` `/verbose` `/markdown` `/tools` `/rounds` | Toggles and limits | +| `/yolo [on\|off\|once]` | Soft destructive confirms: sticky skip, off, or next turn only | | `/retry` | Re-run incomplete last user turn (after error/cancel) | | `/provider` `/model` | Switch without restarting | @@ -215,7 +216,7 @@ Safety defaults: - Paths stay under the workspace; optional `path_denylist` substrings. - Command basename denylist (e.g. dangerous shells/utilities). -- Destructive tools (delete/move/overwrite) can require confirm (`confirm_destructive`; default deny in non-TTY). +- Destructive tools (delete/move/overwrite) can require confirm (`confirm_destructive`; default deny in non-TTY). Override for the session with `/yolo on|off|once` or startup `--yes` (path/command denylists still apply). - PTY sessions: caps, idle TTL, output budget; master FD is non-inheritable; sessions closed on chat exit. ## Usage / context (CLI)