[PR #7137] feat: add --dangerously-skip-permissions flag #12268

Open
opened 2026-02-16 18:17:11 -05:00 by yindo · 0 comments
Owner

Original Pull Request: https://github.com/anomalyco/opencode/pull/7137

State: open
Merged: No


I don't know if you all have any interest in this, but I whipped this up because I really enjoy the simplicity of this flag in Claude Code.

So this adds a CLI flag and environment variable to bypass all permission prompts, similar to Claude Code's implementation.

Happy to take feedback or just throw this away if you don't think this is the right approach.

Usage

# CLI flag
opencode --dangerously-skip-permissions

# Environment variable
OPENCODE_DANGEROUSLY_SKIP_PERMISSIONS=true opencode

# With run command
opencode run --dangerously-skip-permissions "do something"

Behavior

  • Skips all ask permission prompts (auto-allows)
  • deny rules still apply (explicit denies are respected)
  • Shows "△ YOLO mode" warning in the TUI (home screen, footer, and sidebar)

Changes

  • flag.ts: Add OPENCODE_DANGEROUSLY_SKIP_PERMISSIONS env var
  • permission/next.ts: Add skipPermissions state and bypass logic in ask()
  • run.ts: Add --dangerously-skip-permissions option
  • thread.ts: Add --dangerously-skip-permissions option, propagate to TUI via args
  • args.tsx: Add dangerouslySkipPermissions to Args interface
  • home.tsx, footer.tsx, sidebar.tsx: Show warning indicator when enabled

Fixes #8463

**Original Pull Request:** https://github.com/anomalyco/opencode/pull/7137 **State:** open **Merged:** No --- I don't know if you all have any interest in this, but I whipped this up because I really enjoy the simplicity of this flag in Claude Code. So this adds a CLI flag and environment variable to bypass all permission prompts, similar to Claude Code's implementation. Happy to take feedback or just throw this away if you don't think this is the right approach. ### Usage ```bash # CLI flag opencode --dangerously-skip-permissions # Environment variable OPENCODE_DANGEROUSLY_SKIP_PERMISSIONS=true opencode # With run command opencode run --dangerously-skip-permissions "do something" ``` ### Behavior - Skips all `ask` permission prompts (auto-allows) - `deny` rules still apply (explicit denies are respected) - Shows "△ YOLO mode" warning in the TUI (home screen, footer, and sidebar) ### Changes - `flag.ts`: Add `OPENCODE_DANGEROUSLY_SKIP_PERMISSIONS` env var - `permission/next.ts`: Add `skipPermissions` state and bypass logic in `ask()` - `run.ts`: Add `--dangerously-skip-permissions` option - `thread.ts`: Add `--dangerously-skip-permissions` option, propagate to TUI via args - `args.tsx`: Add `dangerouslySkipPermissions` to Args interface - `home.tsx`, `footer.tsx`, `sidebar.tsx`: Show warning indicator when enabled Fixes #8463
yindo added the pull-request label 2026-02-16 18:17:11 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#12268