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.
| Option | Type | Default | Description |
|---|---|---|---|
minInterval | number | 300 | Minimum time (in seconds) between automatic commits. Useful for debouncing rapid changes. |
autoPush | boolean | true | Whether to automatically push commits to the remote repository. |
blockedBranches | string[] | ['main', 'master'] | List of branches where Autopilot is disabled to prevent accidental direct commits to protected branches. |
requireChecks | boolean | false | If true, Autopilot will wait for local checks (like pre-commit hooks) to pass before committing. |
ignore | string[] | [] | Additional glob patterns to ignore, supplementing .gitignore and .autopilotignore. |
ai | object | {} | Configuration for AI features (see below). |
team | object | {} | 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 --rebasebefore 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
.gitignorefile. You do not need to duplicate entries from.gitignoreinto.autopilotignore.
Recommended Defaults
For most users, we recommend the following safety settings to balance automation with control:
- Protect Main Branches: Always keep
mainandmasterinblockedBranches. Use Autopilot on feature branches. - Reasonable Interval: A
minIntervalof300(5 minutes) is usually a good balance. It ensures you have a granular history without overwhelming your log. - Enable Checks: If you use pre-commit hooks (husky, etc.), set
requireChecks: trueto 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": []
}