Skip to main content
The fix command resolves vulnerabilities using Patcha’s multi-level resolution system.

Usage

patcha fix [path] [options]

Arguments

ArgumentDescriptionDefault
pathProject path to fixCurrent directory

Options

OptionAliasDescription
--ai-Use AI to fix complex vulnerabilities
--dry-run-Show what would be fixed without making changes
--yes-yAuto-confirm fixes
--auto-Non-interactive mode for CI/CD
--mr-Create branch, commit and merge request
--json-Output results as JSON
--verbose-vEnable verbose debug output

Examples

Basic Fix

patcha fix
Prompts for confirmation before applying fixes.

Dry Run

patcha fix --dry-run
Shows what would be fixed without making any changes.

Auto-confirm

patcha fix --yes
Applies fixes without prompting for confirmation.

CI Mode

patcha fix --auto
Non-interactive mode that skips all prompts. Suitable for CI/CD pipelines.

AI-assisted Fix

patcha fix --ai
Uses LLM to fix complex vulnerabilities that can’t be resolved automatically. Requires:
  • An LLM provider configured
  • API key set
See LLM Providers for setup.

Create Merge Request

patcha fix --mr
Automatically:
  1. Creates a new branch
  2. Commits the changes
  3. Creates a merge/pull request

JSON Output

patcha fix --json
Useful for parsing results in scripts.

Exit Codes

  • 0: All vulnerabilities resolved
  • 1: Some vulnerabilities could not be resolved
  • 2: Error occurred

Resolution Levels

The fix command uses three resolution levels:
  1. Level 1: Auto-fix (direct version updates)
  2. Level 2: Smart upgrade (compatibility analysis)
  3. Level 3: AI-assisted (for complex cases)

Output Example

🔍 Scanning for vulnerabilities...

⚡ Resolving vulnerabilities...

Resolution Summary:
  ✓ Level 1 (Auto-fix): 3
  ✓ Level 2 (Smart upgrade): 2
  🤖 Level 3 (AI-assisted): 1
  ✗ No fix available: 1

Total resolved: 6 of 7