@traisetech/autopilot 2.0.1 → 2.1.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 +56 -6
- package/README.md +202 -215
- package/bin/autopilot.js +9 -1
- package/docs/DESIGN_PRINCIPLES.md +114 -0
- package/package.json +69 -69
- package/src/commands/config.js +110 -0
- package/src/commands/dashboard.mjs +22 -15
- package/src/commands/doctor.js +14 -4
- package/src/commands/init.js +29 -7
- package/src/commands/insights.js +52 -46
- package/src/commands/leaderboard.js +49 -10
- package/src/config/defaults.js +5 -2
- package/src/config/ignore.js +10 -10
- package/src/config/loader.js +36 -10
- package/src/core/commit.js +41 -6
- package/src/core/events.js +105 -0
- package/src/core/git.js +41 -3
- package/src/core/grok.js +109 -0
- package/src/core/safety.js +6 -0
- package/src/core/watcher.js +30 -2
- package/src/index.js +8 -2
- package/src/utils/crypto.js +18 -0
- package/src/utils/identity.js +41 -0
- package/src/utils/logger.js +7 -7
- package/src/utils/paths.js +3 -0
package/CHANGELOG.md
CHANGED
|
@@ -3,12 +3,62 @@
|
|
|
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.
|
|
7
|
-
|
|
8
|
-
###
|
|
9
|
-
- **
|
|
10
|
-
-
|
|
11
|
-
|
|
6
|
+
## [2.1.1] - 2026-02-11
|
|
7
|
+
|
|
8
|
+
### Added
|
|
9
|
+
- **Global Leaderboard Sync**:
|
|
10
|
+
- New `autopilot leaderboard --sync` command to share productivity metrics with the global community.
|
|
11
|
+
- Implemented secure, anonymized data transmission (metrics only, no code).
|
|
12
|
+
- **Dynamic Leaderboard Dashboard**:
|
|
13
|
+
- Completely redesigned `autopilot-docs` leaderboard with real-time analytics.
|
|
14
|
+
- Real-time aggregation of global commits, focus hours, and active streaks.
|
|
15
|
+
- Premium glassmorphism UI with live ranking updates.
|
|
16
|
+
|
|
17
|
+
### Improved
|
|
18
|
+
- **CLI Aesthetics**:
|
|
19
|
+
- Integrated full ANSI color support for the `logger` utility for more professional output.
|
|
20
|
+
- Improved visual hierarchy with bold section headers and color-coded status icons.
|
|
21
|
+
- **Diagnostics**:
|
|
22
|
+
- Enhanced `doctor` command to intelligently check for `credential.helper` validation on HTTPS remotes.
|
|
23
|
+
- **Insights Portability**:
|
|
24
|
+
- Refined Git log parsing to be more robust across different Git versions and configurations.
|
|
25
|
+
|
|
26
|
+
### Fixed
|
|
27
|
+
- **Dashboard Stability**:
|
|
28
|
+
- Fixed "Duplicate Key" warning in the interactive React Ink dashboard.
|
|
29
|
+
- Added TTY-detection to prevent crashes in non-interactive environments (CI/CD, background).
|
|
30
|
+
- Fixed ESM/CommonJS compatibility issues using dynamic `import()` for the dashboard.
|
|
31
|
+
- **Test Integrity**:
|
|
32
|
+
- Implemented `AUTOPILOT_TEST_MODE` bypass for automated dashboard verification.
|
|
33
|
+
- Fixed cross-test contamination and EBUSY errors on Windows platforms.
|
|
34
|
+
|
|
35
|
+
## [2.1.0] - 2026-02-08
|
|
36
|
+
|
|
37
|
+
### Added
|
|
38
|
+
- **Global Configuration**:
|
|
39
|
+
- Added support for global config via `~/.autopilot/config.json`.
|
|
40
|
+
- Added `--global` flag to `autopilot config` command.
|
|
41
|
+
- Implemented config merging (Local > Global > Defaults).
|
|
42
|
+
- **xAI Grok Integration**:
|
|
43
|
+
- Added Grok as a supported AI provider for commit message generation.
|
|
44
|
+
- Configurable via `ai.provider: 'grok'` and `grokApiKey`.
|
|
45
|
+
- **Safety**:
|
|
46
|
+
- Watcher now automatically pauses on push failures to prevent error loops.
|
|
47
|
+
- Added "Push Failed" state to StateManager.
|
|
48
|
+
- **Leaderboard**:
|
|
49
|
+
- Implemented accurate focus time calculation by parsing `autopilot.log`.
|
|
50
|
+
- Fallback to git stats for proxy metrics if logs are missing.
|
|
51
|
+
|
|
52
|
+
### Fixed
|
|
53
|
+
- **Test Suite**: Resolved cross-test contamination in config tests and watcher integration tests.
|
|
54
|
+
- **Windows Compatibility**: Fixed issues with `process.cwd()` mocking in tests on Windows.
|
|
55
|
+
|
|
56
|
+
## [2.0.1] - 2026-02-05
|
|
57
|
+
|
|
58
|
+
### Fixed
|
|
59
|
+
- **Dashboard Stability**: Fixed a crash in `autopilot dashboard` caused by incorrect named import of `getRunningPid`.
|
|
60
|
+
- **Command Reliability**: Added regression tests for `dashboard`, `pause`, `resume`, `stop`, and `status` commands to ensure stability.
|
|
61
|
+
|
|
12
62
|
## [2.0.0] - 2026-02-04
|
|
13
63
|
|
|
14
64
|
### Added
|
package/README.md
CHANGED
|
@@ -1,215 +1,202 @@
|
|
|
1
|
-
# 🚀 Autopilot
|
|
2
|
-
|
|
3
|
-
<div align="center">
|
|
4
|
-
|
|
5
|
-

|
|
6
|
-
|
|
7
|
-
**
|
|
8
|
-
|
|
9
|
-
[](https://www.npmjs.com/package/@traisetech/autopilot)
|
|
10
|
-
[](https://opensource.org/licenses/MIT)
|
|
11
|
-
[](https://nodejs.org)
|
|
12
|
-
[](https://www.npmjs.com/package/@traisetech/autopilot)
|
|
13
|
-
[](https://github.com/PraiseTechzw/autopilot-cli/stargazers)
|
|
14
|
-
[](https://github.com/PraiseTechzw/autopilot-cli/actions)
|
|
15
|
-
[](http://makeapullrequest.com)
|
|
16
|
-
|
|
17
|
-
**Built by [Praise Masunga](https://github.com/PraiseTechzw) (PraiseTechzw)**
|
|
18
|
-
|
|
19
|
-
[Features](#-features) • [Installation](#-installation) • [
|
|
20
|
-
|
|
21
|
-
</div>
|
|
22
|
-
|
|
23
|
-
---
|
|
24
|
-
|
|
25
|
-
## 📖 Table of Contents
|
|
26
|
-
|
|
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
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
-
|
|
87
|
-
-
|
|
88
|
-
-
|
|
89
|
-
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
```
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
|
155
|
-
|
|
156
|
-
| `autopilot
|
|
157
|
-
| `autopilot
|
|
158
|
-
| `autopilot
|
|
159
|
-
| `autopilot
|
|
160
|
-
| `autopilot
|
|
161
|
-
| `autopilot
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
"
|
|
176
|
-
"
|
|
177
|
-
"
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
We welcome contributions! Please see [CONTRIBUTING.md](CONTRIBUTING.md) for details.
|
|
204
|
-
|
|
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
|
|
210
|
-
|
|
211
|
-
---
|
|
212
|
-
|
|
213
|
-
## 📄 License
|
|
214
|
-
|
|
215
|
-
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
|
|
1
|
+
# 🚀 Autopilot
|
|
2
|
+
|
|
3
|
+
<div align="center">
|
|
4
|
+
|
|
5
|
+

|
|
6
|
+
|
|
7
|
+
**An intelligent Git automation CLI that safely commits and pushes your code so you can focus on building.**
|
|
8
|
+
|
|
9
|
+
[](https://www.npmjs.com/package/@traisetech/autopilot)
|
|
10
|
+
[](https://opensource.org/licenses/MIT)
|
|
11
|
+
[](https://nodejs.org)
|
|
12
|
+
[](https://www.npmjs.com/package/@traisetech/autopilot)
|
|
13
|
+
[](https://github.com/PraiseTechzw/autopilot-cli/stargazers)
|
|
14
|
+
[](https://github.com/PraiseTechzw/autopilot-cli/actions)
|
|
15
|
+
[](http://makeapullrequest.com)
|
|
16
|
+
|
|
17
|
+
**Built by [Praise Masunga](https://github.com/PraiseTechzw) (PraiseTechzw)**
|
|
18
|
+
|
|
19
|
+
[Features](#-features) • [Installation](#-installation) • [How It Works](#-how-autopilot-works) • [Safety & Guarantees](#-safety--guarantees) • [Commands](#-commands)
|
|
20
|
+
|
|
21
|
+
</div>
|
|
22
|
+
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
## 📖 Table of Contents
|
|
26
|
+
|
|
27
|
+
- [How Autopilot Works](#-how-autopilot-works)
|
|
28
|
+
- [Safety & Guarantees](#-safety--guarantees)
|
|
29
|
+
- [Failure & Recovery](#-failure--recovery)
|
|
30
|
+
- [AI & Privacy](#-ai--privacy)
|
|
31
|
+
- [Leaderboard & Metrics](#-leaderboard--metrics)
|
|
32
|
+
- [Installation](#-installation)
|
|
33
|
+
- [Quick Start](#-quick-start)
|
|
34
|
+
- [Commands](#-commands)
|
|
35
|
+
- [Configuration](#-configuration)
|
|
36
|
+
- [Contributing](#-contributing)
|
|
37
|
+
- [License](#-license)
|
|
38
|
+
|
|
39
|
+
---
|
|
40
|
+
|
|
41
|
+
## 🔍 How Autopilot Works
|
|
42
|
+
|
|
43
|
+
Autopilot is a local CLI tool that runs in the background of your terminal. It watches your file system for changes and automates the Git workflow based on your configuration.
|
|
44
|
+
|
|
45
|
+
**No Magic. Just Automation.**
|
|
46
|
+
|
|
47
|
+
1. **Watch**: It monitors your project directory for file modifications, creations, and deletions.
|
|
48
|
+
2. **Wait**: It uses a smart debounce timer (default: 20s) to wait until you stop typing.
|
|
49
|
+
3. **Check**: It verifies the repository status (branch, remote, conflicts) before acting.
|
|
50
|
+
4. **Commit**: It stages changes and creates a commit. If AI is enabled, it generates a meaningful message; otherwise, it uses a smart template.
|
|
51
|
+
5. **Push**: It pushes to your remote repository (optional, enabled by default).
|
|
52
|
+
|
|
53
|
+
You can stop, pause, or undo Autopilot at any time.
|
|
54
|
+
|
|
55
|
+
---
|
|
56
|
+
|
|
57
|
+
## 🛡️ Safety & Guarantees
|
|
58
|
+
|
|
59
|
+
We prioritize the safety of your code above all else. Autopilot follows strict rules to ensure your work is never lost or corrupted.
|
|
60
|
+
|
|
61
|
+
### Non-Negotiable Guarantees
|
|
62
|
+
|
|
63
|
+
- **Never force-pushes**: Autopilot only performs standard `git push` operations. It will never overwrite remote history.
|
|
64
|
+
- **Never commits ignored files**: It strictly respects your `.gitignore` and `.autopilotignore` rules.
|
|
65
|
+
- **Never operates during merge/rebase**: If your repo is in a merge, rebase, or cherry-pick state, Autopilot pauses automatically.
|
|
66
|
+
- **Never transmits source code without opt-in**: Your code stays local. It is only sent to an AI provider (Gemini/Grok) if you explicitly enable AI features and provide your own API key.
|
|
67
|
+
- **Pauses when uncertain**: If a git error occurs, a conflict is detected, or the network fails, Autopilot pauses and waits for your intervention.
|
|
68
|
+
- **Allows all actions to be undone**: The `autopilot undo` command safely reverts the last automated commit without losing your file changes.
|
|
69
|
+
|
|
70
|
+
---
|
|
71
|
+
|
|
72
|
+
## ⚠️ Failure & Recovery
|
|
73
|
+
|
|
74
|
+
What happens when things go wrong? Autopilot is designed to fail safely.
|
|
75
|
+
|
|
76
|
+
- **Merge Conflicts**: If a `git pull` results in a conflict, Autopilot aborts the operation and notifies you. It will not attempt to resolve conflicts automatically.
|
|
77
|
+
- **Network Issues**: If the internet disconnects, Autopilot will queue commits locally and attempt to push when connectivity is restored (if auto-push is enabled).
|
|
78
|
+
- **Accidental Commits**: If Autopilot commits something you didn't intend, simply run `autopilot undo`. Your files will remain modified in your working directory, but the commit will be removed.
|
|
79
|
+
|
|
80
|
+
---
|
|
81
|
+
|
|
82
|
+
## 🤖 AI & Privacy
|
|
83
|
+
|
|
84
|
+
Autopilot offers **optional** AI integration (Google Gemini or xAI Grok) to generate context-aware commit messages.
|
|
85
|
+
|
|
86
|
+
- **Opt-In Only**: AI features are disabled by default. You must enable them and provide your own API key.
|
|
87
|
+
- **Data Usage**: When enabled, only the `git diff` (text changes) is sent to the AI provider to generate the message.
|
|
88
|
+
- **Privacy**: Your code is not trained on by Autopilot. We do not store or proxy your code. Interactions are directly between your machine and the AI provider.
|
|
89
|
+
- **Ranking**: AI usage does not affect your position on the Leaderboard.
|
|
90
|
+
|
|
91
|
+
---
|
|
92
|
+
|
|
93
|
+
## 🏆 Leaderboard & Metrics
|
|
94
|
+
|
|
95
|
+
Autopilot includes a Focus Engine that tracks your local productivity (coding time, commit streaks). You can optionally sync this data to the global Leaderboard.
|
|
96
|
+
|
|
97
|
+
- **Participation is Opt-In**: You must explicitly enable syncing with `autopilot config set leaderboard.sync true`.
|
|
98
|
+
- **Privacy-Safe**: We do not send your email or username directly. IDs are hashed/anonymized.
|
|
99
|
+
- **No Code Collected**: The leaderboard tracks *metrics* (time, counts), not code. No file contents are ever synced.
|
|
100
|
+
- **Insight over Competition**: The goal is to help you understand your habits, not to gamify commit spam. Rankings favor consistency and quality.
|
|
101
|
+
|
|
102
|
+
---
|
|
103
|
+
|
|
104
|
+
## ⬇️ Installation
|
|
105
|
+
|
|
106
|
+
Install Autopilot globally using npm:
|
|
107
|
+
|
|
108
|
+
```bash
|
|
109
|
+
npm install -g @traisetech/autopilot
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
Or run it directly via npx:
|
|
113
|
+
|
|
114
|
+
```bash
|
|
115
|
+
npx @traisetech/autopilot start
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
---
|
|
119
|
+
|
|
120
|
+
## 🚀 Quick Start
|
|
121
|
+
|
|
122
|
+
1. **Navigate to your Git repository:**
|
|
123
|
+
```bash
|
|
124
|
+
cd /path/to/my-project
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
2. **Initialize Autopilot:**
|
|
128
|
+
```bash
|
|
129
|
+
autopilot init
|
|
130
|
+
```
|
|
131
|
+
Follow the interactive prompts to configure settings (or accept defaults).
|
|
132
|
+
|
|
133
|
+
3. **Start the watcher:**
|
|
134
|
+
```bash
|
|
135
|
+
autopilot start
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
**Autopilot is now running!** It will monitor file changes and automatically commit/push them based on your configuration.
|
|
139
|
+
|
|
140
|
+
4. **View the Dashboard:**
|
|
141
|
+
Open a new terminal and run:
|
|
142
|
+
```bash
|
|
143
|
+
autopilot dashboard
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
---
|
|
147
|
+
|
|
148
|
+
## 🛠️ Commands
|
|
149
|
+
|
|
150
|
+
| Command | Description |
|
|
151
|
+
|---------|-------------|
|
|
152
|
+
| `autopilot init` | Initialize configuration in the current repo. |
|
|
153
|
+
| `autopilot start` | Start the watcher process (foreground). |
|
|
154
|
+
| `autopilot stop` | Stop the running watcher process. |
|
|
155
|
+
| `autopilot status` | Check if Autopilot is running. |
|
|
156
|
+
| `autopilot dashboard` | View real-time status and activity UI. |
|
|
157
|
+
| `autopilot undo` | Revert the last Autopilot commit. |
|
|
158
|
+
| `autopilot pause` | Temporarily pause automation. |
|
|
159
|
+
| `autopilot resume` | Resume automation. |
|
|
160
|
+
| `autopilot insights` | View productivity stats and analytics. |
|
|
161
|
+
| `autopilot doctor` | Diagnose configuration and environment issues. |
|
|
162
|
+
|
|
163
|
+
---
|
|
164
|
+
|
|
165
|
+
## ⚙️ Configuration
|
|
166
|
+
|
|
167
|
+
Autopilot uses an `.autopilotrc.json` file in your project root.
|
|
168
|
+
|
|
169
|
+
```json
|
|
170
|
+
{
|
|
171
|
+
"debounceSeconds": 20,
|
|
172
|
+
"minSecondsBetweenCommits": 180,
|
|
173
|
+
"autoPush": true,
|
|
174
|
+
"blockBranches": ["main", "master"],
|
|
175
|
+
"teamMode": true,
|
|
176
|
+
"preventSecrets": true,
|
|
177
|
+
"ai": {
|
|
178
|
+
"enabled": true,
|
|
179
|
+
"provider": "gemini"
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
See [docs/CONFIGURATION.md](docs/CONFIGURATION.md) for full details.
|
|
185
|
+
|
|
186
|
+
---
|
|
187
|
+
|
|
188
|
+
## 🤝 Contributing
|
|
189
|
+
|
|
190
|
+
We welcome contributions! Please see [CONTRIBUTING.md](CONTRIBUTING.md) for details.
|
|
191
|
+
|
|
192
|
+
1. Fork the repo
|
|
193
|
+
2. Create a feature branch (`git checkout -b feature/amazing-feature`)
|
|
194
|
+
3. Commit your changes (`git commit -m 'feat: add amazing feature'`)
|
|
195
|
+
4. Push to the branch (`git push origin feature/amazing-feature`)
|
|
196
|
+
5. Open a Pull Request
|
|
197
|
+
|
|
198
|
+
---
|
|
199
|
+
|
|
200
|
+
## 📄 License
|
|
201
|
+
|
|
202
|
+
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
|
package/bin/autopilot.js
CHANGED
|
@@ -12,6 +12,7 @@ const { insights } = require('../src/commands/insights');
|
|
|
12
12
|
const { leaderboard } = require('../src/commands/leaderboard');
|
|
13
13
|
const doctor = require('../src/commands/doctor');
|
|
14
14
|
const presetCommand = require('../src/commands/preset');
|
|
15
|
+
const configCommand = require('../src/commands/config');
|
|
15
16
|
const pkg = require('../package.json');
|
|
16
17
|
const logger = require('../src/utils/logger');
|
|
17
18
|
const { checkForUpdate } = require('../src/utils/update-check');
|
|
@@ -28,7 +29,8 @@ const commands = {
|
|
|
28
29
|
insights: insights,
|
|
29
30
|
leaderboard: leaderboard,
|
|
30
31
|
doctor: doctor,
|
|
31
|
-
preset: presetCommand
|
|
32
|
+
preset: presetCommand,
|
|
33
|
+
config: configCommand
|
|
32
34
|
};
|
|
33
35
|
|
|
34
36
|
// Runtime assertion to prevent wiring errors
|
|
@@ -114,6 +116,12 @@ program
|
|
|
114
116
|
.description('Manage workflow presets (list, apply)')
|
|
115
117
|
.action(presetCommand);
|
|
116
118
|
|
|
119
|
+
program
|
|
120
|
+
.command('config [action] [key] [value]')
|
|
121
|
+
.description('Manage configuration (list, get, set)')
|
|
122
|
+
.option('-g, --global', 'Use global configuration')
|
|
123
|
+
.action(configCommand);
|
|
124
|
+
|
|
117
125
|
program
|
|
118
126
|
.command('doctor')
|
|
119
127
|
.description('Diagnose and validate autopilot setup')
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
# Autopilot CLI – System / Design Prompt
|
|
2
|
+
|
|
3
|
+
This document serves as the design + behavior contract for Autopilot CLI. It guides internal logic, AI integrations, future contributors, and decision-making.
|
|
4
|
+
|
|
5
|
+
## Core Principles
|
|
6
|
+
|
|
7
|
+
- **Autopilot CLI is a local-first, developer-trust-first Git automation tool.**
|
|
8
|
+
- Its primary goal is to reduce Git friction without reducing developer control.
|
|
9
|
+
- The tool must always prioritize **safety, predictability, and transparency** over convenience.
|
|
10
|
+
- Autopilot automates repetitive Git tasks, not developer intent.
|
|
11
|
+
- Autopilot must never surprise the user.
|
|
12
|
+
- Autopilot must fail loudly, pause safely, and never guess during ambiguity.
|
|
13
|
+
|
|
14
|
+
## Hard Guarantees (Non-Negotiable)
|
|
15
|
+
|
|
16
|
+
Autopilot will **never**:
|
|
17
|
+
|
|
18
|
+
- force-push
|
|
19
|
+
- commit ignored files
|
|
20
|
+
- commit `.env`, secrets, or sensitive files
|
|
21
|
+
- operate during merge or rebase states
|
|
22
|
+
- send source code externally without explicit opt-in
|
|
23
|
+
|
|
24
|
+
All automation is **reversible** via `autopilot undo`.
|
|
25
|
+
|
|
26
|
+
## Failure Behavior
|
|
27
|
+
|
|
28
|
+
- If a **push fails** → pause watcher, notify user.
|
|
29
|
+
- If **authentication expires** → pause watcher.
|
|
30
|
+
- If **merge conflicts** are detected → stop automation.
|
|
31
|
+
- If **network is unavailable** → queue safely or pause.
|
|
32
|
+
- If **repository state is ambiguous** → do nothing.
|
|
33
|
+
|
|
34
|
+
## Commit Intelligence
|
|
35
|
+
|
|
36
|
+
- Commit messages must:
|
|
37
|
+
- be deterministic and explainable
|
|
38
|
+
- reflect file-level changes
|
|
39
|
+
- follow conventional commit standards when possible
|
|
40
|
+
- **AI (Gemini / Grok)** is an assistant, never an authority.
|
|
41
|
+
- AI output must be reviewable, overridable, and optional.
|
|
42
|
+
|
|
43
|
+
## Privacy & Local-First Design
|
|
44
|
+
|
|
45
|
+
**Privacy Guarantees:**
|
|
46
|
+
- Your source code **never** leaves your machine
|
|
47
|
+
- No code diffs are transmitted externally
|
|
48
|
+
- No file contents are sent to remote servers
|
|
49
|
+
- AI commit message generation happens with metadata only (file paths, line counts, not actual code)
|
|
50
|
+
|
|
51
|
+
**Local-First Architecture:**
|
|
52
|
+
- Works 100% offline (except for git push operations)
|
|
53
|
+
- No authentication to external services required
|
|
54
|
+
- All data stored locally in your project
|
|
55
|
+
- Configuration is local and version-controllable
|
|
56
|
+
|
|
57
|
+
## Leaderboard & Metrics
|
|
58
|
+
|
|
59
|
+
- Metrics are derived **only** from local Git activity created by Autopilot.
|
|
60
|
+
- **No raw code, diffs, or file contents are ever transmitted.**
|
|
61
|
+
- Leaderboard data is:
|
|
62
|
+
- opt-in (disabled by default)
|
|
63
|
+
- anonymized or pseudonymous
|
|
64
|
+
- explainable (users know exactly what is counted)
|
|
65
|
+
- aggregate only (commit counts, focus time, streak days)
|
|
66
|
+
|
|
67
|
+
**What gets synced (if opted in):**
|
|
68
|
+
- ✅ Commit counts
|
|
69
|
+
- ✅ Focus time duration
|
|
70
|
+
- ✅ Streak days
|
|
71
|
+
- ✅ Anonymized username/identifier
|
|
72
|
+
|
|
73
|
+
**What never gets synced:**
|
|
74
|
+
- ❌ Source code
|
|
75
|
+
- ❌ File names or paths
|
|
76
|
+
- ❌ Commit messages
|
|
77
|
+
- ❌ Repository names
|
|
78
|
+
- ❌ File diffs or changes
|
|
79
|
+
|
|
80
|
+
## User Experience Philosophy
|
|
81
|
+
|
|
82
|
+
**When in Doubt: Pause, Explain, Wait**
|
|
83
|
+
|
|
84
|
+
- Ambiguous situations should trigger clear, actionable error messages
|
|
85
|
+
- Users should always understand what Autopilot is doing and why
|
|
86
|
+
- Status messages should be informative without being verbose
|
|
87
|
+
- Configuration should have sensible defaults but be fully customizable
|
|
88
|
+
|
|
89
|
+
**Trust Through Transparency:**
|
|
90
|
+
- Every action Autopilot takes should be logged
|
|
91
|
+
- Users should be able to audit what happened and when
|
|
92
|
+
- The system should explain its decisions in plain language
|
|
93
|
+
- Documentation should be honest about limitations
|
|
94
|
+
|
|
95
|
+
## Development Guidelines
|
|
96
|
+
|
|
97
|
+
**For Contributors:**
|
|
98
|
+
- Any feature must pass the "trust test" - would you trust this with your production code?
|
|
99
|
+
- Prefer explicit over implicit behavior
|
|
100
|
+
- Add clear error messages for every failure case
|
|
101
|
+
- Document why, not just what
|
|
102
|
+
- Test edge cases extensively, especially around git state
|
|
103
|
+
|
|
104
|
+
**For AI Integration:**
|
|
105
|
+
- AI should enhance, not replace, developer judgment
|
|
106
|
+
- All AI suggestions must be reviewable before commit
|
|
107
|
+
- Provide escape hatches for AI-generated content
|
|
108
|
+
- Log AI usage for transparency
|
|
109
|
+
- Allow disabling AI features entirely
|
|
110
|
+
|
|
111
|
+
---
|
|
112
|
+
|
|
113
|
+
*Any feature (including Grok or leaderboards) must pass this test: Does it maintain developer trust, safety, and control?*
|
|
114
|
+
|