You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add an /approve on|off slash command (inspired by Claude Code's /approve on/off) to toggle manual step-by-step permission approval at runtime, optionally per session.
Why
Permissions mode is currently fixed at startup: packages/tui/src/context/permission.tsx reads args.auto and exposes an in-memory toggle(), and the CLI only supports --auto / -y / --dangerously-skip-permissions flags (packages/opencode/src/cli/cmd/run.ts). There is no interactive command to switch between normal and auto approval mid-session.
Proposed behavior
/approve on sets approval mode to auto; /approve off restores manual confirmation.
Toggle is persisted per-session (surface in PermissionV1.Ruleset / session config) and honored by the existing permission evaluation path (packages/opencode/src/permission).
Benefits
Go hands-free when safe, re-enable guards when tasks become risky, without restarting.
Mirrors Claude's /approve on|off and the existing /yolo-style flag.
Reacted by Tomáš Kocman, Meghea Iulian, sognix and yuimbo
If your request is specifically about a /approve on|off slash command interface (rather than a keybind or settings toggle), please clarify how it differs from the above.
Supporting this, with a note that the gap is sharpest in the web UI, where there is currently no auto-approve control at all.
Verified against the served web bundle (v1.18.18):
The web settings store exposes permissions.autoApprove with a setAutoApprove setter, but no UI component calls it (single definition, no call sites in the bundle). The TUI's command-palette item "Enable auto-approve permissions" and the --auto flag have no web equivalent.
opencode web accepts no --auto flag (checked --help), so a browser user cannot start in auto mode either.
Today the only web options are per-tool allow in Settings -> Permissions (persistent, not one-click) or "always" on individual approval dialogs (session-scoped).
A runtime /approve on|off command fixes this cleanly across every surface, including web, where slash commands already work. Also requested: a visible auto-approve indicator in the web composer mirroring what the TUI shows (muted auto next to the agent), so the mode is never silently on.
Reacted by Afonso Dutra Nogueira Filho and Tomáš Kocman
Chiming in from a related issue I opened (#47579) before realizing this thread covers the same gap — closing mine as a duplicate, but two implementation notes from it seem useful here:
The TUI slice is nearly free. The toggle already exists in the TUI command registry as permission.mode ("Enable/Disable auto-approve permissions", category System) — it's just palette-only because it lacks a slashName, unlike its siblings (theme.switch → /themes, model.list → /models). Adding slashName: "auto" (aliases like yolo to match the hidden --yolo flag) to the existing entry would ship the TUI portion of this without any new command surface.
Re: the web UI gap @thedanielmay flagged — agreed the runtime, session-scoped approach is the right cross-surface fix; the registry note above is just the quickest TUI-only stopgap.
Thanks for the suggestion! The request is a /approve on|off slash command that switches between manual approval and auto-accept while a session is running, ideally per session, so you don't need to restart with --auto.
In the current v2 TUI, auto-accept comes from either the --auto flag or the session.permissions setting (prompt / autoaccept). That setting is global and can only be changed from the Settings dialog, so a quick per-session toggle would be new behaviour. Maintainers will consider it.
Activity
github-actions commentedon Aug 12, 2026
This issue might be a duplicate of existing issues. Please check:
If your request is specifically about a
/approve on|offslash command interface (rather than a keybind or settings toggle), please clarify how it differs from the above.thedanielmay commentedon Aug 14, 2026
Supporting this, with a note that the gap is sharpest in the web UI, where there is currently no auto-approve control at all.
Verified against the served web bundle (v1.18.18):
permissions.autoApprovewith asetAutoApprovesetter, but no UI component calls it (single definition, no call sites in the bundle). The TUI's command-palette item "Enable auto-approve permissions" and the--autoflag have no web equivalent.opencode webaccepts no--autoflag (checked--help), so a browser user cannot start in auto mode either.allowin Settings -> Permissions (persistent, not one-click) or "always" on individual approval dialogs (session-scoped).A runtime
/approve on|offcommand fixes this cleanly across every surface, including web, where slash commands already work. Also requested: a visible auto-approve indicator in the web composer mirroring what the TUI shows (mutedautonext to the agent), so the mode is never silently on.iSchoen commentedon Sep 6, 2026
Chiming in from a related issue I opened (#47579) before realizing this thread covers the same gap — closing mine as a duplicate, but two implementation notes from it seem useful here:
The TUI slice is nearly free. The toggle already exists in the TUI command registry as
permission.mode("Enable/Disable auto-approve permissions", categorySystem) — it's just palette-only because it lacks aslashName, unlike its siblings (theme.switch→/themes,model.list→/models). AddingslashName: "auto"(aliases likeyoloto match the hidden--yoloflag) to the existing entry would ship the TUI portion of this without any new command surface.Keybinds have the same gap. There's no keybind action bound to the toggle, so it can't be remapped via
tui.json— apermission_modeaction would also serve the keybind-based request tracked in [FEATURE]: Add configurable TUI keybind for auto-approve permissions #40331.Re: the web UI gap @thedanielmay flagged — agreed the runtime, session-scoped approach is the right cross-surface fix; the registry note above is just the quickest TUI-only stopgap.
opencodejr commentedon Oct 28, 2026
Thanks for the suggestion! The request is a
/approve on|offslash command that switches between manual approval and auto-accept while a session is running, ideally per session, so you don't need to restart with--auto.In the current v2 TUI, auto-accept comes from either the
--autoflag or thesession.permissionssetting (prompt/autoaccept). That setting is global and can only be changed from the Settings dialog, so a quick per-session toggle would be new behaviour. Maintainers will consider it.Related issues and PRs:
/auto) #47579: asked for the same thing as a/autocommand; it was closed as a duplicate of this issue