@nuucognition/flint-cli 0.6.0-dev.3 → 0.6.0-dev.5
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 +46 -9
- package/package.json +4 -4
package/dist/index.js
CHANGED
|
@@ -157843,6 +157843,36 @@ Created repository: ${export_pc.bold(name)}`));
|
|
|
157843
157843
|
process.exit(1);
|
|
157844
157844
|
}
|
|
157845
157845
|
})
|
|
157846
|
+
).addCommand(
|
|
157847
|
+
new Command("clone").description("Clone an existing remote into Workspace/Repos/ and declare it in flint.toml").argument("<name>", "Name for this repository (Proper Case)").argument("<remote>", "Git remote URL to clone from").option("-p, --path <dir>", "Path to flint (default: auto-detect)").action(async (name, remote, options3) => {
|
|
157848
|
+
try {
|
|
157849
|
+
const flintPath = options3.path || await findFlintRoot(process.cwd());
|
|
157850
|
+
if (!flintPath) {
|
|
157851
|
+
console.error(export_pc.red("Error: Not inside a Flint. Use --path or cd into a Flint."));
|
|
157852
|
+
process.exit(1);
|
|
157853
|
+
}
|
|
157854
|
+
const existing = await getWorkspaceRepository(flintPath, name);
|
|
157855
|
+
if (existing) {
|
|
157856
|
+
console.error(export_pc.red(`Error: Repository "${name}" already exists in flint.toml.`));
|
|
157857
|
+
process.exit(1);
|
|
157858
|
+
}
|
|
157859
|
+
console.log(export_pc.dim(`
|
|
157860
|
+
Cloning repository ${name} from ${remote}...`));
|
|
157861
|
+
await addWorkspaceRepository(flintPath, name, remote);
|
|
157862
|
+
const repoPath = await cloneRepository(flintPath, name, remote);
|
|
157863
|
+
await updateGitignore(flintPath);
|
|
157864
|
+
console.log(export_pc.green(`
|
|
157865
|
+
Cloned repository: ${export_pc.bold(name)}`));
|
|
157866
|
+
console.log(export_pc.dim(` Remote: ${remote}`));
|
|
157867
|
+
console.log(export_pc.dim(` Path: ${abbreviatePath(repoPath)}`));
|
|
157868
|
+
console.log(export_pc.dim(" Added to flint.toml [workspace] section"));
|
|
157869
|
+
console.log();
|
|
157870
|
+
} catch (err) {
|
|
157871
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
157872
|
+
console.error(export_pc.red(`Error: ${message}`));
|
|
157873
|
+
process.exit(1);
|
|
157874
|
+
}
|
|
157875
|
+
})
|
|
157846
157876
|
).addCommand(
|
|
157847
157877
|
new Command("remove").description("Remove a workspace repository").argument("<name>", "Name of the repository to remove").option("-f, --force", "Skip confirmation prompt").option("-p, --path <dir>", "Path to flint (default: auto-detect)").action(async (name, options3) => {
|
|
157848
157878
|
try {
|
|
@@ -164158,10 +164188,17 @@ function isCommandOnPath(name) {
|
|
|
164158
164188
|
}
|
|
164159
164189
|
function resolveCommand2(name) {
|
|
164160
164190
|
if (process.platform !== "win32") return { cmd: name, prependArgs: [] };
|
|
164161
|
-
|
|
164162
|
-
|
|
164163
|
-
|
|
164164
|
-
|
|
164191
|
+
let resolved;
|
|
164192
|
+
if (name.includes("\\") || name.includes("/")) {
|
|
164193
|
+
if (!existsSync72(name)) return { cmd: name, prependArgs: [] };
|
|
164194
|
+
resolved = name;
|
|
164195
|
+
} else {
|
|
164196
|
+
const where = spawnSync2("where", [name], { encoding: "utf-8", stdio: ["ignore", "pipe", "ignore"], windowsHide: true });
|
|
164197
|
+
const lines = (where.stdout ?? "").trim().split(/\r?\n/).map((line) => line.trim()).filter(Boolean);
|
|
164198
|
+
if (where.status !== 0 || lines.length === 0) return { cmd: name, prependArgs: [] };
|
|
164199
|
+
const preferred = lines.find((line) => /\.(exe|cmd|bat|com)$/i.test(line));
|
|
164200
|
+
resolved = preferred ?? lines[0];
|
|
164201
|
+
}
|
|
164165
164202
|
if (!resolved.toLowerCase().endsWith(".cmd")) return { cmd: resolved, prependArgs: [] };
|
|
164166
164203
|
try {
|
|
164167
164204
|
const content = readFileSync6(resolved, "utf-8");
|
|
@@ -164552,7 +164589,7 @@ async function bootstrapCodexSession(cwd, initPrompt, options3 = {}) {
|
|
|
164552
164589
|
return new Promise((resolve19, reject) => {
|
|
164553
164590
|
const start = async () => {
|
|
164554
164591
|
const executable = await getExecutable("codex");
|
|
164555
|
-
const spawnCmd = executable.
|
|
164592
|
+
const spawnCmd = executable.resolvedCommand.cmd;
|
|
164556
164593
|
const proc = spawn6(spawnCmd, [...executable.resolvedCommand.prependArgs, ...buildCodexAppServerArgs(options3)], {
|
|
164557
164594
|
stdio: ["pipe", "pipe", "pipe"],
|
|
164558
164595
|
cwd,
|
|
@@ -167050,7 +167087,7 @@ async function spawnHarnessProcess(options3) {
|
|
|
167050
167087
|
writeSession(options3.sessionsDir, session, { emitter: options3.emitter });
|
|
167051
167088
|
return null;
|
|
167052
167089
|
}
|
|
167053
|
-
const spawnCmd = executable.
|
|
167090
|
+
const spawnCmd = executable.resolvedCommand.cmd;
|
|
167054
167091
|
const opencodeStreamCapturePath = harness.name === "opencode" ? (() => {
|
|
167055
167092
|
ensureOpencodeStreamCaptureDir();
|
|
167056
167093
|
return buildPendingOpencodeStreamCapturePath(options3.sessionId);
|
|
@@ -167613,7 +167650,7 @@ async function spawnDetachedResume(session, harness, options3) {
|
|
|
167613
167650
|
writeSession(options3.sessionsDir, session);
|
|
167614
167651
|
throw new Error(`Orbh runtime '${harness.name}' is not installed or not available.`);
|
|
167615
167652
|
}
|
|
167616
|
-
const spawnCmd = executable.
|
|
167653
|
+
const spawnCmd = executable.resolvedCommand.cmd;
|
|
167617
167654
|
const child = spawn32(spawnCmd, [...executable.resolvedCommand.prependArgs, ...args], {
|
|
167618
167655
|
cwd: options3.cwd,
|
|
167619
167656
|
detached: process.platform !== "win32",
|
|
@@ -167815,7 +167852,7 @@ async function launchInteractive(options3) {
|
|
|
167815
167852
|
session2.status = "in-progress";
|
|
167816
167853
|
writeSession(options3.sessionsDir, session2);
|
|
167817
167854
|
const executable2 = await getExecutable(harness2.name);
|
|
167818
|
-
const spawnCmd2 = executable2.
|
|
167855
|
+
const spawnCmd2 = executable2.resolvedCommand.cmd;
|
|
167819
167856
|
const child2 = spawn32(spawnCmd2, [...executable2.resolvedCommand.prependArgs, ...args2], {
|
|
167820
167857
|
cwd: options3.cwd,
|
|
167821
167858
|
stdio: "inherit",
|
|
@@ -167913,7 +167950,7 @@ async function launchInteractive(options3) {
|
|
|
167913
167950
|
session.status = "in-progress";
|
|
167914
167951
|
writeSession(options3.sessionsDir, session);
|
|
167915
167952
|
const executable = await getExecutable(harness.name);
|
|
167916
|
-
const spawnCmd = executable.
|
|
167953
|
+
const spawnCmd = executable.resolvedCommand.cmd;
|
|
167917
167954
|
const child = spawn32(spawnCmd, [...executable.resolvedCommand.prependArgs, ...args], {
|
|
167918
167955
|
cwd: options3.cwd,
|
|
167919
167956
|
stdio: "inherit",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nuucognition/flint-cli",
|
|
3
|
-
"version": "0.6.0-dev.
|
|
3
|
+
"version": "0.6.0-dev.5",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Flint cognitive workspace CLI",
|
|
6
6
|
"license": "PROPRIETARY",
|
|
@@ -34,13 +34,13 @@
|
|
|
34
34
|
"tsx": "^4.19.2",
|
|
35
35
|
"typescript": "^5.9.2",
|
|
36
36
|
"@nuucognition/flint-server": "0.0.1",
|
|
37
|
+
"@nuucognition/flint-sdk": "0.0.1",
|
|
37
38
|
"@nuucognition/eslint-config": "0.0.0",
|
|
39
|
+
"@nuucognition/flint": "0.1.0",
|
|
38
40
|
"@nuucognition/flint-migrations": "0.1.0",
|
|
39
41
|
"@nuucognition/orbh": "0.0.1-dev.0",
|
|
40
|
-
"@nuucognition/flint": "0.1.0",
|
|
41
|
-
"@nuucognition/orbh-cli": "0.1.0-dev.1",
|
|
42
42
|
"@nuucognition/typescript-config": "0.0.0",
|
|
43
|
-
"@nuucognition/
|
|
43
|
+
"@nuucognition/orbh-cli": "0.1.0-dev.1"
|
|
44
44
|
},
|
|
45
45
|
"scripts": {
|
|
46
46
|
"predev": "turbo build --filter=@nuucognition/flint-cli^...",
|