Skip to main content

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.
YOLO mode automatically executes all file modifications, shell commands, and other operations without confirmation. Use with caution, especially in production environments.

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

All operations execute immediately:

Headless Mode

Executes without any confirmation:

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

Generates and writes:
  • src/auth/login.ts
  • src/auth/register.ts
  • src/auth/middleware.ts
  • tests/auth.test.ts
Without any confirmation prompts.

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

Always work in a version-controlled environment:
Test YOLO mode with small tasks first:
Vague prompts are dangerous in YOLO mode:
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