Configuration

Customize Autopilot CLI behavior using configuration files.


Autopilot CLI is designed to be zero-config out of the box, but it also offers powerful customization options to fit your workflow. You can configure Autopilot using .autopilotrc.json for behavior settings and .autopilotignore for file exclusion.

.autopilotrc.json

The .autopilotrc.json file in your project root controls how Autopilot monitors and commits changes.

OptionTypeDefaultDescription
minIntervalnumber300Minimum time (in seconds) between automatic commits. Useful for debouncing rapid changes.
autoPushbooleantrueWhether to automatically push commits to the remote repository.
blockedBranchesstring[]['main', 'master']List of branches where Autopilot is disabled to prevent accidental direct commits to protected branches.
requireChecksbooleanfalseIf true, Autopilot will wait for local checks (like pre-commit hooks) to pass before committing.
ignorestring[][]Additional glob patterns to ignore, supplementing .gitignore and .autopilotignore.
aiobject{}Configuration for AI features (see below).
teamobject{}Configuration for Team features (see below).

AI Configuration

Enable smart commit messages powered by Google Gemini.

{
  "ai": {
    "enabled": true,
    "apiKey": "YOUR_GEMINI_API_KEY",
    "model": "gemini-2.5-flash",
    "interactive": false
  }
}
  • enabled: Toggle AI features on/off.
  • apiKey: Your Google Gemini API Key.
  • model: The Gemini model to use (default: gemini-2.5-flash).
  • interactive: If true, prompts you to review/edit the generated message before committing.

Team Configuration

Settings to ensure smooth collaboration.

{
  "team": {
    "pullBeforePush": true,
    "preventSecrets": true,
    "preventLargeFiles": true
  }
}
  • pullBeforePush: Automatically runs git pull --rebase before pushing to avoid conflicts.
  • preventSecrets: Scans for AWS, Stripe, and GitHub keys before committing.
  • preventLargeFiles: Blocks commits containing files larger than 50MB.

Example Configuration

{
  "minInterval": 600,
  "autoPush": true,
  "blockedBranches": ["main", "production"],
  "requireChecks": true,
  "ai": {
    "enabled": true,
    "interactive": true
  }
}

.autopilotignore

Just like .gitignore, you can use an .autopilotignore file to tell Autopilot which files or directories to skip. This is useful for files that you want to track in Git but don't want Autopilot to commit automatically (e.g., specific config files, large assets, or work-in-progress drafts).

The syntax is standard glob patterns:

# Ignore all markdown files in the drafts folder
docs/drafts/*.md

# Ignore a specific config file
local-config.json

# Ignore all log files
*.log

Note: Autopilot always respects your .gitignore file. You do not need to duplicate entries from .gitignore into .autopilotignore.

For most users, we recommend the following safety settings to balance automation with control:

  1. Protect Main Branches: Always keep main and master in blockedBranches. Use Autopilot on feature branches.
  2. Reasonable Interval: A minInterval of 300 (5 minutes) is usually a good balance. It ensures you have a granular history without overwhelming your log.
  3. Enable Checks: If you use pre-commit hooks (husky, etc.), set requireChecks: true to ensure you don't commit broken code.

Use Case Examples

"Commit Only" Mode

If you want Autopilot to create local checkpoints but never push to remote automatically (e.g., if you have strict CI/CD that runs on push), use this config:

{
  "autoPush": false,
  "minInterval": 300
}

"Aggressive Sync" Mode

For rapid prototyping or personal projects where you want every change saved and synced immediately:

{
  "autoPush": true,
  "minInterval": 60,
  "blockedBranches": []
}
Was this page helpful?
Edit this page