-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Open
Description
Summary
Add a YOLO mode that automatically approves all tool permission prompts (while still respecting explicit deny rules in config).
Motivation
Power users who fully trust OpenCode's actions often find permission prompts disruptive to their workflow. YOLO mode lets them skip all "ask" prompts while maintaining safety through explicit deny rules.
This is useful for:
- Automated/CI workflows where no human is available to approve
- Experienced users who want uninterrupted coding sessions
- Quick prototyping where speed matters more than review
Changes
Backend (packages/opencode)
- Yolo namespace (
yolo/index.ts): Enable/disable/toggle with bus events - Flag (
flag/flag.ts):OPENCODE_YOLOenv var support - Permission (
permission/next.ts): Auto-approve "ask" rules when YOLO is active (explicit "deny" rules are always respected) - Bootstrap (
project/bootstrap.ts): Initialize YOLO on startup from config - Config (
config/config.ts):yolo: booleanfield - Server routes (
server/routes/config.ts):GET/POST /config/yoloendpoints
Frontend (packages/app)
- Settings UI (
settings-general.tsx): YOLO section with:- "This Session Only" toggle (resets on restart)
- "Always Enabled" toggle (persists to config.json)
- CLI usage reference (
opencode --yolo,OPENCODE_YOLO=true) - Warning about dangers
SDK
- Regenerated with YOLO endpoints
Safety
- Explicit
denyrules in permission config are always respected, even in YOLO mode - Only "ask" rules are auto-approved
- Clear warnings in the UI about the risks
- Session-only mode available for temporary use
Related
Split from #9971 (closed) for cleaner review.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels