exocortex-cli 13.96.1 → 13.97.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 +89 -0
- package/dist/index.js +93 -90
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -244,6 +244,92 @@ exocortex command complete "tasks/feature.md" --vault ~/vault
|
|
|
244
244
|
exocortex command archive "tasks/feature.md" --vault ~/vault
|
|
245
245
|
```
|
|
246
246
|
|
|
247
|
+
### Batch Operations
|
|
248
|
+
|
|
249
|
+
Execute multiple operations in a single CLI invocation for better performance:
|
|
250
|
+
|
|
251
|
+
```bash
|
|
252
|
+
# Execute batch from JSON input
|
|
253
|
+
exocortex batch --input '[
|
|
254
|
+
{"command":"start","filepath":"tasks/task1.md"},
|
|
255
|
+
{"command":"complete","filepath":"tasks/task2.md"},
|
|
256
|
+
{"command":"trash","filepath":"tasks/task3.md"}
|
|
257
|
+
]' --vault ~/vault
|
|
258
|
+
|
|
259
|
+
# Execute batch from file
|
|
260
|
+
exocortex batch --file operations.json --vault ~/vault
|
|
261
|
+
|
|
262
|
+
# Atomic mode (all-or-nothing - rollback on any failure)
|
|
263
|
+
exocortex batch --file operations.json --vault ~/vault --atomic
|
|
264
|
+
|
|
265
|
+
# Dry run (preview without modifying files)
|
|
266
|
+
exocortex batch --input '[{"command":"start","filepath":"task.md"}]' --vault ~/vault --dry-run
|
|
267
|
+
|
|
268
|
+
# JSON output for MCP integration
|
|
269
|
+
exocortex batch --file operations.json --vault ~/vault --format json
|
|
270
|
+
```
|
|
271
|
+
|
|
272
|
+
**Batch Options:**
|
|
273
|
+
- `--input <json>` - JSON array of operations to execute
|
|
274
|
+
- `--file <path>` - Path to JSON file containing operations
|
|
275
|
+
- `--atomic` - All-or-nothing execution (rollback on any failure)
|
|
276
|
+
- `--dry-run` - Preview changes without modifying files
|
|
277
|
+
- `--format <type>` - Output format: `text` (default), `json`
|
|
278
|
+
- `--vault <path>` - Path to Obsidian vault (default: current directory)
|
|
279
|
+
|
|
280
|
+
**Operation Format:**
|
|
281
|
+
```json
|
|
282
|
+
{
|
|
283
|
+
"command": "start", // Command name (required)
|
|
284
|
+
"filepath": "tasks/task.md", // File path (required)
|
|
285
|
+
"options": { // Optional command parameters
|
|
286
|
+
"label": "New Label",
|
|
287
|
+
"date": "2025-12-15"
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
```
|
|
291
|
+
|
|
292
|
+
**Supported Commands:**
|
|
293
|
+
- `start` - Start task (ToDo → Doing)
|
|
294
|
+
- `complete` - Complete task (Doing → Done)
|
|
295
|
+
- `trash` - Trash task
|
|
296
|
+
- `archive` - Archive task
|
|
297
|
+
- `move-to-backlog` - Move to Backlog
|
|
298
|
+
- `move-to-analysis` - Move to Analysis
|
|
299
|
+
- `move-to-todo` - Move to ToDo
|
|
300
|
+
- `update-label` - Update label (requires `options.label`)
|
|
301
|
+
- `schedule` - Schedule task (requires `options.date`)
|
|
302
|
+
- `set-deadline` - Set deadline (requires `options.date`)
|
|
303
|
+
|
|
304
|
+
**Performance Benefits:**
|
|
305
|
+
- Single process execution (no repeated Node.js startup overhead)
|
|
306
|
+
- Vault loaded once for all operations
|
|
307
|
+
- Batch of 10 operations is ~10x faster than 10 separate CLI calls
|
|
308
|
+
|
|
309
|
+
**MCP Integration Example:**
|
|
310
|
+
```json
|
|
311
|
+
{
|
|
312
|
+
"success": true,
|
|
313
|
+
"data": {
|
|
314
|
+
"success": true,
|
|
315
|
+
"total": 3,
|
|
316
|
+
"succeeded": 3,
|
|
317
|
+
"failed": 0,
|
|
318
|
+
"results": [
|
|
319
|
+
{"success": true, "command": "start", "filepath": "task1.md", "action": "Started task"},
|
|
320
|
+
{"success": true, "command": "complete", "filepath": "task2.md", "action": "Completed task"},
|
|
321
|
+
{"success": true, "command": "trash", "filepath": "task3.md", "action": "Trashed task"}
|
|
322
|
+
],
|
|
323
|
+
"durationMs": 45,
|
|
324
|
+
"atomic": false
|
|
325
|
+
},
|
|
326
|
+
"meta": {
|
|
327
|
+
"durationMs": 45,
|
|
328
|
+
"itemCount": 3
|
|
329
|
+
}
|
|
330
|
+
}
|
|
331
|
+
```
|
|
332
|
+
|
|
247
333
|
## Architecture
|
|
248
334
|
|
|
249
335
|
The CLI uses `@exocortex/core` for business logic and implements a Node.js file system adapter:
|
|
@@ -358,6 +444,9 @@ ems__Effort_status: "[[ems__EffortStatusDraft]]"
|
|
|
358
444
|
- `exocortex command schedule` - Set planned start date
|
|
359
445
|
- `exocortex command set-deadline` - Set planned end date
|
|
360
446
|
|
|
447
|
+
**Batch Operations:**
|
|
448
|
+
- `exocortex batch` - Execute multiple operations in single invocation
|
|
449
|
+
|
|
361
450
|
### Planned Commands
|
|
362
451
|
|
|
363
452
|
- `exocortex command rollback-status` - Rollback to previous status
|