@cleocode/cleo 2026.3.10 → 2026.3.12
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 +64 -47
- package/bin/postinstall.js +117 -0
- package/dist/cli/index.js +206 -25
- package/dist/cli/index.js.map +4 -4
- package/dist/mcp/index.js +155 -262
- package/dist/mcp/index.js.map +4 -4
- package/package.json +4 -2
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<p alis|version-[0-9]\+\.[0-9]\+\.[0-9]\+-|version-2026.3.10-|g|version-[0-9]\+\.[0-9]\+\.[0-9]\+-|version-2025.3.10-|gn="center">
|
|
1
|
+
<p alis|version-[0-9]\+\.[0-9]\+\.[0-9]\+-|version-2026.3.12-|g|version-[0-9]\+\.[0-9]\+\.[0-9]\+-|version-2026.3.11-|g|version-[0-9]\+\.[0-9]\+\.[0-9]\+-|version-2026.3.10-|g|version-[0-9]\+\.[0-9]\+\.[0-9]\+-|version-2025.3.10-|gn="center">
|
|
2
2
|
<img src="docs/images/banner.png" alt="CLEO banner" width="900">
|
|
3
3
|
</p>
|
|
4
4
|
|
|
@@ -269,36 +269,36 @@ cleo-dev env info --json
|
|
|
269
269
|
|
|
270
270
|
### TL;DR - Just Install It
|
|
271
271
|
|
|
272
|
-
**Option 1:
|
|
272
|
+
**Option 1: NPM (Recommended)**
|
|
273
273
|
|
|
274
274
|
```bash
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
# Reinstalling over existing installation? Use --force:
|
|
278
|
-
curl -fsSL https://github.com/kryptobaseddev/cleo/releases/latest/download/install.sh | bash -s -- --force
|
|
275
|
+
npm install -g @cleocode/cleo
|
|
279
276
|
```
|
|
280
277
|
|
|
281
|
-
|
|
278
|
+
This automatically bootstraps the global CLEO system:
|
|
279
|
+
- Sets up `~/.cleo/` with templates and configuration
|
|
280
|
+
- Installs MCP server to detected AI providers (Claude Code, Cursor, etc.)
|
|
281
|
+
- Creates `~/.agents/AGENTS.md` hub for agent instructions
|
|
282
282
|
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
283
|
+
Then initialize in any project:
|
|
284
|
+
```bash
|
|
285
|
+
cd /path/to/your/project && cleo init
|
|
286
|
+
```
|
|
287
|
+
|
|
288
|
+
**Option 2: One-liner Bash (Legacy/Offline)**
|
|
288
289
|
|
|
289
|
-
|
|
290
|
+
For systems without npm or offline installs:
|
|
290
291
|
```bash
|
|
291
|
-
|
|
292
|
-
bash ~/Downloads/install.sh
|
|
292
|
+
curl -fsSL https://github.com/kryptobaseddev/cleo/releases/latest/download/install.sh | bash
|
|
293
293
|
```
|
|
294
294
|
|
|
295
|
-
**Option 3: From source (
|
|
295
|
+
**Option 3: From source (Contributors)**
|
|
296
296
|
|
|
297
297
|
```bash
|
|
298
298
|
git clone https://github.com/kryptobaseddev/cleo.git && cd cleo && ./installer/install.sh --dev
|
|
299
299
|
```
|
|
300
300
|
|
|
301
|
-
Then
|
|
301
|
+
Then use `cleo-dev` for isolated development:
|
|
302
302
|
```bash
|
|
303
303
|
cd /path/to/your/project && cleo-dev init
|
|
304
304
|
```
|
|
@@ -327,25 +327,43 @@ cd /path/to/your/project && cleo-dev init
|
|
|
327
327
|
<details>
|
|
328
328
|
<summary><strong>Detailed Installation Options</strong></summary>
|
|
329
329
|
|
|
330
|
-
####
|
|
330
|
+
#### NPM Install (Recommended for Users)
|
|
331
|
+
|
|
332
|
+
The NPM package auto-bootstraps the global CLEO system on install:
|
|
331
333
|
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
334
|
+
```bash
|
|
335
|
+
# Install from npm registry
|
|
336
|
+
npm install -g @cleocode/cleo
|
|
337
|
+
|
|
338
|
+
# Or install specific version
|
|
339
|
+
npm install -g @cleocode/cleo@2026.3.10
|
|
340
|
+
```
|
|
341
|
+
|
|
342
|
+
What happens during install:
|
|
343
|
+
1. Creates `~/.cleo/` directory structure
|
|
344
|
+
2. Installs global templates (`CLEO-INJECTION.md`)
|
|
345
|
+
3. Detects AI providers and installs MCP server configs
|
|
346
|
+
4. Creates `~/.agents/AGENTS.md` hub
|
|
347
|
+
|
|
348
|
+
#### Initialize in Your Project
|
|
340
349
|
|
|
341
|
-
|
|
350
|
+
After global install, initialize each project:
|
|
342
351
|
|
|
343
352
|
```bash
|
|
344
|
-
|
|
353
|
+
cd /path/to/your/project
|
|
354
|
+
cleo init
|
|
345
355
|
```
|
|
346
356
|
|
|
357
|
+
This creates only the local project structure:
|
|
358
|
+
- `./.cleo/` directory with `config.json` and `tasks.db`
|
|
359
|
+
- Registers project with NEXUS
|
|
360
|
+
- Sets up git hooks
|
|
361
|
+
- Injects CLEO references into local `AGENTS.md`
|
|
362
|
+
|
|
347
363
|
#### From Source (for Contributors)
|
|
348
364
|
|
|
365
|
+
For CLEO development or testing unreleased changes:
|
|
366
|
+
|
|
349
367
|
```bash
|
|
350
368
|
# Clone repository
|
|
351
369
|
git clone https://github.com/kryptobaseddev/cleo.git
|
|
@@ -356,38 +374,37 @@ cd cleo
|
|
|
356
374
|
|
|
357
375
|
# Verify isolated runtime
|
|
358
376
|
cleo-dev env info --json
|
|
359
|
-
|
|
360
|
-
# Or install as release (copies files)
|
|
361
|
-
./installer/install.sh --release
|
|
362
377
|
```
|
|
363
378
|
|
|
364
|
-
|
|
379
|
+
The dev channel uses:
|
|
380
|
+
- Isolated commands: `cleo-dev` (no `ct` alias)
|
|
381
|
+
- Isolated home: `~/.cleo-dev/`
|
|
382
|
+
- Symlinks to repo for rapid iteration
|
|
365
383
|
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
```bash
|
|
369
|
-
cleo version
|
|
370
|
-
cleo env info --json
|
|
371
|
-
```
|
|
384
|
+
`npm link` caveat: raw `npm link` follows package bin mappings and can expose `cleo`/`ct`. Use `./installer/install.sh --dev` when you need strict `cleo-dev` isolation.
|
|
372
385
|
|
|
373
|
-
|
|
386
|
+
#### Legacy Bash Installer (Offline/Restricted Systems)
|
|
374
387
|
|
|
375
|
-
|
|
388
|
+
For systems without npm access:
|
|
376
389
|
|
|
377
390
|
```bash
|
|
378
|
-
|
|
379
|
-
cleo
|
|
391
|
+
# One-liner install
|
|
392
|
+
curl -fsSL https://github.com/kryptobaseddev/cleo/releases/latest/download/install.sh | bash
|
|
393
|
+
|
|
394
|
+
# Or download and run manually
|
|
395
|
+
bash install.sh
|
|
380
396
|
```
|
|
381
397
|
|
|
382
|
-
|
|
398
|
+
This copies files (not symlinks) and provides the same functionality as npm install.
|
|
399
|
+
|
|
400
|
+
#### Verify Installation
|
|
383
401
|
|
|
384
402
|
```bash
|
|
385
|
-
|
|
386
|
-
cleo
|
|
403
|
+
cleo version
|
|
404
|
+
cleo env info --json
|
|
405
|
+
cleo doctor
|
|
387
406
|
```
|
|
388
407
|
|
|
389
|
-
> **Note**: The installer creates symlinks in `~/.local/bin/`, which works immediately with Claude Code and most modern shells.
|
|
390
|
-
|
|
391
408
|
</details>
|
|
392
409
|
|
|
393
410
|
<details>
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* NPM Postinstall Hook - Bootstrap Global CLEO System
|
|
4
|
+
*
|
|
5
|
+
* This script runs automatically after `npm install -g @cleocode/cleo`.
|
|
6
|
+
* It bootstraps the global CLEO system:
|
|
7
|
+
* - Creates ~/.cleo/ directory structure
|
|
8
|
+
* - Installs global templates (CLEO-INJECTION.md)
|
|
9
|
+
* - Sets up CAAMP provider configs
|
|
10
|
+
* - Installs MCP server to detected providers
|
|
11
|
+
* - Creates ~/.agents/AGENTS.md hub
|
|
12
|
+
*
|
|
13
|
+
* This is the ONLY place global setup should happen. Project `cleo init`
|
|
14
|
+
* only creates local ./.cleo/ and registers with NEXUS.
|
|
15
|
+
*
|
|
16
|
+
* @task T5267
|
|
17
|
+
*/
|
|
18
|
+
|
|
19
|
+
import { existsSync } from 'node:fs';
|
|
20
|
+
import { mkdir, writeFile, readFile, copyFile } from 'node:fs/promises';
|
|
21
|
+
import { join, dirname, resolve } from 'node:path';
|
|
22
|
+
import { homedir } from 'node:os';
|
|
23
|
+
import { fileURLToPath } from 'node:url';
|
|
24
|
+
|
|
25
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
26
|
+
const __dirname = dirname(__filename);
|
|
27
|
+
|
|
28
|
+
// Determine if we're running from npm global install or local dev
|
|
29
|
+
function isNpmGlobalInstall() {
|
|
30
|
+
const execPath = process.argv[1] || '';
|
|
31
|
+
// Check if running from node_modules/@cleocode/cleo/
|
|
32
|
+
return execPath.includes('node_modules/@cleocode/cleo/') ||
|
|
33
|
+
execPath.includes('node_modules\\@cleocode\\cleo\\');
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
// Get package root
|
|
37
|
+
function getPackageRoot() {
|
|
38
|
+
// When running from bin/, go up to package root
|
|
39
|
+
return resolve(__dirname, '..');
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
async function bootstrapGlobalCleo() {
|
|
43
|
+
// Only run for npm global installs, not local dev or other contexts
|
|
44
|
+
if (!isNpmGlobalInstall()) {
|
|
45
|
+
console.log('CLEO: Skipping global bootstrap (not npm global install)');
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
console.log('CLEO: Bootstrapping global system...');
|
|
50
|
+
|
|
51
|
+
const cleoHome = join(homedir(), '.cleo');
|
|
52
|
+
const globalTemplatesDir = join(cleoHome, 'templates');
|
|
53
|
+
const globalAgentsDir = join(homedir(), '.agents');
|
|
54
|
+
|
|
55
|
+
// Create directories
|
|
56
|
+
await mkdir(globalTemplatesDir, { recursive: true });
|
|
57
|
+
await mkdir(globalAgentsDir, { recursive: true });
|
|
58
|
+
|
|
59
|
+
// Copy CLEO-INJECTION.md template
|
|
60
|
+
const packageRoot = getPackageRoot();
|
|
61
|
+
const templateSource = join(packageRoot, 'templates', 'CLEO-INJECTION.md');
|
|
62
|
+
const templateDest = join(globalTemplatesDir, 'CLEO-INJECTION.md');
|
|
63
|
+
|
|
64
|
+
if (existsSync(templateSource)) {
|
|
65
|
+
await copyFile(templateSource, templateDest);
|
|
66
|
+
console.log('CLEO: Installed global template (CLEO-INJECTION.md)');
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
// Setup CAAMP and MCP (these may fail gracefully if CAAMP isn't fully configured yet)
|
|
70
|
+
try {
|
|
71
|
+
const { getInstalledProviders, inject, buildInjectionContent } = await import('@cleocode/caamp');
|
|
72
|
+
|
|
73
|
+
// Create ~/.agents/AGENTS.md with CLEO block
|
|
74
|
+
const globalAgentsMd = join(globalAgentsDir, 'AGENTS.md');
|
|
75
|
+
let agentsContent = '';
|
|
76
|
+
|
|
77
|
+
if (existsSync(globalAgentsMd)) {
|
|
78
|
+
agentsContent = await readFile(globalAgentsMd, 'utf-8');
|
|
79
|
+
// Strip old CLEO blocks
|
|
80
|
+
agentsContent = agentsContent.replace(/\n?<!-- CLEO:START -->[\s\S]*?<!-- CLEO:END -->\n?/g, '');
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
// Inject CLEO reference
|
|
84
|
+
await inject(globalAgentsMd, '@~/.cleo/templates/CLEO-INJECTION.md');
|
|
85
|
+
console.log('CLEO: Updated ~/.agents/AGENTS.md');
|
|
86
|
+
|
|
87
|
+
// Install MCP server to detected providers
|
|
88
|
+
const providers = getInstalledProviders();
|
|
89
|
+
if (providers.length > 0) {
|
|
90
|
+
const { generateMcpServerEntry, getMcpServerName } = await import('../dist/core/mcp/index.js');
|
|
91
|
+
const { installMcpServerToAll } = await import('@cleocode/caamp');
|
|
92
|
+
|
|
93
|
+
// Detect environment (stable/beta/dev)
|
|
94
|
+
const env = generateMcpServerEntry.length === 1
|
|
95
|
+
? { mode: 'stable', source: 'npm' }
|
|
96
|
+
: { mode: 'stable', source: 'npm' };
|
|
97
|
+
|
|
98
|
+
const serverEntry = generateMcpServerEntry(env);
|
|
99
|
+
const serverName = getMcpServerName(env);
|
|
100
|
+
|
|
101
|
+
await installMcpServerToAll(providers, serverName, serverEntry, 'global', process.cwd());
|
|
102
|
+
console.log(`CLEO: Installed MCP server to ${providers.length} provider(s)`);
|
|
103
|
+
}
|
|
104
|
+
} catch (err) {
|
|
105
|
+
// CAAMP/MCP setup is optional at install time - will be set up on first use
|
|
106
|
+
console.log('CLEO: CAAMP/MCP setup deferred (will complete on first use)');
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
console.log('CLEO: Global bootstrap complete!');
|
|
110
|
+
console.log('CLEO: Run "cleo init" in any project to set up local CLEO.');
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
// Run bootstrap
|
|
114
|
+
bootstrapGlobalCleo().catch(err => {
|
|
115
|
+
console.error('CLEO: Bootstrap error (non-fatal):', err.message);
|
|
116
|
+
process.exit(0); // Never fail npm install
|
|
117
|
+
});
|