Skip to content

Conversation

@surma
Copy link

@surma surma commented Jan 6, 2026

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

@github-actions
Copy link
Contributor

github-actions bot commented Jan 6, 2026

The following comment was made by an LLM, it may be inaccurate:

No duplicate PRs found

# Conflicts:
#	packages/opencode/src/cli/cmd/tui/routes/home.tsx
#	packages/opencode/src/cli/cmd/tui/thread.ts
@surma surma force-pushed the surma/skip-permissions branch from 9b84229 to e6ed117 Compare January 14, 2026 14:23
@github-actions
Copy link
Contributor

Hey! Your PR title Implement --dangerously-skip-permissions aka YOLO mode doesn't follow conventional commit format.

Please update it to start with one of:

  • feat: or feat(scope): new feature
  • fix: or fix(scope): bug fix
  • docs: or docs(scope): documentation changes
  • chore: or chore(scope): maintenance tasks
  • refactor: or refactor(scope): code refactoring
  • test: or test(scope): adding or updating tests

Where scope is the package name (e.g., app, desktop, opencode).

See CONTRIBUTING.md for details.

@surma surma changed the title Implement --dangerously-skip-permissions aka YOLO mode feat: add --dangerously-skip-permissions flag Jan 14, 2026
@thdxr thdxr force-pushed the dev branch 3 times, most recently from f1ae801 to 08fa7f7 Compare January 30, 2026 14:37
@mguttmann
Copy link

For reference — I've implemented a more comprehensive YOLO mode in PR #11833 that builds on this concept with additional safety and UX:

  • ✅ Respects explicit deny rules (only auto-approves ask rules)
  • ✅ Session-only mode (resets on restart) + persistent mode (saved to config.json)
  • ✅ Full Settings UI with danger warnings
  • ✅ Env var support (OPENCODE_YOLO=true)
  • ✅ CLI flag support
  • ✅ All CI checks passing

Tracking issue: #11831

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE]: Add --dangerously-skip-permissions (aka YOLO mode)

2 participants