@omnidev-ai/cli 0.5.2 → 0.5.4
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 +56 -30
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -28,6 +28,7 @@ import { buildApplication, buildRouteMap as buildRouteMap4 } from "@stricli/core
|
|
|
28
28
|
|
|
29
29
|
// ../adapters/src/claude-code/index.ts
|
|
30
30
|
import { existsSync, mkdirSync } from "node:fs";
|
|
31
|
+
import { writeFile } from "node:fs/promises";
|
|
31
32
|
import { join } from "node:path";
|
|
32
33
|
var claudeCodeAdapter = {
|
|
33
34
|
id: "claude-code",
|
|
@@ -36,7 +37,7 @@ var claudeCodeAdapter = {
|
|
|
36
37
|
const claudeMdPath = join(ctx.projectRoot, "CLAUDE.md");
|
|
37
38
|
const filesCreated = [];
|
|
38
39
|
if (!existsSync(claudeMdPath)) {
|
|
39
|
-
await
|
|
40
|
+
await writeFile(claudeMdPath, generateClaudeTemplate(), "utf-8");
|
|
40
41
|
filesCreated.push("CLAUDE.md");
|
|
41
42
|
}
|
|
42
43
|
return {
|
|
@@ -59,7 +60,7 @@ description: "${skill.description}"
|
|
|
59
60
|
---
|
|
60
61
|
|
|
61
62
|
${skill.instructions}`;
|
|
62
|
-
await
|
|
63
|
+
await writeFile(skillPath, content, "utf-8");
|
|
63
64
|
filesWritten.push(`.claude/skills/${skill.name}/SKILL.md`);
|
|
64
65
|
}
|
|
65
66
|
return {
|
|
@@ -80,6 +81,7 @@ function generateClaudeTemplate() {
|
|
|
80
81
|
}
|
|
81
82
|
// ../adapters/src/codex/index.ts
|
|
82
83
|
import { existsSync as existsSync2 } from "node:fs";
|
|
84
|
+
import { writeFile as writeFile2 } from "node:fs/promises";
|
|
83
85
|
import { join as join2 } from "node:path";
|
|
84
86
|
var codexAdapter = {
|
|
85
87
|
id: "codex",
|
|
@@ -88,7 +90,7 @@ var codexAdapter = {
|
|
|
88
90
|
const agentsMdPath = join2(ctx.projectRoot, "AGENTS.md");
|
|
89
91
|
const filesCreated = [];
|
|
90
92
|
if (!existsSync2(agentsMdPath)) {
|
|
91
|
-
await
|
|
93
|
+
await writeFile2(agentsMdPath, generateAgentsTemplate(), "utf-8");
|
|
92
94
|
filesCreated.push("AGENTS.md");
|
|
93
95
|
}
|
|
94
96
|
return {
|
|
@@ -115,6 +117,7 @@ function generateAgentsTemplate() {
|
|
|
115
117
|
}
|
|
116
118
|
// ../adapters/src/cursor/index.ts
|
|
117
119
|
import { mkdirSync as mkdirSync2 } from "node:fs";
|
|
120
|
+
import { writeFile as writeFile3 } from "node:fs/promises";
|
|
118
121
|
import { join as join3 } from "node:path";
|
|
119
122
|
var cursorAdapter = {
|
|
120
123
|
id: "cursor",
|
|
@@ -134,7 +137,7 @@ var cursorAdapter = {
|
|
|
134
137
|
mkdirSync2(rulesDir, { recursive: true });
|
|
135
138
|
for (const rule of bundle.rules) {
|
|
136
139
|
const rulePath = join3(rulesDir, `omnidev-${rule.name}.mdc`);
|
|
137
|
-
await
|
|
140
|
+
await writeFile3(rulePath, rule.content, "utf-8");
|
|
138
141
|
filesWritten.push(`.cursor/rules/omnidev-${rule.name}.mdc`);
|
|
139
142
|
}
|
|
140
143
|
return {
|
|
@@ -145,6 +148,7 @@ var cursorAdapter = {
|
|
|
145
148
|
};
|
|
146
149
|
// ../adapters/src/opencode/index.ts
|
|
147
150
|
import { existsSync as existsSync3, mkdirSync as mkdirSync3 } from "node:fs";
|
|
151
|
+
import { writeFile as writeFile4 } from "node:fs/promises";
|
|
148
152
|
import { join as join4 } from "node:path";
|
|
149
153
|
var opencodeAdapter = {
|
|
150
154
|
id: "opencode",
|
|
@@ -155,7 +159,7 @@ var opencodeAdapter = {
|
|
|
155
159
|
const instructionsPath = join4(opencodeDir, "instructions.md");
|
|
156
160
|
const filesCreated = [];
|
|
157
161
|
if (!existsSync3(instructionsPath)) {
|
|
158
|
-
await
|
|
162
|
+
await writeFile4(instructionsPath, generateOpencodeTemplate(), "utf-8");
|
|
159
163
|
filesCreated.push(".opencode/instructions.md");
|
|
160
164
|
}
|
|
161
165
|
return {
|
|
@@ -332,6 +336,9 @@ var capabilityRoutes = buildRouteMap({
|
|
|
332
336
|
|
|
333
337
|
// src/commands/doctor.ts
|
|
334
338
|
import { existsSync as existsSync4 } from "node:fs";
|
|
339
|
+
import { execFile } from "node:child_process";
|
|
340
|
+
import { readFile } from "node:fs/promises";
|
|
341
|
+
import { promisify } from "node:util";
|
|
335
342
|
import { buildCommand as buildCommand2 } from "@stricli/core";
|
|
336
343
|
var doctorCommand = buildCommand2({
|
|
337
344
|
docs: {
|
|
@@ -347,7 +354,7 @@ async function runDoctor() {
|
|
|
347
354
|
console.log("==============");
|
|
348
355
|
console.log("");
|
|
349
356
|
const checks = [
|
|
350
|
-
|
|
357
|
+
checkPackageManager(),
|
|
351
358
|
checkOmniLocalDir(),
|
|
352
359
|
checkConfig(),
|
|
353
360
|
checkRootGitignore(),
|
|
@@ -372,32 +379,50 @@ async function runDoctor() {
|
|
|
372
379
|
process.exit(1);
|
|
373
380
|
}
|
|
374
381
|
}
|
|
375
|
-
async function
|
|
376
|
-
const
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
382
|
+
async function checkPackageManager() {
|
|
383
|
+
const execFileAsync = promisify(execFile);
|
|
384
|
+
try {
|
|
385
|
+
const { stdout } = await execFileAsync("bun", ["--version"]);
|
|
386
|
+
const version = stdout.trim();
|
|
387
|
+
const firstPart = version.split(".")[0];
|
|
388
|
+
if (!firstPart) {
|
|
389
|
+
return {
|
|
390
|
+
name: "Package Manager",
|
|
391
|
+
passed: false,
|
|
392
|
+
message: `Invalid Bun version format: ${version}`,
|
|
393
|
+
fix: "Reinstall Bun: curl -fsSL https://bun.sh/install | bash"
|
|
394
|
+
};
|
|
395
|
+
}
|
|
396
|
+
const major = Number.parseInt(firstPart, 10);
|
|
397
|
+
if (major < 1) {
|
|
398
|
+
return {
|
|
399
|
+
name: "Package Manager",
|
|
400
|
+
passed: false,
|
|
401
|
+
message: `bun v${version}`,
|
|
402
|
+
fix: "Upgrade Bun: curl -fsSL https://bun.sh/install | bash"
|
|
403
|
+
};
|
|
404
|
+
}
|
|
380
405
|
return {
|
|
381
|
-
name: "
|
|
382
|
-
passed:
|
|
383
|
-
message: `
|
|
384
|
-
fix: "Reinstall Bun: curl -fsSL https://bun.sh/install | bash"
|
|
406
|
+
name: "Package Manager",
|
|
407
|
+
passed: true,
|
|
408
|
+
message: `bun v${version}`
|
|
385
409
|
};
|
|
386
|
-
}
|
|
387
|
-
|
|
388
|
-
|
|
410
|
+
} catch {}
|
|
411
|
+
try {
|
|
412
|
+
const { stdout } = await execFileAsync("npm", ["--version"]);
|
|
389
413
|
return {
|
|
390
|
-
name: "
|
|
414
|
+
name: "Package Manager",
|
|
415
|
+
passed: true,
|
|
416
|
+
message: `npm v${stdout.trim()}`
|
|
417
|
+
};
|
|
418
|
+
} catch {
|
|
419
|
+
return {
|
|
420
|
+
name: "Package Manager",
|
|
391
421
|
passed: false,
|
|
392
|
-
message:
|
|
393
|
-
fix: "
|
|
422
|
+
message: "Neither Bun nor npm is installed",
|
|
423
|
+
fix: "Install Bun (recommended): curl -fsSL https://bun.sh/install | bash"
|
|
394
424
|
};
|
|
395
425
|
}
|
|
396
|
-
return {
|
|
397
|
-
name: "Bun Version",
|
|
398
|
-
passed: true,
|
|
399
|
-
message: `v${version}`
|
|
400
|
-
};
|
|
401
426
|
}
|
|
402
427
|
async function checkOmniLocalDir() {
|
|
403
428
|
const exists = existsSync4(".omni");
|
|
@@ -452,7 +477,7 @@ async function checkRootGitignore() {
|
|
|
452
477
|
fix: "Run: omnidev init"
|
|
453
478
|
};
|
|
454
479
|
}
|
|
455
|
-
const content = await
|
|
480
|
+
const content = await readFile(gitignorePath, "utf-8");
|
|
456
481
|
const lines = content.split(`
|
|
457
482
|
`).map((line) => line.trim());
|
|
458
483
|
const hasOmniDir = lines.includes(".omni/");
|
|
@@ -494,6 +519,7 @@ async function checkCapabilitiesDir() {
|
|
|
494
519
|
|
|
495
520
|
// src/commands/init.ts
|
|
496
521
|
import { existsSync as existsSync5, mkdirSync as mkdirSync4 } from "node:fs";
|
|
522
|
+
import { readFile as readFile2, writeFile as writeFile5 } from "node:fs/promises";
|
|
497
523
|
import {
|
|
498
524
|
generateInstructionsTemplate,
|
|
499
525
|
loadConfig,
|
|
@@ -552,7 +578,7 @@ async function runInit(_flags, providerArg) {
|
|
|
552
578
|
await setActiveProfile("default");
|
|
553
579
|
}
|
|
554
580
|
if (!existsSync5(".omni/instructions.md")) {
|
|
555
|
-
await
|
|
581
|
+
await writeFile5(".omni/instructions.md", generateInstructionsTemplate(), "utf-8");
|
|
556
582
|
}
|
|
557
583
|
const config = await loadConfig();
|
|
558
584
|
const ctx = {
|
|
@@ -637,7 +663,7 @@ async function updateRootGitignore() {
|
|
|
637
663
|
const entriesToAdd = [".omni/", "omni.local.toml"];
|
|
638
664
|
let content = "";
|
|
639
665
|
if (existsSync5(gitignorePath)) {
|
|
640
|
-
content = await
|
|
666
|
+
content = await readFile2(gitignorePath, "utf-8");
|
|
641
667
|
}
|
|
642
668
|
const lines = content.split(`
|
|
643
669
|
`);
|
|
@@ -652,7 +678,7 @@ async function updateRootGitignore() {
|
|
|
652
678
|
${missingEntries.join(`
|
|
653
679
|
`)}
|
|
654
680
|
`;
|
|
655
|
-
await
|
|
681
|
+
await writeFile5(gitignorePath, content + section, "utf-8");
|
|
656
682
|
}
|
|
657
683
|
|
|
658
684
|
// src/commands/profile.ts
|