Contenox

Practical guide

OpenCode skip permissions and YOLO mode on Windows

Choose whether to skip prompts in the desktop app, for one terminal run, or only for the commands you trust.

Updated

In OpenCode Desktop, open Settings → Preferences → General and turn on Auto-accept permissions. In a terminal, start an interactive session with opencode --auto. To send one prompt and print the answer, use opencode run --auto "Summarize this repository". These are the controls people usually mean by OpenCode YOLO mode. The current CLI still respects explicit denials. OpenCode CLI reference

Check which installation you are changing#

In the desktop app, open Settings → About and note the version. In the same PowerShell window you normally use, run opencode --version. Desktop and terminal installations can update independently. Record the active project too. After changing a preference, reopen that project and inspect its effective setting. If a prompt still appears or a remembered rule still takes effect, check the project override before changing another project.

Auto-accept permissions in OpenCode Desktop#

The switch sits below Default environment. The Windows app says that projects can override this preference. If two projects on the same machine behave differently, check the active project’s settings before changing the application-wide default. To request approval again, turn the switch off and check for a project override or an existing allow rule.

OpenCode Desktop Preferences on Windows with Auto-accept permissions switched off below Default environment.
The switch is off in this installation. The line beneath it explains why a project can behave differently.

Skip permission prompts for one PowerShell run#

Open PowerShell in the project you intend to use. Pick the command for the kind of session you want.

Task Command
Open the interactive terminal interface with automatic approvals opencode --auto
Send one prompt, print the result and exit opencode run --auto "Summarize this repository"
Start a new interactive session under your normal permission settings opencode

The flag applies to the invocation. It saves editing your PowerShell profile or setting a persistent environment variable. The words “summarize this repository” describe a task. They impose no read-only restriction on the tools. Use a workspace and credentials appropriate for the access you intend to grant. OpenCode commands · OpenCode permissions

V1, V2 and --dangerously-skip-permissions#

Older instructions have a real source. OpenCode 1.4.0 introduced opencode run --dangerously-skip-permissions in April 2026. The same release already had a desktop auto-accept setting. On 28 November we checked the Windows binaries for 1.19.6 and 2.4.2. Both advertised --auto in their top-level help and in run --help. A red terminal theme or a custom ocd PowerShell function is unnecessary for those builds. A wrapper that sets $env:OPENCODE_PERMISSION without restoring it can also affect later launches from that PowerShell window. V1.4.0 release notes · V1 to V2 migration

If an example produces an unknown-option error, these checks show which copy of the command PowerShell resolves and which flags that particular build advertises.

Get-Command opencode -All
opencode --version
opencode --help
opencode run --help

Allow Git status, ask about other commands, block Git push#

If the interruption you want to remove is repeated approval for git status, you can solve that specific problem. In a V2 project’s opencode.jsonc, add the following rules to the existing permissions array. Put the more specific rules last. Launch without --auto and leave desktop auto-accept off to keep the ask decisions interactive. V2 permission matching

{
  "permissions": [
    { "action": "shell", "resource": "*", "effect": "ask" },
    { "action": "shell", "resource": "git status *", "effect": "allow" },
    { "action": "shell", "resource": "git push *", "effect": "deny" }
  ]
}

For commands matched by these rules, git status --short can proceed, git branch --show-current asks, and git push is denied. These patterns control matching shell calls. An organization that must control every write to a remote repository should also enforce that decision at the repository. OpenCode separately supports managed tool.use policies, whose denials override saved approvals. OpenCode policies

Upgrading from V1? Its native configuration uses singular permission and the tool name bash. V2 uses permissions and shell. Also check saved approvals after an upgrade. In 2.4.2, newly choosing Always allow for a web fetch grants that site, while earlier saved grants retain their original scope. Migration guide · 2.4.2 upgrade notes

For the other clients, read the OpenCode product profile. To see what the equivalent switches authorize in Claude Code, Codex and Copilot, read the AI coding harness comparison.