@letra-ai/cli 0.1.13 → 0.1.14
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/dist/index.js +14 -5
- package/package.json +7 -3
- package/tsup.config.ts +11 -0
- package/dist/index.cjs +0 -1577
- package/dist/index.d.cts +0 -2
package/dist/index.js
CHANGED
|
@@ -1,4 +1,9 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
1
3
|
// src/index.ts
|
|
4
|
+
import { readFileSync as readFileSync7 } from "fs";
|
|
5
|
+
import { join as join8, resolve as resolve7 } from "path";
|
|
6
|
+
import { fileURLToPath as fileURLToPath2 } from "url";
|
|
2
7
|
import { Command as Command3 } from "commander";
|
|
3
8
|
|
|
4
9
|
// src/commands/decision.ts
|
|
@@ -152,20 +157,20 @@ var __dirname = fileURLToPath(new URL(".", import.meta.url));
|
|
|
152
157
|
function ask(query, options) {
|
|
153
158
|
if (!process.stdin.isTTY) return Promise.resolve(options[0]);
|
|
154
159
|
const rl = createInterface({ input: process.stdin, output: process.stdout });
|
|
155
|
-
return new Promise((
|
|
160
|
+
return new Promise((resolve8) => {
|
|
156
161
|
const formatted = `${chalk3.cyan(query)} ${options.map((o) => chalk3.gray(`(${o})`)).join(" ")}
|
|
157
162
|
> `;
|
|
158
163
|
rl.question(formatted, (answer) => {
|
|
159
164
|
rl.close();
|
|
160
165
|
const trimmed = answer.trim().toLowerCase();
|
|
161
166
|
if (trimmed && options.some((o) => o.toLowerCase().startsWith(trimmed))) {
|
|
162
|
-
|
|
167
|
+
resolve8(
|
|
163
168
|
options.find((o) => o.toLowerCase().startsWith(trimmed)) ?? options[0]
|
|
164
169
|
);
|
|
165
170
|
} else if (trimmed && options.includes(trimmed)) {
|
|
166
|
-
|
|
171
|
+
resolve8(trimmed);
|
|
167
172
|
} else {
|
|
168
|
-
|
|
173
|
+
resolve8(options[0]);
|
|
169
174
|
}
|
|
170
175
|
});
|
|
171
176
|
});
|
|
@@ -1563,8 +1568,12 @@ async function validate(targetPath, options) {
|
|
|
1563
1568
|
}
|
|
1564
1569
|
|
|
1565
1570
|
// src/index.ts
|
|
1571
|
+
var __dirname2 = fileURLToPath2(new URL(".", import.meta.url));
|
|
1572
|
+
var pkg = JSON.parse(
|
|
1573
|
+
readFileSync7(join8(resolve7(__dirname2, ".."), "package.json"), "utf-8")
|
|
1574
|
+
);
|
|
1566
1575
|
var program = new Command3();
|
|
1567
|
-
program.name("letra").description("SDD-agnostic memory framework for AI coding agents").version(
|
|
1576
|
+
program.name("letra").description("SDD-agnostic memory framework for AI coding agents").version(pkg.version);
|
|
1568
1577
|
program.command("init [path]").option("--yes", "Skip prompts and use defaults").description("Initialize .letra/ directory with templates").action((path, options) => init(path, { ...options }));
|
|
1569
1578
|
program.command("spec <name>").option(
|
|
1570
1579
|
"--template <type>",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@letra-ai/cli",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.14",
|
|
4
4
|
"description": "SDD-agnostic memory framework for AI coding agents",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"types": "./dist/index.d.ts",
|
|
11
11
|
"scripts": {
|
|
12
12
|
"dev": "tsx src/index.ts",
|
|
13
|
-
"build": "tsup
|
|
13
|
+
"build": "tsup",
|
|
14
14
|
"build:binary": "pkg . --out-path dist/bin",
|
|
15
15
|
"lint": "biome check src/",
|
|
16
16
|
"typecheck": "tsc --noEmit",
|
|
@@ -48,7 +48,11 @@
|
|
|
48
48
|
"pkg": {
|
|
49
49
|
"scripts": "dist/**/*.js",
|
|
50
50
|
"assets": ".letra/**/*",
|
|
51
|
-
"targets": [
|
|
51
|
+
"targets": [
|
|
52
|
+
"node22-win-x64",
|
|
53
|
+
"node22-linux-x64",
|
|
54
|
+
"node22-macos-x64"
|
|
55
|
+
],
|
|
52
56
|
"outputPath": "dist/bin"
|
|
53
57
|
},
|
|
54
58
|
"engines": {
|