Skip to content

Add --yolo flag to auto-approve all permission requests (headless/Docker use) #20864

@alexsiri7

Description

@alexsiri7

Problem

When running OpenCode inside a Docker container or headless environment, the external_directory permission system blocks agents with interactive prompts that cannot be answered. Every new directory path triggers a new "Permission required" dialog.

The default permission rules include a hardcoded external_directory: * → ask catch-all that cannot be overridden via config — user-provided allow rules are prepended but the default ask comes after and takes precedence (last-match-wins).

Proposed Solution

Add a --yolo CLI flag (and/or autoApprove config option) that bypasses the interactive permission dialog for all tool requests, similar to Claude CLI's --dangerously-skip-permissions.

This would short-circuit the permission Request() method to return true immediately when enabled.

Use Case

  • Running OpenCode as an agent inside Docker containers (e.g., Gas City multi-agent orchestration)
  • CI/CD pipelines
  • Any headless/non-interactive environment where the TUI permission prompt cannot be answered

Environment

  • OpenCode 1.3.13
  • Running inside Docker (Ubuntu 24.04)
  • Agents get stuck on external_directory permission prompts for paths like /workspace/.beads/formulas/*, /workspace/.gc/runtime/packs/dolt/*, etc.

Metadata

Metadata

Assignees

Labels

coreAnything pertaining to core functionality of the application (opencode server stuff)

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions