Overview
The--yolo (or -y) option runs Qwen Code in YOLO mode (You Only Live Once), automatically approving all tool executions without prompting for confirmation. This is useful for automation, trusted environments, and when you want maximum speed.
Syntax
What It Does
With--yolo enabled:
✅ Auto-approves all file writes and edits✅ Auto-executes shell commands
✅ Skips confirmation prompts
✅ Maximizes execution speed
✅ Continues without pausing
Basic Usage
Interactive Mode
Headless Mode
When to Use YOLO Mode
Trusted Environments
Automation Scripts
Batch Operations
Time-Sensitive Tasks
When NOT to Use YOLO Mode
Production Environments
Unfamiliar Codebases
Destructive Operations
Shared Repositories
Combining with Other Options
With Model Selection
With Output Format
With Session Management
Safety Considerations
Use Version Control
Always use Git when running YOLO mode:Backup Important Files
Use Sandboxes
Review Logs
YOLO Mode vs Other Approval Modes
Choosing the Right Mode
Examples
Code Generation
src/auth/login.tssrc/auth/register.tssrc/auth/middleware.tstests/auth.test.ts
Bug Fixes
Code Refactoring
Dependency Updates
Automation Scripts
Daily Code Maintenance
CI/CD Integration
Bulk Code Updates
Monitoring YOLO Executions
Log All Actions
Track Changes
Cost Tracking
Troubleshooting
Unexpected Changes
If YOLO mode made unwanted changes:Failed Executions
If a YOLO command fails midway:Prompt Too Broad
If YOLO mode attempts too many changes:Best Practices
Use Version Control
Use Version Control
Always work in a version-controlled environment:
Start Small
Start Small
Test YOLO mode with small tasks first:
Use Specific Prompts
Use Specific Prompts
Vague prompts are dangerous in YOLO mode:
Review Before Production
Review Before Production
Never deploy YOLO changes directly:
Advanced Usage
Conditional YOLO
Sandboxed YOLO
Rate-Limited YOLO
See Also
--plan Option
Plan-only mode for reviewing before execution
Approval Modes
Understanding different approval modes
Safety Guidelines
Best practices for safe AI usage
Automation
Complete automation guide
