CLI Reference
Complete reference for all Autopilot CLI commands.
CLI Reference
Autopilot CLI exposes a set of commands to manage the background watcher process, check system health, and analyze productivity.
autopilot init
Initializes Autopilot in the current directory.
Syntax:
autopilot init [options]
Options:
--team: Initialize with team collaboration settings (Pull-Before-Push, secret checks).--ai: Enable AI commit message generation (requires Google Gemini API key).
What it does:
- Checks if the current directory is a git repository.
- Creates a
.autopilotrc.jsonconfiguration file with default settings. - Adds
.autopilot/to your.gitignorefile to prevent logs from being committed. - Optionally configures AI and Team presets.
Example:
cd my-project
autopilot init --ai
autopilot start
Starts the background file watcher daemon.
Syntax:
autopilot start
What it does:
- Spawns a detached background process.
- Begins monitoring the current directory (and subdirectories) for file changes using
chokidar. - Respects
.gitignoreand.autopilotrc.jsonignore rules. - Automatically commits and pushes changes after the debounce period.
Common Output:
🚀 Autopilot watcher started in background (PID: 12345)
Logs: .autopilot/autopilot.log
autopilot stop
Stops the running Autopilot daemon for the current project.
Syntax:
autopilot stop
What it does:
- Reads the Process ID (PID) from
.autopilot/autopilot.pid. - Sends a termination signal to that process.
- Cleans up the PID file.
autopilot status
Checks the status of the Autopilot daemon.
Syntax:
autopilot status
Output: Displays whether the watcher is Running, Stopped, or Paused, along with the PID and log file location.
autopilot pause
Temporarily pauses the watcher without killing the process.
Syntax:
autopilot pause [reason]
Example:
autopilot pause "Refactoring large file"
Use Case: Useful when performing large refactors or rebases where you don't want intermediate auto-commits.
autopilot resume
Resumes a paused watcher.
Syntax:
autopilot resume
autopilot undo
Safely reverts the last commit made by Autopilot.
Syntax:
autopilot undo
What it does:
- Verifies the last commit was made by Autopilot (checks for
[autopilot]prefix or author). - Performs a
git reset --soft HEAD~1. - Keeps your file changes in the staging area so you don't lose work.
autopilot preset
Apply a pre-configured workflow preset.
Syntax:
autopilot preset [name]
Available Presets:
safe-team: Optimized for teams. Enables pull-before-push, secret scanning, and linting.solo-speed: Optimized for speed. Disables some checks for rapid prototyping.strict-ci: Enforces strict quality gates (tests + lint) before every commit.
Example:
autopilot preset safe-team
autopilot doctor
Diagnoses environment and configuration issues.
Syntax:
autopilot doctor
Checks:
- Node.js version compatibility.
- Git installation and authentication.
- File permissions.
- Configuration validity.
- API connectivity (if AI is enabled).
autopilot insights
Displays productivity analytics and project stats.
Syntax:
autopilot insights [--export csv]
Features:
- Commit Quality Score: AI-based analysis of your commit habits.
- Productivity Metrics: Peak coding hours, active streaks.
- Export: Export data to CSV for external analysis (e.g., spreadsheet leaderboards).
autopilot leaderboard
Interacts with the global Autopilot leaderboard.
Syntax:
autopilot leaderboard [--sync]
Options:
--sync: Pushes your local productivity stats (focus time, streaks, scores) to the global leaderboard.- (No args): Opens the leaderboard in your default browser.
Example:
# Sync your latest stats
autopilot leaderboard --sync
# View rankings
autopilot leaderboard