@traisetech/autopilot 0.1.8 ā 2.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +35 -0
- package/README.md +72 -90
- package/bin/autopilot.js +59 -1
- package/docs/CONFIGURATION.md +100 -82
- package/docs/TEAM-MODE.md +51 -0
- package/package.json +14 -4
- package/src/commands/dashboard.mjs +144 -0
- package/src/commands/init.js +57 -26
- package/src/commands/insights.js +231 -90
- package/src/commands/leaderboard.js +70 -0
- package/src/commands/pause.js +18 -0
- package/src/commands/preset.js +121 -0
- package/src/commands/resume.js +17 -0
- package/src/commands/undo.js +84 -0
- package/src/config/defaults.js +15 -3
- package/src/core/commit.js +31 -6
- package/src/core/gemini.js +20 -8
- package/src/core/git.js +80 -1
- package/src/core/history.js +69 -0
- package/src/core/safety.js +204 -38
- package/src/core/state.js +71 -0
- package/src/core/watcher.js +54 -11
- package/src/index.js +34 -0
- package/src/utils/logger.js +9 -0
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,41 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
This project follows [Semantic Versioning](https://semver.org).
|
|
5
5
|
|
|
6
|
+
## [2.0.1] - 2026-02-05
|
|
7
|
+
|
|
8
|
+
### Fixed
|
|
9
|
+
- **Dashboard Stability**: Fixed a crash in `autopilot dashboard` caused by incorrect named import of `getRunningPid`.
|
|
10
|
+
- **Command Reliability**: Added regression tests for `dashboard`, `pause`, `resume`, `stop`, and `status` commands to ensure stability.
|
|
11
|
+
|
|
12
|
+
## [2.0.0] - 2026-02-04
|
|
13
|
+
|
|
14
|
+
### Added
|
|
15
|
+
- **Safety System (Phase 1)**:
|
|
16
|
+
- **Undo/Rollback**: `autopilot undo` command to safely revert the last autopilot commit.
|
|
17
|
+
- **Team Mode**: Enhanced `autopilot init` with team configuration. Implements "Pull-Before-Push" to prevent conflicts.
|
|
18
|
+
- **Pre-Commit Validation**:
|
|
19
|
+
- **Secret Detection**: Blocks commits containing AWS, GitHub, or Stripe keys.
|
|
20
|
+
- **File Size Check**: Prevents committing files larger than 50MB.
|
|
21
|
+
- **Quality Gates**: Optional linting and test execution before commit.
|
|
22
|
+
- **Pause/Resume**: `autopilot pause` and `autopilot resume` for manual control of the automation loop.
|
|
23
|
+
- **Visibility & UX (Phase 2)**:
|
|
24
|
+
- **Real-Time Dashboard**: `autopilot dashboard` providing a live view of file changes, last commit status, and system health.
|
|
25
|
+
- **Enhanced Insights**: `autopilot insights` with deep analytics:
|
|
26
|
+
- Commit Quality Score (0-100) based on conventional commit standards.
|
|
27
|
+
- Productivity metrics (peak hours, streaks).
|
|
28
|
+
- CSV export capability (`--export csv`).
|
|
29
|
+
- **Intelligence (Phase 3)**:
|
|
30
|
+
- **AI Commit Messages**: Integration with Google Gemini for context-aware, senior-level commit message generation.
|
|
31
|
+
- **Workflow Presets**: `autopilot preset` command to quickly switch between workflows:
|
|
32
|
+
- `safe-team`: Optimized for collaboration (Team Mode + Secret Checks).
|
|
33
|
+
- `solo-speed`: Optimized for rapid individual development.
|
|
34
|
+
- `strict-ci`: Enforces testing and linting before every commit.
|
|
35
|
+
### Docs/Website
|
|
36
|
+
- Added Leaderboard page with live simulated rankings.
|
|
37
|
+
- Updated homepage Feature Showcase to demonstrate Insights and Safety & Team features.
|
|
38
|
+
- Added Leaderboard to top navigation.
|
|
39
|
+
- Updated Introduction docs to highlight v2.0 features (AI, Focus Engine, Team Mode, Safety Net).
|
|
40
|
+
|
|
6
41
|
## [0.1.8] - 2026-02-04
|
|
7
42
|
|
|
8
43
|
### Reliability & Core
|
package/README.md
CHANGED
|
@@ -82,14 +82,27 @@ autopilot start
|
|
|
82
82
|
---
|
|
83
83
|
|
|
84
84
|
## ⨠Features
|
|
85
|
-
|
|
86
|
-
- **š§
|
|
85
|
+
|
|
86
|
+
- **š§ AI Commit Messages**: Gemini 2.5-powered, context-aware conventional commit messages.
|
|
87
87
|
- **ā” Watcher Engine**: Real-time file monitoring with smart debouncing using `chokidar`.
|
|
88
88
|
- **š”ļø Safety First**: Blocks commits on protected branches and checks remote status.
|
|
89
89
|
- **š Automated Flow**: Fetches, stages, commits, and pushes (optional) automatically.
|
|
90
|
+
- **š„ Team Mode**: Pull-before-push and conflict abortion with preset workflows.
|
|
91
|
+
- **š„ļø Dashboard**: Real-time terminal dashboard with status and activity feed.
|
|
92
|
+
- **ā®ļø Undo System**: Safely rollback the last autopilot commit with one command.
|
|
93
|
+
- **š Focus Engine & Insights**: Track active coding time, streaks, peak hours, and commit quality.
|
|
90
94
|
- **āļø Zero Config**: Works out of the box, but fully configurable via `.autopilotrc.json`.
|
|
91
95
|
- **𩺠Self-Healing**: Includes a `doctor` command to diagnose and fix issues.
|
|
92
96
|
|
|
97
|
+
---
|
|
98
|
+
|
|
99
|
+
## š What's New in v2.0
|
|
100
|
+
|
|
101
|
+
- AI commit generation via Google Gemini (opt-in, with graceful fallback).
|
|
102
|
+
- Team presets (`safe-team`, `solo-speed`, `strict-ci`) for different workflows.
|
|
103
|
+
- Safety net with `autopilot undo`, secret detection, and large-file prevention.
|
|
104
|
+
- Productivity Focus Engine with `autopilot insights` and CSV export.
|
|
105
|
+
|
|
93
106
|
---
|
|
94
107
|
|
|
95
108
|
## ā¬ļø Installation
|
|
@@ -100,134 +113,103 @@ Install Autopilot globally using npm:
|
|
|
100
113
|
npm install -g @traisetech/autopilot
|
|
101
114
|
```
|
|
102
115
|
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
## š Quick Start
|
|
106
|
-
|
|
107
|
-
### 1. Initialize
|
|
108
|
-
Navigate to your Git repository and initialize Autopilot:
|
|
116
|
+
Or run it directly via npx:
|
|
109
117
|
|
|
110
118
|
```bash
|
|
111
|
-
|
|
112
|
-
autopilot init
|
|
119
|
+
npx @traisetech/autopilot start
|
|
113
120
|
```
|
|
114
121
|
|
|
115
|
-
|
|
116
|
-
|
|
122
|
+
---
|
|
123
|
+
|
|
124
|
+
## š Quick Start
|
|
117
125
|
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
126
|
+
1. **Navigate to your Git repository:**
|
|
127
|
+
```bash
|
|
128
|
+
cd /path/to/my-project
|
|
129
|
+
```
|
|
121
130
|
|
|
122
|
-
|
|
123
|
-
|
|
131
|
+
2. **Initialize Autopilot:**
|
|
132
|
+
```bash
|
|
133
|
+
autopilot init
|
|
134
|
+
```
|
|
135
|
+
Follow the interactive prompts to configure settings (or accept defaults).
|
|
124
136
|
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
137
|
+
3. **Start the watcher:**
|
|
138
|
+
```bash
|
|
139
|
+
autopilot start
|
|
140
|
+
```
|
|
128
141
|
|
|
129
|
-
|
|
130
|
-
When you're done for the day:
|
|
142
|
+
**Autopilot is now running!** It will monitor file changes and automatically commit/push them based on your configuration.
|
|
131
143
|
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
```
|
|
144
|
+
4. **View the Dashboard (New):**
|
|
145
|
+
Open a new terminal and run:
|
|
146
|
+
```bash
|
|
147
|
+
autopilot dashboard
|
|
148
|
+
```
|
|
135
149
|
|
|
136
150
|
---
|
|
137
151
|
|
|
138
|
-
##
|
|
152
|
+
## š ļø Commands
|
|
139
153
|
|
|
140
154
|
| Command | Description |
|
|
141
155
|
|---------|-------------|
|
|
142
|
-
| `autopilot init` |
|
|
143
|
-
| `autopilot start` |
|
|
144
|
-
| `autopilot stop` |
|
|
145
|
-
| `autopilot status` |
|
|
146
|
-
| `autopilot
|
|
147
|
-
| `autopilot
|
|
156
|
+
| `autopilot init` | Initialize configuration in the current repo. |
|
|
157
|
+
| `autopilot start` | Start the watcher process (foreground). |
|
|
158
|
+
| `autopilot stop` | Stop the running watcher process. |
|
|
159
|
+
| `autopilot status` | Check if Autopilot is running. |
|
|
160
|
+
| `autopilot dashboard` | View real-time status and activity UI. |
|
|
161
|
+
| `autopilot undo` | Revert the last Autopilot commit. |
|
|
162
|
+
| `autopilot pause [reason]` | Temporarily pause automation. |
|
|
163
|
+
| `autopilot resume` | Resume automation. |
|
|
164
|
+
| `autopilot insights` | View productivity stats and analytics. |
|
|
165
|
+
| `autopilot doctor` | Diagnose configuration and environment issues. |
|
|
148
166
|
|
|
149
167
|
---
|
|
150
168
|
|
|
151
169
|
## āļø Configuration
|
|
152
170
|
|
|
153
|
-
Autopilot uses
|
|
171
|
+
Autopilot uses an `.autopilotrc.json` file in your project root.
|
|
154
172
|
|
|
155
173
|
```json
|
|
156
174
|
{
|
|
157
|
-
"
|
|
175
|
+
"debounceSeconds": 20,
|
|
176
|
+
"minSecondsBetweenCommits": 180,
|
|
158
177
|
"autoPush": true,
|
|
159
|
-
"
|
|
160
|
-
"
|
|
161
|
-
"
|
|
162
|
-
|
|
163
|
-
"temp/",
|
|
164
|
-
"dist/",
|
|
165
|
-
"node_modules"
|
|
166
|
-
]
|
|
178
|
+
"blockBranches": ["main", "master"],
|
|
179
|
+
"teamMode": true,
|
|
180
|
+
"preventSecrets": true,
|
|
181
|
+
"maxFileSizeMB": 50
|
|
167
182
|
}
|
|
168
183
|
```
|
|
169
184
|
|
|
170
|
-
|
|
171
|
-
|--------|------|---------|-------------|
|
|
172
|
-
| `minInterval` | number | 30 | Minimum seconds between commits. |
|
|
173
|
-
| `autoPush` | boolean | true | Whether to push changes automatically after commit. |
|
|
174
|
-
| `blockedBranches` | array | `[]` | List of branches to disable auto-commit on. |
|
|
175
|
-
| `requireChecks` | boolean | false | Run custom checks before committing. |
|
|
176
|
-
| `ignore` | array | `[]` | Additional glob patterns to ignore. |
|
|
185
|
+
See [docs/CONFIGURATION.md](docs/CONFIGURATION.md) for full details.
|
|
177
186
|
|
|
178
187
|
---
|
|
179
188
|
|
|
180
189
|
## š”ļø Safety Features
|
|
181
190
|
|
|
182
|
-
Autopilot includes
|
|
191
|
+
Autopilot includes multiple layers of protection:
|
|
183
192
|
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
193
|
+
1. **Branch Protection**: Prevents running on blocked branches (default: `main`, `master`).
|
|
194
|
+
2. **Secret Detection**: Scans for AWS keys, GitHub tokens, and other secrets before committing.
|
|
195
|
+
3. **File Size Limits**: Prevents committing accidental large files (>50MB).
|
|
196
|
+
4. **Team Mode**: Ensures local changes are rebased on top of remote changes to prevent conflicts.
|
|
197
|
+
5. **Undo**: Allows quick recovery from unwanted auto-commits.
|
|
188
198
|
|
|
189
199
|
---
|
|
190
200
|
|
|
191
|
-
##
|
|
192
|
-
|
|
193
|
-
If you encounter issues, run the `doctor` command:
|
|
194
|
-
|
|
195
|
-
```bash
|
|
196
|
-
autopilot doctor
|
|
197
|
-
```
|
|
198
|
-
|
|
199
|
-
This will check for:
|
|
200
|
-
- Git repository status
|
|
201
|
-
- Configuration validity
|
|
202
|
-
- Node.js version
|
|
203
|
-
- Permissions
|
|
204
|
-
- **Common Issue**: If commits aren't triggering, check if you are editing ignored files (e.g. `.vscode`, `node_modules`).
|
|
205
|
-
- **Autopilot detects changes but never commits**: This can happen if files are constantly changing (resetting the debounce timer) or if you are on a blocked branch. Check `autopilot.log` for details.
|
|
206
|
-
|
|
207
|
-
For more details, visit our [Documentation Site](https://autopilot-cli.vercel.app/docs/troubleshooting).
|
|
208
|
-
|
|
209
|
-
---
|
|
210
|
-
|
|
211
|
-
## š§Ŗ Verification (Smoke Test)
|
|
212
|
-
|
|
213
|
-
To verify that Autopilot is working correctly on your machine or in a CI environment, you can run the built-in verification suite. This runs the linter, the doctor diagnostic tool, and the full test suite.
|
|
201
|
+
## š¤ Contributing
|
|
214
202
|
|
|
215
|
-
|
|
216
|
-
# Run the full verification suite
|
|
217
|
-
npm run verify
|
|
218
|
-
```
|
|
203
|
+
We welcome contributions! Please see [CONTRIBUTING.md](CONTRIBUTING.md) for details.
|
|
219
204
|
|
|
220
|
-
|
|
205
|
+
1. Fork the repo
|
|
206
|
+
2. Create a feature branch (`git checkout -b feature/amazing-feature`)
|
|
207
|
+
3. Commit your changes (`git commit -m 'feat: add amazing feature'`)
|
|
208
|
+
4. Push to the branch (`git push origin feature/amazing-feature`)
|
|
209
|
+
5. Open a Pull Request
|
|
221
210
|
|
|
222
211
|
---
|
|
223
212
|
|
|
224
|
-
##
|
|
225
|
-
|
|
226
|
-
Contributions, issues, and feature requests are welcome!
|
|
227
|
-
Feel free to check the [issues page](https://github.com/PraiseTechzw/autopilot-cli/issues).
|
|
228
|
-
|
|
229
|
-
Please read our [Contributing Guide](CONTRIBUTING.md) for details on our code of conduct, and the process for submitting pull requests.
|
|
230
|
-
|
|
231
|
-
## š License
|
|
213
|
+
## š License
|
|
232
214
|
|
|
233
215
|
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
|
package/bin/autopilot.js
CHANGED
|
@@ -5,7 +5,13 @@ const initRepo = require('../src/commands/init');
|
|
|
5
5
|
const startWatcher = require('../src/commands/start');
|
|
6
6
|
const stopWatcher = require('../src/commands/stop');
|
|
7
7
|
const statusWatcher = require('../src/commands/status');
|
|
8
|
+
const undoCommand = require('../src/commands/undo');
|
|
9
|
+
const pauseCommand = require('../src/commands/pause');
|
|
10
|
+
const resumeCommand = require('../src/commands/resume');
|
|
11
|
+
const { insights } = require('../src/commands/insights');
|
|
12
|
+
const { leaderboard } = require('../src/commands/leaderboard');
|
|
8
13
|
const doctor = require('../src/commands/doctor');
|
|
14
|
+
const presetCommand = require('../src/commands/preset');
|
|
9
15
|
const pkg = require('../package.json');
|
|
10
16
|
const logger = require('../src/utils/logger');
|
|
11
17
|
const { checkForUpdate } = require('../src/utils/update-check');
|
|
@@ -16,7 +22,13 @@ const commands = {
|
|
|
16
22
|
start: startWatcher,
|
|
17
23
|
stop: stopWatcher,
|
|
18
24
|
status: statusWatcher,
|
|
19
|
-
|
|
25
|
+
undo: undoCommand,
|
|
26
|
+
pause: pauseCommand,
|
|
27
|
+
resume: resumeCommand,
|
|
28
|
+
insights: insights,
|
|
29
|
+
leaderboard: leaderboard,
|
|
30
|
+
doctor: doctor,
|
|
31
|
+
preset: presetCommand
|
|
20
32
|
};
|
|
21
33
|
|
|
22
34
|
// Runtime assertion to prevent wiring errors
|
|
@@ -56,6 +68,52 @@ program
|
|
|
56
68
|
.description('Show autopilot watcher status')
|
|
57
69
|
.action(statusWatcher);
|
|
58
70
|
|
|
71
|
+
program
|
|
72
|
+
.command('undo')
|
|
73
|
+
.description('Undo the last Autopilot commit')
|
|
74
|
+
.option('-c, --count <n>', 'Number of commits to undo', '1')
|
|
75
|
+
.action(undoCommand);
|
|
76
|
+
|
|
77
|
+
program
|
|
78
|
+
.command('pause [reason]')
|
|
79
|
+
.description('Pause Autopilot watcher')
|
|
80
|
+
.action(pauseCommand);
|
|
81
|
+
|
|
82
|
+
program
|
|
83
|
+
.command('resume')
|
|
84
|
+
.description('Resume Autopilot watcher')
|
|
85
|
+
.action(resumeCommand);
|
|
86
|
+
|
|
87
|
+
program
|
|
88
|
+
.command('dashboard')
|
|
89
|
+
.description('View real-time Autopilot dashboard')
|
|
90
|
+
.action(async () => {
|
|
91
|
+
try {
|
|
92
|
+
const { default: runDashboard } = await import('../src/commands/dashboard.mjs');
|
|
93
|
+
runDashboard();
|
|
94
|
+
} catch (error) {
|
|
95
|
+
console.error('Failed to launch dashboard:', error);
|
|
96
|
+
}
|
|
97
|
+
});
|
|
98
|
+
|
|
99
|
+
program
|
|
100
|
+
.command('insights')
|
|
101
|
+
.description('View productivity insights and focus analytics')
|
|
102
|
+
.option('-f, --format <type>', 'Output format (json, text)', 'text')
|
|
103
|
+
.option('-e, --export <type>', 'Export insights (csv)')
|
|
104
|
+
.action(insights);
|
|
105
|
+
|
|
106
|
+
program
|
|
107
|
+
.command('leaderboard')
|
|
108
|
+
.description('View or sync with the global leaderboard')
|
|
109
|
+
.option('--sync', 'Sync your local stats to the leaderboard')
|
|
110
|
+
.action(leaderboard);
|
|
111
|
+
|
|
112
|
+
program
|
|
113
|
+
.command('preset [action] [name]')
|
|
114
|
+
.description('Manage workflow presets (list, apply)')
|
|
115
|
+
.action(presetCommand);
|
|
116
|
+
|
|
59
117
|
program
|
|
60
118
|
.command('doctor')
|
|
61
119
|
.description('Diagnose and validate autopilot setup')
|
package/docs/CONFIGURATION.md
CHANGED
|
@@ -1,82 +1,100 @@
|
|
|
1
|
-
# Configuration Reference - Autopilot CLI
|
|
2
|
-
|
|
3
|
-
**Built by Praise Masunga (PraiseTechzw)**
|
|
4
|
-
|
|
5
|
-
This document reflects the current `.autopilotrc.json` options.
|
|
6
|
-
|
|
7
|
-
---
|
|
8
|
-
|
|
9
|
-
## File Locations
|
|
10
|
-
|
|
11
|
-
- Config: `.autopilotrc.json` (repo root)
|
|
12
|
-
- Ignore: `.autopilotignore` (repo root)
|
|
13
|
-
|
|
14
|
-
---
|
|
15
|
-
|
|
16
|
-
## Full Example
|
|
17
|
-
|
|
18
|
-
```json
|
|
19
|
-
{
|
|
20
|
-
"debounceSeconds": 20,
|
|
21
|
-
"minSecondsBetweenCommits": 180,
|
|
22
|
-
"autoPush": true,
|
|
23
|
-
"blockBranches": ["main", "master"],
|
|
24
|
-
"requireChecks": false,
|
|
25
|
-
"checks": ["npm test"],
|
|
26
|
-
"commitMessageMode": "smart"
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
- **
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
- **
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
- **
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
- **
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
- **
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
- **
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
1
|
+
# Configuration Reference - Autopilot CLI
|
|
2
|
+
|
|
3
|
+
**Built by Praise Masunga (PraiseTechzw)**
|
|
4
|
+
|
|
5
|
+
This document reflects the current `.autopilotrc.json` options.
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## File Locations
|
|
10
|
+
|
|
11
|
+
- Config: `.autopilotrc.json` (repo root)
|
|
12
|
+
- Ignore: `.autopilotignore` (repo root)
|
|
13
|
+
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
## Full Example
|
|
17
|
+
|
|
18
|
+
```json
|
|
19
|
+
{
|
|
20
|
+
"debounceSeconds": 20,
|
|
21
|
+
"minSecondsBetweenCommits": 180,
|
|
22
|
+
"autoPush": true,
|
|
23
|
+
"blockBranches": ["main", "master"],
|
|
24
|
+
"requireChecks": false,
|
|
25
|
+
"checks": ["npm test"],
|
|
26
|
+
"commitMessageMode": "smart",
|
|
27
|
+
"teamMode": false,
|
|
28
|
+
"maxFileSizeMB": 50,
|
|
29
|
+
"preventSecrets": true
|
|
30
|
+
}
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
---
|
|
34
|
+
|
|
35
|
+
## Settings
|
|
36
|
+
|
|
37
|
+
### `debounceSeconds`
|
|
38
|
+
- **Type:** number
|
|
39
|
+
- **Default:** 20
|
|
40
|
+
- **Description:** Wait time after the last file change before checking git status.
|
|
41
|
+
|
|
42
|
+
### `minSecondsBetweenCommits`
|
|
43
|
+
- **Type:** number
|
|
44
|
+
- **Default:** 180
|
|
45
|
+
- **Description:** Minimum time between commits (anti-spam).
|
|
46
|
+
|
|
47
|
+
### `autoPush`
|
|
48
|
+
- **Type:** boolean
|
|
49
|
+
- **Default:** true
|
|
50
|
+
- **Description:** Push to `origin/<branch>` after commit.
|
|
51
|
+
|
|
52
|
+
### `blockBranches`
|
|
53
|
+
- **Type:** string[]
|
|
54
|
+
- **Default:** `["main", "master"]`
|
|
55
|
+
- **Description:** Branches where auto-commit is disabled.
|
|
56
|
+
|
|
57
|
+
### `requireChecks`
|
|
58
|
+
- **Type:** boolean
|
|
59
|
+
- **Default:** false
|
|
60
|
+
- **Description:** Run checks before commit. If any fail, commit is skipped.
|
|
61
|
+
|
|
62
|
+
### `checks`
|
|
63
|
+
- **Type:** string[]
|
|
64
|
+
- **Default:** `[]`
|
|
65
|
+
- **Description:** Shell commands executed sequentially when `requireChecks` is true.
|
|
66
|
+
|
|
67
|
+
### `commitMessageMode`
|
|
68
|
+
- **Type:** `"smart" | "simple"`
|
|
69
|
+
- **Default:** `"smart"`
|
|
70
|
+
- **Description:** Smart uses file-based conventional commit messages; simple uses `chore: update changes`.
|
|
71
|
+
|
|
72
|
+
### `teamMode`
|
|
73
|
+
- **Type:** boolean
|
|
74
|
+
- **Default:** `false`
|
|
75
|
+
- **Description:** Enables pull-before-push and stricter conflict handling. Recommended for collaborative environments.
|
|
76
|
+
|
|
77
|
+
### `maxFileSizeMB`
|
|
78
|
+
- **Type:** number
|
|
79
|
+
- **Default:** `50`
|
|
80
|
+
- **Description:** Prevents committing files larger than this size (in MB).
|
|
81
|
+
|
|
82
|
+
### `preventSecrets`
|
|
83
|
+
- **Type:** boolean
|
|
84
|
+
- **Default:** `true`
|
|
85
|
+
- **Description:** Scans staged files for common secret patterns (AWS keys, GitHub tokens) before committing.
|
|
86
|
+
|
|
87
|
+
---
|
|
88
|
+
|
|
89
|
+
## Ignore File (.autopilotignore)
|
|
90
|
+
|
|
91
|
+
Gitignore-style patterns. Example:
|
|
92
|
+
|
|
93
|
+
```
|
|
94
|
+
node_modules/
|
|
95
|
+
dist/
|
|
96
|
+
.env
|
|
97
|
+
*.log
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
Autopilot also always ignores `.git`, `.autopilot.pid`, and `autopilot.log`.
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
# š„ Team Mode
|
|
2
|
+
|
|
3
|
+
Autopilot V2 introduces **Team Mode**, designed to make automated Git workflows safe and efficient for collaborative environments.
|
|
4
|
+
|
|
5
|
+
## How it Works
|
|
6
|
+
|
|
7
|
+
When `teamMode` is enabled in your configuration, Autopilot changes its behavior to prioritize synchronization and conflict prevention.
|
|
8
|
+
|
|
9
|
+
### Key Behaviors
|
|
10
|
+
|
|
11
|
+
1. **Pull-Before-Push**:
|
|
12
|
+
Before attempting to push any local commits, Autopilot automatically runs `git pull --rebase`. This ensures your local branch is up-to-date with the remote, minimizing merge conflicts.
|
|
13
|
+
|
|
14
|
+
2. **Conflict Abortion**:
|
|
15
|
+
If a pull operation detects conflicts, Autopilot **immediately aborts** the automation loop. It will not attempt to commit or push until you manually resolve the conflicts.
|
|
16
|
+
- **Status**: The watcher enters a "Stopped" or error state.
|
|
17
|
+
- **Notification**: You will see an error message in the logs/dashboard.
|
|
18
|
+
|
|
19
|
+
3. **Remote Status Checks**:
|
|
20
|
+
Autopilot frequently checks the remote repository status to detect if your local branch has diverged.
|
|
21
|
+
|
|
22
|
+
## Enabling Team Mode
|
|
23
|
+
|
|
24
|
+
To enable Team Mode, run:
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
autopilot init
|
|
28
|
+
```
|
|
29
|
+
And select "Yes" when asked "Enable team mode? (pull before push)".
|
|
30
|
+
|
|
31
|
+
Or manually edit your `.autopilotrc.json`:
|
|
32
|
+
|
|
33
|
+
```json
|
|
34
|
+
{
|
|
35
|
+
"teamMode": true
|
|
36
|
+
}
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
## Best Practices for Teams
|
|
40
|
+
|
|
41
|
+
- **Short Commit Intervals**: Set `commitInterval` to a lower value (e.g., 5-10 minutes) to reduce the chance of large conflicts.
|
|
42
|
+
- **Feature Branches**: Continue to use feature branches (`feat/my-feature`). Autopilot works best on feature branches, leaving `main` or `develop` protected.
|
|
43
|
+
- **Dashboard Monitoring**: Use `autopilot dashboard` to keep an eye on the automation status and pending changes.
|
|
44
|
+
|
|
45
|
+
## Troubleshooting
|
|
46
|
+
|
|
47
|
+
If Autopilot stops due to a conflict:
|
|
48
|
+
1. Run `git status` to see the conflict.
|
|
49
|
+
2. Resolve the conflicts manually.
|
|
50
|
+
3. Run `git add .` and `git rebase --continue`.
|
|
51
|
+
4. Restart Autopilot with `autopilot start`.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@traisetech/autopilot",
|
|
3
|
-
"version": "0.1
|
|
3
|
+
"version": "2.0.1",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -36,7 +36,9 @@
|
|
|
36
36
|
"lint": "node -c bin/autopilot.js && node -c src/index.js",
|
|
37
37
|
"verify": "node bin/autopilot.js --help && node bin/autopilot.js doctor && node --test",
|
|
38
38
|
"prepublishOnly": "npm run verify",
|
|
39
|
-
"release:patch": "npm run verify && npm version patch && git push --follow-tags && echo \"\nš
|
|
39
|
+
"release:patch": "npm run verify && npm version patch && git push --follow-tags && echo \"\nš Release initiated! GitHub Action will publish to NPM.\"",
|
|
40
|
+
"release:minor": "npm run verify && npm version minor && git push --follow-tags && echo \"\nš Release initiated! GitHub Action will publish to NPM.\"",
|
|
41
|
+
"release:major": "npm run verify && npm version major && git push --follow-tags && echo \"\nš Release initiated! GitHub Action will publish to NPM.\""
|
|
40
42
|
},
|
|
41
43
|
"engines": {
|
|
42
44
|
"node": ">=18.0.0"
|
|
@@ -51,9 +53,17 @@
|
|
|
51
53
|
"homepage": "https://github.com/PraiseTechzw/autopilot-cli#readme",
|
|
52
54
|
"dependencies": {
|
|
53
55
|
"@traisetech/autopilot": "^0.1.7",
|
|
54
|
-
"chokidar": "^
|
|
56
|
+
"chokidar": "^3.6.0",
|
|
55
57
|
"commander": "^14.0.3",
|
|
58
|
+
"csv-writer": "^1.6.0",
|
|
56
59
|
"execa": "^5.1.1",
|
|
57
|
-
"fs-extra": "^11.3.3"
|
|
60
|
+
"fs-extra": "^11.3.3",
|
|
61
|
+
"ink": "^6.6.0",
|
|
62
|
+
"ink-big-text": "^2.0.0",
|
|
63
|
+
"ink-gradient": "^4.0.0",
|
|
64
|
+
"ink-spinner": "^5.0.0",
|
|
65
|
+
"open": "^11.0.0",
|
|
66
|
+
"prop-types": "^15.8.1",
|
|
67
|
+
"react": "^19.2.4"
|
|
58
68
|
}
|
|
59
69
|
}
|