mindcontext-cli 0.1.0

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/README.md ADDED
@@ -0,0 +1,342 @@
1
+ # mindcontext
2
+
3
+ Git-based project progress tracker for Claude Code. Track progress across multiple projects and machines without merge conflicts.
4
+
5
+ ## Features
6
+
7
+ - **Zero merge conflicts** - Machine-unique timestamped files, not a single state file
8
+ - **Multi-project dashboard** - See all your projects in one place
9
+ - **Offline-first** - Works locally, syncs when online
10
+ - **OpenSpec integration** - Auto-detects tasks and progress from `openspec/changes/`
11
+ - **Claude Code integration** - Generated commands for session context loading
12
+
13
+ ## Installation
14
+
15
+ ```bash
16
+ npm install -g mindcontext
17
+ ```
18
+
19
+ Requires Node.js 18+.
20
+
21
+ ## Quick Start
22
+
23
+ ### One-time setup
24
+
25
+ ```bash
26
+ # Initialize mindcontext
27
+ mc init
28
+
29
+ # When prompted, enter your dashboard repo URL
30
+ # (Create one from https://github.com/tmsjngx0/mindcontext-template)
31
+ ```
32
+
33
+ This creates `~/.mindcontext/` with your configuration and clones the dashboard repo.
34
+
35
+ ### Per-project setup
36
+
37
+ ```bash
38
+ cd my-project
39
+ mc connect
40
+
41
+ # Or with category and auto-sync hooks
42
+ mc connect --category work --with-hooks
43
+ ```
44
+
45
+ This:
46
+ 1. Registers the project in your config
47
+ 2. Detects OpenSpec if present
48
+ 3. Creates `.claude/commands/mc/` with Claude Code commands
49
+
50
+ ### Daily usage
51
+
52
+ ```bash
53
+ mc sync # Create progress update and push
54
+ mc progress # View progress in terminal
55
+ mc progress --web # Open dashboard in browser
56
+ mc pull # Get updates from other machines
57
+ ```
58
+
59
+ ## Commands
60
+
61
+ ### `mc init`
62
+
63
+ Initialize mindcontext on your machine.
64
+
65
+ ```bash
66
+ mc init
67
+ ```
68
+
69
+ Creates `~/.mindcontext/` directory with:
70
+ - `config.json` - Settings and project registry
71
+ - `repo/` - Git repository for progress updates
72
+
73
+ **Options:**
74
+ - `--quiet, -q` - Suppress output
75
+
76
+ ### `mc connect`
77
+
78
+ Connect current project to mindcontext.
79
+
80
+ ```bash
81
+ mc connect
82
+ mc connect --category work
83
+ mc connect my-custom-name --category personal
84
+ mc connect --with-hooks
85
+ ```
86
+
87
+ **Options:**
88
+ - `--category <name>` - Categorize the project (default: "default")
89
+ - `--with-hooks` - Generate `.claude/hooks/session-end.js` for auto-sync
90
+ - `--quiet, -q` - Suppress output
91
+
92
+ Generated files in `.claude/commands/mc/`:
93
+ - `prime.md` - Load context at session start
94
+ - `update.md` - Save context at session end
95
+ - `progress.md` - Show progress
96
+ - `context.md` - Output raw context
97
+
98
+ ### `mc sync`
99
+
100
+ Create a progress update and push to remote.
101
+
102
+ ```bash
103
+ mc sync
104
+ mc sync --dry-run
105
+ mc sync --notes "Fixed auth bug
106
+ Added unit tests" --next "Deploy to staging
107
+ Write docs"
108
+ ```
109
+
110
+ **Options:**
111
+ - `--notes <text>` - Session notes (newline-separated)
112
+ - `--next <text>` - Next tasks (newline-separated)
113
+ - `--dry-run` - Show what would be created without writing
114
+ - `--quiet, -q` - Suppress output
115
+
116
+ Creates a timestamped JSON file in the dashboard repo:
117
+ ```
118
+ ~/.mindcontext/repo/projects/{project}/updates/{timestamp}_{machine}_{hash}.json
119
+ ```
120
+
121
+ ### `mc pull`
122
+
123
+ Pull latest updates from remote.
124
+
125
+ ```bash
126
+ mc pull
127
+ ```
128
+
129
+ Fetches updates from all machines and team members.
130
+
131
+ ### `mc context`
132
+
133
+ Output current project context.
134
+
135
+ ```bash
136
+ mc context
137
+ mc context --json
138
+ ```
139
+
140
+ **Options:**
141
+ - `--json` - Output as JSON (for scripting/integration)
142
+ - `--quiet, -q` - Suppress headers
143
+
144
+ Shows:
145
+ - Project connection status
146
+ - Current OpenSpec change and progress
147
+ - Last update details
148
+
149
+ ### `mc progress`
150
+
151
+ Show progress across all projects.
152
+
153
+ ```bash
154
+ mc progress
155
+ mc progress --web
156
+ ```
157
+
158
+ **Options:**
159
+ - `--web` - Open the web dashboard in your browser
160
+ - `--quiet, -q` - Suppress decorations
161
+
162
+ ### `mc config`
163
+
164
+ View or update configuration.
165
+
166
+ ```bash
167
+ mc config # Show all config
168
+ mc config --get dashboard-repo # Get specific value
169
+ mc config --dashboard-repo git@github.com:user/repo.git
170
+ mc config --dashboard-url https://user.github.io/repo
171
+ ```
172
+
173
+ **Options:**
174
+ - `--get <key>` - Get a specific config value
175
+ - `--dashboard-repo <url>` - Set dashboard git repository
176
+ - `--dashboard-url <url>` - Set dashboard web URL
177
+ - `--quiet, -q` - Suppress output
178
+
179
+ ### `mc migrate`
180
+
181
+ Migrate from legacy `.project/` and `focus.json`.
182
+
183
+ ```bash
184
+ mc migrate
185
+ mc migrate --dry-run
186
+ mc migrate --yes
187
+ mc migrate --skip-project --skip-focus
188
+ ```
189
+
190
+ **Options:**
191
+ - `--dry-run` - Show what would be migrated
192
+ - `--yes, -y` - Auto-confirm (required for actual migration)
193
+ - `--skip-project` - Skip `.project/` directory migration
194
+ - `--skip-focus` - Skip `focus.json` migration
195
+ - `--quiet, -q` - Suppress output
196
+
197
+ ### `mc cleanup`
198
+
199
+ Remove old update files.
200
+
201
+ ```bash
202
+ mc cleanup
203
+ mc cleanup --older-than 60
204
+ mc cleanup --dry-run
205
+ ```
206
+
207
+ **Options:**
208
+ - `--older-than <days>` - Days threshold (default: 30)
209
+ - `--dry-run` - Show what would be deleted
210
+ - `--quiet, -q` - Suppress output
211
+
212
+ ### `mc reset`
213
+
214
+ Remove mindcontext completely and start fresh.
215
+
216
+ ```bash
217
+ mc reset --force
218
+ mc reset --force --dry-run
219
+ ```
220
+
221
+ **Options:**
222
+ - `--force` - Required to confirm destructive action
223
+ - `--dry-run` - Show what would be deleted
224
+ - `--quiet, -q` - Suppress output
225
+
226
+ ## OpenSpec Integration
227
+
228
+ MindContext automatically detects and reads OpenSpec changes:
229
+
230
+ ```
231
+ my-project/
232
+ ├── openspec/
233
+ │ └── changes/
234
+ │ └── add-feature/
235
+ │ └── tasks.md ← Auto-parsed for progress
236
+ ```
237
+
238
+ The `mc sync` command:
239
+ 1. Finds the active change (not in `archive/`)
240
+ 2. Counts checked `- [x]` vs unchecked `- [ ]` tasks
241
+ 3. Includes progress in the update file
242
+
243
+ ## Claude Code Integration
244
+
245
+ After `mc connect`, use these commands in Claude Code:
246
+
247
+ | Command | Purpose |
248
+ |---------|---------|
249
+ | `/mc:prime` | Load context at session start |
250
+ | `/mc:update` | Save context at session end |
251
+ | `/mc:progress` | Show current progress |
252
+ | `/mc:context` | Output raw context JSON |
253
+
254
+ ### Auto-sync with hooks
255
+
256
+ With `--with-hooks`, a session-end hook automatically syncs:
257
+
258
+ ```javascript
259
+ // .claude/hooks/session-end.js
260
+ module.exports = async function() {
261
+ execSync('mc sync --quiet', { timeout: 10000 });
262
+ };
263
+ ```
264
+
265
+ ## Update File Format
266
+
267
+ Each sync creates a JSON file:
268
+
269
+ ```json
270
+ {
271
+ "timestamp": "2025-01-08T10:30:00Z",
272
+ "machine": "thomas-mac",
273
+ "project": "my-project",
274
+ "progress": {
275
+ "change": "add-feature",
276
+ "tasks_done": 3,
277
+ "tasks_total": 7,
278
+ "source": "openspec"
279
+ },
280
+ "context": {
281
+ "current_task": "Working on add-feature",
282
+ "status": "in_progress",
283
+ "notes": ["Fixed auth bug", "Added tests"],
284
+ "next": ["Deploy to staging"]
285
+ },
286
+ "recent_commits": [
287
+ "abc1234 feat: add login endpoint"
288
+ ]
289
+ }
290
+ ```
291
+
292
+ ## Directory Structure
293
+
294
+ ```
295
+ ~/.mindcontext/
296
+ ├── config.json # Settings + project registry
297
+ ├── repo/ # Dashboard git clone
298
+ │ └── projects/
299
+ │ └── my-project/
300
+ │ └── updates/
301
+ │ └── 2025-01-08T10-30-00Z_thomas-mac_abc123.json
302
+ └── pending.json # Offline queue (auto-managed)
303
+ ```
304
+
305
+ ## Configuration File
306
+
307
+ ```json
308
+ {
309
+ "dashboard_repo": "git@github.com:user/dashboard.git",
310
+ "dashboard_url": "https://user.github.io/dashboard",
311
+ "machine": {
312
+ "id": "abc123def456",
313
+ "name": "thomas-mac"
314
+ },
315
+ "projects": {
316
+ "my-project": {
317
+ "path": "/home/user/my-project",
318
+ "category": "work",
319
+ "openspec": true
320
+ }
321
+ }
322
+ }
323
+ ```
324
+
325
+ ## Team Collaboration
326
+
327
+ Multiple team members can use the same dashboard repository:
328
+
329
+ 1. Each member runs `mc init` with the same dashboard repo URL
330
+ 2. Each `mc sync` creates a unique file (no conflicts!)
331
+ 3. `mc pull` fetches everyone's updates
332
+ 4. Dashboard shows who's working on what
333
+
334
+ ## Offline Support
335
+
336
+ - `mc sync` always commits locally
337
+ - Push only happens when online (failure is OK)
338
+ - Run `mc sync` again when back online to push pending changes
339
+
340
+ ## License
341
+
342
+ MIT