@cleocode/cleo 2026.4.22 → 2026.4.24

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 CHANGED
@@ -1,15 +1,17 @@
1
1
  # @cleocode/cleo
2
2
 
3
- CLEO CLI + MCP Server - the assembled product consuming @cleocode/core.
3
+ CLEO CLI the assembled product consuming @cleocode/core.
4
4
 
5
5
  ## Overview
6
6
 
7
- This is the main CLEO package that brings together all other packages into a unified command-line interface and Model Context Protocol (MCP) server. It provides:
7
+ This is the main CLEO package that brings together all other packages into a unified command-line interface. It provides:
8
8
 
9
- - **CLI**: 80+ commands for task management, sessions, memory, and more
10
- - **MCP Server**: Full integration with AI assistants via the Model Context Protocol
9
+ - **CLI**: 100+ commands for task management, sessions, memory, orchestration, and more
10
+ - **Dispatch Layer**: CQRS routing with query/mutate gateways, middleware pipeline, and LAFS envelope formatting
11
11
  - **Admin Tools**: Configuration, backup, migration, and system management
12
12
 
13
+ The CLI is a thin wrapper — all business logic lives in [@cleocode/core](../core).
14
+
13
15
  ## Installation
14
16
 
15
17
  ### Global Installation (Recommended)
@@ -18,23 +20,13 @@ This is the main CLEO package that brings together all other packages into a uni
18
20
  npm install -g @cleocode/cleo
19
21
  ```
20
22
 
21
- ```bash
22
- pnpm add -g @cleocode/cleo
23
- ```
24
-
25
- ```bash
26
- yarn global add @cleocode/cleo
27
- ```
28
-
29
- ### Local Installation
23
+ ### Batteries-Included (CleoOS)
30
24
 
31
25
  ```bash
32
- npm install @cleocode/cleo
26
+ npm install -g @cleocode/cleo-os
33
27
  ```
34
28
 
35
- ```bash
36
- pnpm add @cleocode/cleo
37
- ```
29
+ This installs `cleo`, `ct`, and `cleoos` binaries with CANT bridge and TUI extensions.
38
30
 
39
31
  ### Using npx (No Installation)
40
32
 
@@ -47,33 +39,27 @@ npx @cleocode/cleo <command>
47
39
  ### Initialize CLEO in Your Project
48
40
 
49
41
  ```bash
50
- # Navigate to your project
51
42
  cd my-project
52
-
53
- # Initialize CLEO
54
43
  cleo init
55
-
56
- # Or with examples
57
- cleo init --with-examples
58
44
  ```
59
45
 
60
46
  ### Basic Commands
61
47
 
62
48
  ```bash
63
49
  # Add a task
64
- cleo add "Implement user authentication"
50
+ cleo add "Implement user authentication" --priority high --acceptance "AC1|AC2|AC3"
65
51
 
66
- # List tasks
67
- cleo list
52
+ # Search tasks (returns readiness info: depends, type, size)
53
+ cleo find "auth" --status pending
68
54
 
69
55
  # Start a work session
70
- cleo session start "Authentication Feature"
56
+ cleo session start --scope global --name "Auth Feature"
71
57
 
72
58
  # Show current context
73
59
  cleo current
74
60
 
75
61
  # Complete a task
76
- cleo complete T1234
62
+ cleo complete T001
77
63
 
78
64
  # Get help
79
65
  cleo --help
@@ -82,16 +68,19 @@ cleo <command> --help
82
68
 
83
69
  ## CLI Commands
84
70
 
85
- CLEO provides 80+ commands organized into domains:
71
+ CLEO provides 100+ commands organized into domains:
86
72
 
87
73
  ### Task Management
88
74
 
89
75
  | Command | Description |
90
76
  |---------|-------------|
91
77
  | `cleo add <title>` | Create a new task |
78
+ | `cleo add-batch --file tasks.json` | Batch create tasks from JSON |
92
79
  | `cleo list` | List all tasks |
93
80
  | `cleo show <id>` | Show task details |
94
- | `cleo find <query>` | Search tasks |
81
+ | `cleo find <query>` | Search tasks (agent-optimized, includes readiness) |
82
+ | `cleo find <query> --verbose` | Search with full task fields |
83
+ | `cleo find <query> --fields labels,acceptance` | Search with specific extra fields |
95
84
  | `cleo complete <id>` | Mark task as complete |
96
85
  | `cleo update <id>` | Update task properties |
97
86
  | `cleo delete <id>` | Delete a task |
@@ -103,7 +92,6 @@ CLEO provides 80+ commands organized into domains:
103
92
  | `cleo deps <id>` | Show task dependencies |
104
93
  | `cleo tree <id>` | Show task tree |
105
94
  | `cleo labels` | Manage labels |
106
- | `cleo tags` | Manage tags |
107
95
  | `cleo blockers` | Show blockers |
108
96
  | `cleo stats` | Task statistics |
109
97
  | `cleo history <id>` | Task history |
@@ -111,16 +99,16 @@ CLEO provides 80+ commands organized into domains:
111
99
  | `cleo reparent <id> <parent>` | Change parent task |
112
100
  | `cleo relates <id> <target>` | Add relation |
113
101
  | `cleo exists <id>` | Check if task exists |
102
+ | `cleo promote <id>` | Promote task to root level |
114
103
 
115
104
  ### Session Management
116
105
 
117
106
  | Command | Description |
118
107
  |---------|-------------|
119
- | `cleo session` | Session management |
120
- | `cleo session start [name]` | Start a new session |
108
+ | `cleo session start [--scope] [--name]` | Start a new session |
121
109
  | `cleo session list` | List sessions |
122
110
  | `cleo session resume <id>` | Resume a session |
123
- | `cleo session end [id]` | End current/session |
111
+ | `cleo session end [id]` | End current session |
124
112
  | `cleo briefing` | Generate session briefing |
125
113
  | `cleo phase` | Phase management |
126
114
  | `cleo checkpoint` | Create checkpoint |
@@ -132,13 +120,12 @@ CLEO provides 80+ commands organized into domains:
132
120
  |---------|-------------|
133
121
  | `cleo memory` | Memory operations |
134
122
  | `cleo memory-brain` | Brain memory search |
135
- | `cleo observe` | Observe and store memory |
123
+ | `cleo observe <text>` | Save observation to brain.db |
136
124
  | `cleo context` | Show context |
137
125
  | `cleo inject` | Inject context |
138
126
  | `cleo sync` | Sync memory |
139
127
  | `cleo sticky` | Sticky notes |
140
- | `cleo note` | Add session note |
141
- | `cleo refresh-memory` | Refresh memory |
128
+ | `cleo refresh-memory` | Refresh memory bridge |
142
129
 
143
130
  ### Validation & Compliance
144
131
 
@@ -156,17 +143,14 @@ CLEO provides 80+ commands organized into domains:
156
143
  |---------|-------------|
157
144
  | `cleo release` | Release management |
158
145
  | `cleo lifecycle` | Lifecycle operations |
159
- | `cleo promote` | Promote task/stage |
146
+ | `cleo promote <id>` | Promote task/stage |
160
147
  | `cleo upgrade` | Upgrade CLEO |
161
- | `cleo specification` | Write specification |
162
- | `cleo detect-drift` | Detect drift |
163
148
  | `cleo roadmap` | Roadmap planning |
164
149
  | `cleo plan` | Create plan |
165
150
  | `cleo phases` | Phase operations |
166
151
  | `cleo log` | View logs |
167
152
  | `cleo issue` | Issue management |
168
153
  | `cleo bug` | Bug tracking |
169
- | `cleo generate-changelog` | Generate changelog |
170
154
 
171
155
  ### Orchestration
172
156
 
@@ -181,15 +165,6 @@ CLEO provides 80+ commands organized into domains:
181
165
  | `cleo sequence` | Task sequencing |
182
166
  | `cleo dash` | Dashboard |
183
167
 
184
- ### Research
185
-
186
- | Command | Description |
187
- |---------|-------------|
188
- | `cleo research` | Research topics |
189
- | `cleo extract` | Extract information |
190
- | `cleo web` | Web search |
191
- | `cleo docs` | Documentation lookup |
192
-
193
168
  ### Nexus & Sync
194
169
 
195
170
  | Command | Description |
@@ -202,8 +177,6 @@ CLEO provides 80+ commands organized into domains:
202
177
  | `cleo snapshot` | Create snapshot |
203
178
  | `cleo export` | Export data |
204
179
  | `cleo import` | Import data |
205
- | `cleo export-tasks` | Export tasks |
206
- | `cleo import-tasks` | Import tasks |
207
180
 
208
181
  ### Administration
209
182
 
@@ -213,128 +186,28 @@ CLEO provides 80+ commands organized into domains:
213
186
  | `cleo backup` | Backup data |
214
187
  | `cleo backup export` | Pack a portable `.cleobundle.tar.gz` |
215
188
  | `cleo backup import` | Restore from a portable bundle |
216
- | `cleo backup inspect` | Print bundle manifest without extracting |
217
- | `cleo restore finalize` | Apply manually-resolved conflicts |
218
- | `cleo env` | Environment vars |
219
- | `cleo mcp-install` | Install MCP |
220
- | `cleo testing` | Testing setup |
189
+ | `cleo backup inspect` | Print bundle manifest |
190
+ | `cleo restore finalize` | Apply resolved conflicts |
221
191
  | `cleo skills` | Skills management |
222
192
  | `cleo self-update` | Update CLEO |
223
- | `cleo install-global` | Global install |
224
193
  | `cleo grade` | Grade session |
225
194
  | `cleo migrate` | Run migrations |
226
- | `cleo migrate-claude-mem` | Migrate Claude memories |
227
- | `cleo otel` | OpenTelemetry |
228
- | `cleo token` | Token management |
229
195
  | `cleo adr` | ADR management |
230
196
  | `cleo map` | Codebase map |
231
197
  | `cleo commands` | List all commands |
198
+ | `cleo otel` | OpenTelemetry |
199
+ | `cleo token` | Token management |
232
200
 
233
- ### Cross-machine backup export/import (v2026.4.13+)
234
-
235
- The `cleo backup` command supports portable `.cleobundle.tar.gz` archives for
236
- cross-machine backup transfer:
237
-
238
- - `cleo backup export <name> [--scope project|global|all] [--encrypt]` — pack
239
- project + global data into a portable bundle
240
- - `cleo backup import <bundle> [--force]` — restore from a bundle. Uses
241
- intelligent A/B regenerate-and-compare for JSON files (`config.json`,
242
- `project-info.json`, `project-context.json`). Conflicts are written to
243
- `.cleo/restore-conflicts.md` for review.
244
- - `cleo backup inspect <bundle>` — print manifest without extracting
245
- - `cleo restore finalize` — apply manually-resolved conflicts from
246
- `.cleo/restore-conflicts.md`
247
-
248
- See [ADR-038](../../.cleo/adrs/ADR-038-backup-portability.md) for the
249
- full specification.
250
-
251
- ### Portable backups
252
-
253
- Use `cleo backup export --scope all` to create a `.cleobundle.tar.gz` that
254
- can be restored on a different machine via `cleo backup import`.
255
-
256
- ## MCP Server
257
-
258
- CLEO includes a full MCP server for AI assistant integration.
259
-
260
- ### Starting the MCP Server
201
+ ### Cross-machine Backup (v2026.4.13+)
261
202
 
262
203
  ```bash
263
- # Start MCP server
264
- cleo mcp
265
-
266
- # Or directly
267
- node ./node_modules/@cleocode/cleo/dist/mcp/index.js
268
- ```
269
-
270
- ### Configuring with Claude Desktop
271
-
272
- Add to your Claude Desktop configuration (`~/Library/Application Support/Claude/claude_desktop_config.json`):
273
-
274
- ```json
275
- {
276
- "mcpServers": {
277
- "cleo": {
278
- "command": "cleo",
279
- "args": ["mcp"]
280
- }
281
- }
282
- }
283
- ```
284
-
285
- ### MCP Tools
286
-
287
- The MCP server exposes two main tools:
288
-
289
- #### `query` - Read Operations
290
-
291
- Query operations never modify state. They are cached by default.
292
-
293
- ```json
294
- {
295
- "domain": "tasks",
296
- "operation": "list",
297
- "params": {
298
- "status": ["pending", "in_progress"],
299
- "limit": 10
300
- }
301
- }
302
- ```
303
-
304
- Available domains:
305
- - `tasks` - Task queries (list, show, find, deps)
306
- - `session` - Session queries (status, list)
307
- - `memory` - Memory queries (search, observe)
308
- - `orchestrate` - Orchestration queries (status, analyze)
309
- - `admin` - Admin queries (config, health)
310
- - `skills` - Skill queries (list, show)
311
- - `nexus` - Nexus queries (status, remote)
312
- - `check` - Validation queries (compliance, verify)
313
- - And more...
314
-
315
- #### `mutate` - Write Operations
316
-
317
- Mutate operations modify state and are validated, logged, and atomic.
318
-
319
- ```json
320
- {
321
- "domain": "tasks",
322
- "operation": "add",
323
- "params": {
324
- "title": "New task",
325
- "priority": "high"
326
- }
327
- }
204
+ cleo backup export <name> [--scope project|global|all] [--encrypt]
205
+ cleo backup import <bundle> [--force]
206
+ cleo backup inspect <bundle>
207
+ cleo restore finalize
328
208
  ```
329
209
 
330
- ### MCP Resources
331
-
332
- Memory resources are exposed for context retrieval:
333
-
334
- - `cleo://memory/brain` - Brain memory entries
335
- - `cleo://memory/context` - Current context
336
- - `cleo://memory/sticky` - Sticky notes
337
- - `cleo://session/current` - Current session info
210
+ See [ADR-038](../../.cleo/adrs/ADR-038-backup-portability.md) for the full specification.
338
211
 
339
212
  ## Global Options
340
213
 
@@ -354,39 +227,29 @@ cleo --mvi <level> <command> # Control detail level
354
227
 
355
228
  ## Configuration
356
229
 
357
- CLEO can be configured via:
358
-
359
230
  ### Environment Variables
360
231
 
361
232
  ```bash
362
233
  export CLEO_LOG_LEVEL=debug
363
- export CLEO_CONFIG_PATH=./.cleo/config.yaml
364
- export CLEO_DATA_DIR=./.cleo
234
+ export CLEO_PROJECT_ROOT=/path/to/project # Override cwd-based project detection
235
+ export CLEO_ROOT=/path/to/project # Alias for CLEO_PROJECT_ROOT
365
236
  ```
366
237
 
367
238
  ### Configuration File
368
239
 
369
- ```yaml
370
- # .cleo/config.yaml
371
- logging:
372
- level: info
373
- format: json
374
-
375
- session:
376
- auto_start: true
377
- default_scope: feature
378
-
379
- lifecycle:
380
- enforcement: strict
381
-
382
- output:
383
- format: human
384
-
385
- sharing:
386
- mode: local
240
+ ```json
241
+ // .cleo/config.json
242
+ {
243
+ "logging": { "level": "info" },
244
+ "session": { "enforcement": { "requiredForMutate": true } },
245
+ "lifecycle": { "mode": "advisory" },
246
+ "enforcement": {
247
+ "acceptance": { "mode": "block", "minimumCriteria": 3 }
248
+ }
249
+ }
387
250
  ```
388
251
 
389
- ### CLI Options
252
+ ### CLI Config Commands
390
253
 
391
254
  ```bash
392
255
  cleo config set logging.level debug
@@ -396,9 +259,7 @@ cleo config list
396
259
 
397
260
  ## Programmatic Usage
398
261
 
399
- While the CLI is the primary interface, you can also use CLEO programmatically:
400
-
401
- ### As a Module
262
+ While the CLI is the primary interface, you can use the core SDK directly:
402
263
 
403
264
  ```typescript
404
265
  import { Cleo } from '@cleocode/core';
@@ -412,97 +273,28 @@ await cleo.tasks.add({ title: 'New task' });
412
273
  await cleo.destroy();
413
274
  ```
414
275
 
415
- ### MCP Client
416
-
417
- ```typescript
418
- import { Client } from '@modelcontextprotocol/sdk/client/index.js';
419
-
420
- const client = new Client({ name: 'my-client', version: '1.0.0' });
421
- await client.connect(transport);
422
-
423
- // Call CLEO tools
424
- const result = await client.callTool('query', {
425
- domain: 'tasks',
426
- operation: 'list'
427
- });
428
- ```
429
-
430
- ## API Overview
431
-
432
- ### Exports
433
-
434
- The package exports two main entry points:
435
-
436
- ```typescript
437
- // CLI entry point (default)
438
- import '@cleocode/cleo';
439
-
440
- // MCP server entry point
441
- import '@cleocode/cleo/mcp';
442
- ```
443
-
444
- ### Binaries
445
-
446
- Multiple binary names are provided:
447
-
448
- - `cleo` - Primary command
449
- - `ct` - Short alias
450
-
451
- ## Development
452
-
453
- ### Building
454
-
455
- ```bash
456
- # Build the package
457
- pnpm build
458
-
459
- # Type check
460
- pnpm typecheck
461
- ```
462
-
463
- ### Testing
464
-
465
- ```bash
466
- # Run tests
467
- pnpm test
468
-
469
- # Run specific test
470
- pnpm test -- cleo.test.ts
471
- ```
472
-
473
- ### Database
474
-
475
- ```bash
476
- # Generate migrations
477
- pnpm db:generate
478
-
479
- # Open Drizzle Studio
480
- pnpm db:studio
481
- ```
482
-
483
276
  ## Architecture
484
277
 
485
278
  ```
486
279
  ┌─────────────────────────────────────┐
487
280
  │ @cleocode/cleo │
488
- ┌──────────────┬─────────────────┐
489
- │ │ CLI MCP Server
490
- │ │ (citty) (stdio)
491
- └──────────────┴─────────────────┘
492
-
493
- ┌────────┴─────────────────────┐
494
- │ │ Dispatch Layer │ │
495
- │ │ - Query/Mutate routing │ │
496
- │ │ - Rate limiting │ │
497
- │ │ - Caching │ │
498
- │ │ - Background jobs │ │
499
- └──────────────────────────────┘
500
-
501
- ┌────────┴─────────────────────┐
502
- │ │ @cleocode/core │ │
503
- │ │ - Tasks, Sessions, Memory │ │
504
- │ │ - Orchestration │ │
505
- │ │ - Compliance │ │
281
+ ┌──────────────────────────────┐
282
+ │ │ CLI Layer │ │
283
+ │ │ 89 commands (commander.js)
284
+ └──────────────┬───────────────┘
285
+
286
+ ┌──────────────┴───────────────┐
287
+ │ │ Dispatch Layer │ │
288
+ │ │ CQRS query/mutate routing │ │
289
+ │ │ 12 domain handlers │ │
290
+ │ │ 19 engine wrappers │ │
291
+ │ │ Middleware pipeline │ │
292
+ └──────────────┬───────────────┘
293
+
294
+ ┌──────────────┴───────────────┐
295
+ │ │ @cleocode/core │ │
296
+ │ │ Tasks Sessions Memory │ │
297
+ │ │ Orchestration • Lifecycle │ │
506
298
  │ └──────────────────────────────┘ │
507
299
  └─────────────────────────────────────┘
508
300
  ```
@@ -523,69 +315,43 @@ cleo upgrade
523
315
 
524
316
  **"Permission denied"**
525
317
  ```bash
526
- # Fix permissions
527
318
  chmod +x $(which cleo)
528
319
  ```
529
320
 
530
- **MCP connection issues**
531
- ```bash
532
- # Check MCP status
533
- cleo doctor
534
-
535
- # Reinstall MCP
536
- cleo mcp-install
537
- ```
538
-
539
321
  ### Debug Mode
540
322
 
541
323
  ```bash
542
- # Enable debug logging
543
324
  export CLEO_LOG_LEVEL=debug
544
325
  cleo <command>
545
-
546
- # Or via config
547
- cleo config set logging.level debug
548
326
  ```
549
327
 
550
328
  ### Getting Help
551
329
 
552
330
  ```bash
553
- # General help
554
331
  cleo --help
555
-
556
- # Command help
557
332
  cleo <command> --help
558
-
559
- # System health
560
333
  cleo doctor
561
-
562
- # List all commands
563
334
  cleo commands
564
335
  ```
565
336
 
566
337
  ## Dependencies
567
338
 
568
- ### Production Dependencies
339
+ ### Production
569
340
 
570
- - `@cleocode/core` - Business logic
571
- - `@cleocode/contracts` - Type definitions
572
- - `@cleocode/caamp` - Context-aware memory
573
- - `@cleocode/lafs` - Feedback schema
574
- - `@modelcontextprotocol/sdk` - MCP protocol
575
- - `drizzle-orm` - Database ORM
576
- - `citty` - CLI framework
577
- - `pino` - Logging
578
- - And more...
341
+ - `@cleocode/core` Business logic SDK
342
+ - `@cleocode/contracts` Shared type definitions
343
+ - `@cleocode/caamp` Provider registry
344
+ - `@cleocode/cant` CANT protocol parser
345
+ - `@cleocode/lafs` Error envelope protocol
346
+ - `@cleocode/runtime` — Long-running process layer
347
+ - `drizzle-orm` Database ORM
348
+ - `pino` Logging
579
349
 
580
- ### Development Dependencies
350
+ ### Binaries
581
351
 
582
- - `typescript` - Type checking
583
- - `vitest` - Testing
352
+ - `cleo` Primary command
353
+ - `ct` Short alias
584
354
 
585
355
  ## License
586
356
 
587
- MIT License - see [LICENSE](../LICENSE) for details.
588
-
589
- ---
590
-
591
- For more information, visit [https://cleo.dev](https://cleo.dev)
357
+ MIT License - see [LICENSE](../../LICENSE) for details.