@codeledger/cli 0.10.18 → 0.10.20
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 +19 -8
- package/bin/codeledger.js +7 -5
- package/package.json +2 -2
- package/scripts/postinstall.js +21 -36
package/README.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
# @codeledger/cli — CodeLedger
|
|
1
|
+
# @codeledger/cli — CodeLedger
|
|
2
2
|
|
|
3
3
|
**Deterministic, bounded context selection for AI coding agents.**
|
|
4
|
-
Published by [
|
|
4
|
+
Published by [Intelligent Context AI, Inc.](https://codeledger.dev).
|
|
5
5
|
|
|
6
6
|
- Website: https://codeledger.dev
|
|
7
7
|
- Live demo: https://demo.codeledger.dev
|
|
@@ -10,13 +10,13 @@ Published by [ContextECF](https://codeledger.dev) (Intelligent Context AI, Inc.)
|
|
|
10
10
|
|
|
11
11
|
> **Installing?** Make sure you use the scope: `npm install -g @codeledger/cli`.
|
|
12
12
|
> There is an unrelated unscoped `codeledger` package on npm by a different
|
|
13
|
-
> author. The real CodeLedger
|
|
13
|
+
> author. The real CodeLedger package is published under the
|
|
14
14
|
> `@codeledger` scope.
|
|
15
15
|
|
|
16
16
|
## Install
|
|
17
17
|
|
|
18
18
|
```bash
|
|
19
|
-
npm install -g @codeledger/cli
|
|
19
|
+
npm install -g @codeledger/cli@latest
|
|
20
20
|
```
|
|
21
21
|
|
|
22
22
|
This package is a **thin npm wrapper**. When you install it, the
|
|
@@ -56,6 +56,15 @@ codeledger scan
|
|
|
56
56
|
codeledger help
|
|
57
57
|
```
|
|
58
58
|
|
|
59
|
+
If you installed an earlier CodeLedger version and `codeledger vendor`
|
|
60
|
+
cannot find the standalone runtime, upgrade first and rerun the command:
|
|
61
|
+
|
|
62
|
+
```bash
|
|
63
|
+
npm install -g @codeledger/cli@latest
|
|
64
|
+
codeledger init
|
|
65
|
+
codeledger vendor
|
|
66
|
+
```
|
|
67
|
+
|
|
59
68
|
All arguments, environment variables, stdin, and exit codes pass
|
|
60
69
|
straight through to the hardened binary.
|
|
61
70
|
|
|
@@ -88,7 +97,7 @@ invoke the repo-local wrapper directly:
|
|
|
88
97
|
## Air-gapped / offline install
|
|
89
98
|
|
|
90
99
|
```bash
|
|
91
|
-
CODELEDGER_SKIP_POSTINSTALL=1 npm install -g @codeledger/cli
|
|
100
|
+
CODELEDGER_SKIP_POSTINSTALL=1 npm install -g @codeledger/cli@latest
|
|
92
101
|
|
|
93
102
|
# then place the hardened binary at:
|
|
94
103
|
# ~/.cache/codeledger/bin/codeledger-hardened-v<version>
|
|
@@ -108,6 +117,8 @@ If `postinstall` was skipped (e.g. `npm install --ignore-scripts`),
|
|
|
108
117
|
recover with any of:
|
|
109
118
|
|
|
110
119
|
```bash
|
|
120
|
+
npm install -g @codeledger/cli@latest
|
|
121
|
+
# or retry the current install
|
|
111
122
|
npm rebuild @codeledger/cli
|
|
112
123
|
# or
|
|
113
124
|
node $(npm root -g)/@codeledger/cli/scripts/postinstall.js
|
|
@@ -121,6 +132,6 @@ CodeLedger Core Engine License.
|
|
|
121
132
|
|
|
122
133
|
## Source
|
|
123
134
|
|
|
124
|
-
Source code lives at <https://github.com/codeledgerECF/codeledger
|
|
125
|
-
The hardened binary shipped with this wrapper is
|
|
126
|
-
|
|
135
|
+
Source code lives at <https://github.com/codeledgerECF/codeledger>.
|
|
136
|
+
The hardened binary shipped with this wrapper is published through the
|
|
137
|
+
same public GitHub Releases channel used by the installer.
|
package/bin/codeledger.js
CHANGED
|
@@ -51,8 +51,9 @@ if (!existsSync(BINARY_PATH)) {
|
|
|
51
51
|
'',
|
|
52
52
|
'Options:',
|
|
53
53
|
' 1. Use Rosetta 2 (recommended):',
|
|
54
|
-
' arch -arm64 npm install -g @codeledger/cli',
|
|
55
|
-
' 2.
|
|
54
|
+
' arch -arm64 npm install -g @codeledger/cli@latest',
|
|
55
|
+
' 2. Update CodeLedger, then use the vendored standalone CLI:',
|
|
56
|
+
' npm install -g @codeledger/cli@latest',
|
|
56
57
|
' codeledger init # in your repo, sets up vendored Node.js-based CLI',
|
|
57
58
|
' ./.codeledger/bin/codeledger --version',
|
|
58
59
|
' 3. Download a binary manually from:',
|
|
@@ -66,9 +67,10 @@ if (!existsSync(BINARY_PATH)) {
|
|
|
66
67
|
'',
|
|
67
68
|
'The postinstall step may have been skipped (e.g. --ignore-scripts).',
|
|
68
69
|
'Recover with one of:',
|
|
69
|
-
` 1. npm
|
|
70
|
-
` 2.
|
|
71
|
-
` 3.
|
|
70
|
+
` 1. Upgrade: npm install -g @codeledger/cli@latest`,
|
|
71
|
+
` 2. Retry this install: npm rebuild @codeledger/cli`,
|
|
72
|
+
` 3. node "${installerPath}"`,
|
|
73
|
+
` 4. Re-run the install without --ignore-scripts`,
|
|
72
74
|
'',
|
|
73
75
|
'Or download the binary manually from:',
|
|
74
76
|
` https://github.com/codeledgerECF/codeledger/releases/tag/v${version}`,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@codeledger/cli",
|
|
3
|
-
"version": "0.10.
|
|
3
|
+
"version": "0.10.20",
|
|
4
4
|
"mcpName": "io.github.codeledgerECF/codeledger",
|
|
5
5
|
"description": "Thin npm wrapper that installs the hardened CodeLedger binary from GitHub Releases. Zero engine code ships in this package.",
|
|
6
6
|
"type": "commonjs",
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
},
|
|
23
23
|
"repository": {
|
|
24
24
|
"type": "git",
|
|
25
|
-
"url": "github:codeledgerECF/codeledger
|
|
25
|
+
"url": "github:codeledgerECF/codeledger"
|
|
26
26
|
},
|
|
27
27
|
"license": "SEE LICENSE IN LICENSE",
|
|
28
28
|
"keywords": [
|
package/scripts/postinstall.js
CHANGED
|
@@ -46,11 +46,10 @@ if (process.env.CODELEDGER_SKIP_POSTINSTALL === '1') {
|
|
|
46
46
|
process.exit(0);
|
|
47
47
|
}
|
|
48
48
|
|
|
49
|
-
// Skip when running inside
|
|
50
|
-
//
|
|
51
|
-
//
|
|
52
|
-
//
|
|
53
|
-
// version may not even exist yet.
|
|
49
|
+
// Skip when running inside this source workspace (dev mode). The presence of
|
|
50
|
+
// pnpm-workspace.yaml two directories up is a reliable signal that this is not
|
|
51
|
+
// a real end-user install, and the release binary for this version may not
|
|
52
|
+
// exist yet.
|
|
54
53
|
try {
|
|
55
54
|
const path = require('node:path');
|
|
56
55
|
const fs = require('node:fs');
|
|
@@ -69,8 +68,7 @@ try {
|
|
|
69
68
|
// Mac runner on the release CI plan as of 2026-04-09. Intel Mac
|
|
70
69
|
// users hit the "unsupported platform" soft-fail below, which tells
|
|
71
70
|
// them to download manually from the GitHub Release. Re-add when a
|
|
72
|
-
// working Intel Mac
|
|
73
|
-
// matrix comment).
|
|
71
|
+
// working Intel Mac binary is available.
|
|
74
72
|
const PLATFORM_MAP = {
|
|
75
73
|
'darwin-arm64': 'darwin-arm64',
|
|
76
74
|
'linux-x64': 'linux-x64',
|
|
@@ -87,9 +85,9 @@ if (!platformSuffix) {
|
|
|
87
85
|
console.log('');
|
|
88
86
|
console.log('Options:');
|
|
89
87
|
console.log(' 1. Use Rosetta 2 (recommended):');
|
|
90
|
-
console.log(' arch -arm64 npm install -g @codeledger/cli');
|
|
88
|
+
console.log(' arch -arm64 npm install -g @codeledger/cli@latest');
|
|
91
89
|
console.log(' 2. Use the vendored standalone CLI after init:');
|
|
92
|
-
console.log(' CODELEDGER_SKIP_POSTINSTALL=1 npm install -g @codeledger/cli');
|
|
90
|
+
console.log(' CODELEDGER_SKIP_POSTINSTALL=1 npm install -g @codeledger/cli@latest');
|
|
93
91
|
console.log(' codeledger init # sets up vendored Node.js-based CLI');
|
|
94
92
|
console.log(' 3. Download a binary manually from:');
|
|
95
93
|
console.log(` https://github.com/codeledgerECF/codeledger/releases/tag/v${version}`);
|
|
@@ -104,7 +102,7 @@ if (!platformSuffix) {
|
|
|
104
102
|
`codeledger: v${version} does not provide a hardened binary for ${platformKey}.`,
|
|
105
103
|
);
|
|
106
104
|
console.error(
|
|
107
|
-
'codeledger: you can still
|
|
105
|
+
'codeledger: you can still use the published source package or a supported release asset.',
|
|
108
106
|
);
|
|
109
107
|
}
|
|
110
108
|
// Fail softly: don't block `npm install` for unsupported platforms. The
|
|
@@ -112,13 +110,8 @@ if (!platformSuffix) {
|
|
|
112
110
|
process.exit(0);
|
|
113
111
|
}
|
|
114
112
|
|
|
115
|
-
// Binaries are hosted on the
|
|
116
|
-
//
|
|
117
|
-
// assets are not anonymously downloadable). The release pipeline in
|
|
118
|
-
// codeledger-blackbox builds the binaries, then a promote_binaries
|
|
119
|
-
// job uploads them cross-repo to the public release using a PAT.
|
|
120
|
-
// Users' `npm install -g @codeledger/cli` fetches from the public
|
|
121
|
-
// URL with no auth required.
|
|
113
|
+
// Binaries are hosted on the public CodeLedger GitHub Releases page so
|
|
114
|
+
// `npm install -g @codeledger/cli` can fetch them without authentication.
|
|
122
115
|
const RELEASE_BASE =
|
|
123
116
|
process.env.CODELEDGER_BINARY_URL ||
|
|
124
117
|
`https://github.com/codeledgerECF/codeledger/releases/download/v${version}`;
|
|
@@ -181,18 +174,9 @@ function fetchBufferOnce(url, redirectDepth = 0) {
|
|
|
181
174
|
});
|
|
182
175
|
}
|
|
183
176
|
|
|
184
|
-
// Retry wrapper that tolerates the
|
|
185
|
-
//
|
|
186
|
-
//
|
|
187
|
-
// binaries land on the public GitHub release (see the Phase 1d comment
|
|
188
|
-
// in release-dispatch.yml). For up to ~10 minutes after a user first
|
|
189
|
-
// sees @codeledger/cli@<version> on npm, the hardened binary URL may
|
|
190
|
-
// 404. This wrapper retries 404s with exponential backoff (10s, 20s,
|
|
191
|
-
// 40s, 60s, 60s, 60s, 60s, 60s, 60s, 60s → 450s total) so installs
|
|
192
|
-
// during the race window eventually succeed instead of hard-failing.
|
|
193
|
-
//
|
|
194
|
-
// Non-404 errors (DNS, network, timeouts) fail fast — retrying a DNS
|
|
195
|
-
// failure won't help.
|
|
177
|
+
// Retry wrapper that tolerates the short propagation window where a freshly
|
|
178
|
+
// published package may be visible before all release assets are available.
|
|
179
|
+
// A 404 is retried with exponential backoff; non-404 errors fail fast.
|
|
196
180
|
async function fetchBuffer(url) {
|
|
197
181
|
const backoffs = [10, 20, 40, 60, 60, 60, 60, 60, 60, 60]; // seconds
|
|
198
182
|
let lastErr;
|
|
@@ -215,7 +199,7 @@ async function fetchBuffer(url) {
|
|
|
215
199
|
}
|
|
216
200
|
console.log(
|
|
217
201
|
'codeledger: Binary not yet available after all retries. ' +
|
|
218
|
-
'
|
|
202
|
+
'Upgrade or retry later with: npm install -g @codeledger/cli@latest',
|
|
219
203
|
);
|
|
220
204
|
throw lastErr;
|
|
221
205
|
}
|
|
@@ -288,16 +272,17 @@ if (require.main === module) {
|
|
|
288
272
|
console.error(`codeledger: postinstall failed — ${err.message}`);
|
|
289
273
|
console.error('');
|
|
290
274
|
console.error('Recovery options:');
|
|
291
|
-
console.error(' 1.
|
|
292
|
-
console.error(' 2.
|
|
293
|
-
console.error('
|
|
275
|
+
console.error(' 1. Upgrade: npm install -g @codeledger/cli@latest');
|
|
276
|
+
console.error(' 2. Retry this install: npm rebuild @codeledger/cli');
|
|
277
|
+
console.error(' 3. Air-gapped install:');
|
|
278
|
+
console.error(' CODELEDGER_SKIP_POSTINSTALL=1 npm install -g @codeledger/cli@latest');
|
|
294
279
|
console.error(' then manually place the binary at:');
|
|
295
280
|
console.error(` ${BINARY_LOCAL_PATH}`);
|
|
296
|
-
console.error('
|
|
297
|
-
console.error(' CODELEDGER_BINARY_URL=https://your-mirror/path npm install -g @codeledger/cli');
|
|
281
|
+
console.error(' 4. Use a mirror:');
|
|
282
|
+
console.error(' CODELEDGER_BINARY_URL=https://your-mirror/path npm install -g @codeledger/cli@latest');
|
|
298
283
|
console.error('');
|
|
299
284
|
console.error(
|
|
300
|
-
`Manual download: https://github.com/codeledgerECF/codeledger
|
|
285
|
+
`Manual download: https://github.com/codeledgerECF/codeledger/releases/tag/v${version}`,
|
|
301
286
|
);
|
|
302
287
|
process.exit(1);
|
|
303
288
|
});
|