@omnidev-ai/cli 0.10.1 → 0.11.1
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 +64 -10
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -103,12 +103,12 @@ var InstructionsMdWriter = {
|
|
|
103
103
|
omniMdContent = await readFile2(omniMdPath, "utf-8");
|
|
104
104
|
}
|
|
105
105
|
let content = omniMdContent;
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
## OmniDev
|
|
106
|
+
if (bundle.instructionsContent) {
|
|
107
|
+
content += `
|
|
109
108
|
|
|
110
109
|
${bundle.instructionsContent}
|
|
111
110
|
`;
|
|
111
|
+
}
|
|
112
112
|
await writeFile3(outputFullPath, content, "utf-8");
|
|
113
113
|
return {
|
|
114
114
|
filesWritten: [ctx.outputPath]
|
|
@@ -365,7 +365,7 @@ async function runAddCap(flags, name) {
|
|
|
365
365
|
console.log(` Inferred capability ID: ${capabilityId}`);
|
|
366
366
|
}
|
|
367
367
|
const config = await loadBaseConfig();
|
|
368
|
-
const activeProfile = await getActiveProfile() ??
|
|
368
|
+
const activeProfile = await getActiveProfile() ?? "default";
|
|
369
369
|
if (config.capabilities?.sources?.[capabilityId]) {
|
|
370
370
|
console.error(`✗ Capability source "${capabilityId}" already exists`);
|
|
371
371
|
console.log(" Use a different name or remove the existing source first");
|
|
@@ -400,7 +400,7 @@ async function runAddMcp(flags, name) {
|
|
|
400
400
|
process.exit(1);
|
|
401
401
|
}
|
|
402
402
|
const config = await loadBaseConfig();
|
|
403
|
-
const activeProfile = await getActiveProfile() ??
|
|
403
|
+
const activeProfile = await getActiveProfile() ?? "default";
|
|
404
404
|
if (config.mcps?.[name]) {
|
|
405
405
|
console.error(`✗ MCP "${name}" already exists`);
|
|
406
406
|
console.log(" Use a different name or remove the existing MCP first");
|
|
@@ -1119,8 +1119,7 @@ import { buildCommand as buildCommand4 } from "@stricli/core";
|
|
|
1119
1119
|
// src/prompts/provider.ts
|
|
1120
1120
|
import { checkbox, confirm } from "@inquirer/prompts";
|
|
1121
1121
|
var PROVIDER_GITIGNORE_FILES = {
|
|
1122
|
-
claude: ["CLAUDE.md", ".claude/"],
|
|
1123
|
-
"claude-code": ["CLAUDE.md", ".claude/"],
|
|
1122
|
+
"claude-code": ["CLAUDE.md", ".claude/", ".mcp.json"],
|
|
1124
1123
|
cursor: [".cursor/"],
|
|
1125
1124
|
codex: ["AGENTS.md", ".codex/"],
|
|
1126
1125
|
opencode: [".opencode/"]
|
|
@@ -1363,7 +1362,7 @@ async function runProfileList() {
|
|
|
1363
1362
|
process.exit(1);
|
|
1364
1363
|
}
|
|
1365
1364
|
const config = await loadConfig2();
|
|
1366
|
-
const activeProfile = await getActiveProfile2() ??
|
|
1365
|
+
const activeProfile = await getActiveProfile2() ?? "default";
|
|
1367
1366
|
const profiles = config.profiles ?? {};
|
|
1368
1367
|
const profileNames = Object.keys(profiles);
|
|
1369
1368
|
if (profileNames.length === 0) {
|
|
@@ -1573,7 +1572,7 @@ async function runSync() {
|
|
|
1573
1572
|
console.log("");
|
|
1574
1573
|
try {
|
|
1575
1574
|
const config = await loadConfig3();
|
|
1576
|
-
const activeProfile = await getActiveProfile3() ??
|
|
1575
|
+
const activeProfile = await getActiveProfile3() ?? "default";
|
|
1577
1576
|
let adapters = await getEnabledAdapters();
|
|
1578
1577
|
if (!existsSync8(PROVIDERS_STATE_PATH) || adapters.length === 0) {
|
|
1579
1578
|
console.log("No providers configured yet. Select your provider(s):");
|
|
@@ -1614,7 +1613,7 @@ import { debug } from "@omnidev-ai/core";
|
|
|
1614
1613
|
var require2 = createRequire2(import.meta.url);
|
|
1615
1614
|
function readCliVersion() {
|
|
1616
1615
|
try {
|
|
1617
|
-
const pkg = require2("
|
|
1616
|
+
const pkg = require2("../package.json");
|
|
1618
1617
|
if (typeof pkg?.version === "string") {
|
|
1619
1618
|
return pkg.version;
|
|
1620
1619
|
}
|
|
@@ -1735,15 +1734,70 @@ async function loadCapabilityExport(capability) {
|
|
|
1735
1734
|
|
|
1736
1735
|
// src/index.ts
|
|
1737
1736
|
import { debug as debug2 } from "@omnidev-ai/core";
|
|
1737
|
+
|
|
1738
|
+
// src/lib/version-check.ts
|
|
1739
|
+
var NPM_REGISTRY_URL = "https://registry.npmjs.org/@omnidev-ai/cli/latest";
|
|
1740
|
+
var FETCH_TIMEOUT_MS = 3000;
|
|
1741
|
+
async function fetchLatestVersion() {
|
|
1742
|
+
try {
|
|
1743
|
+
const controller = new AbortController;
|
|
1744
|
+
const timeoutId = setTimeout(() => controller.abort(), FETCH_TIMEOUT_MS);
|
|
1745
|
+
const response = await fetch(NPM_REGISTRY_URL, {
|
|
1746
|
+
signal: controller.signal,
|
|
1747
|
+
headers: {
|
|
1748
|
+
Accept: "application/json"
|
|
1749
|
+
}
|
|
1750
|
+
});
|
|
1751
|
+
clearTimeout(timeoutId);
|
|
1752
|
+
if (!response.ok) {
|
|
1753
|
+
return null;
|
|
1754
|
+
}
|
|
1755
|
+
const data = await response.json();
|
|
1756
|
+
return data.version ?? null;
|
|
1757
|
+
} catch {
|
|
1758
|
+
return null;
|
|
1759
|
+
}
|
|
1760
|
+
}
|
|
1761
|
+
function isNewerVersion(currentVersion, latestVersion) {
|
|
1762
|
+
const current = currentVersion.split(".").map(Number);
|
|
1763
|
+
const latest = latestVersion.split(".").map(Number);
|
|
1764
|
+
for (let i = 0;i < Math.max(current.length, latest.length); i++) {
|
|
1765
|
+
const c = current[i] ?? 0;
|
|
1766
|
+
const l = latest[i] ?? 0;
|
|
1767
|
+
if (l > c)
|
|
1768
|
+
return true;
|
|
1769
|
+
if (l < c)
|
|
1770
|
+
return false;
|
|
1771
|
+
}
|
|
1772
|
+
return false;
|
|
1773
|
+
}
|
|
1774
|
+
async function checkForUpdates(currentVersion) {
|
|
1775
|
+
try {
|
|
1776
|
+
const latestVersion = await fetchLatestVersion();
|
|
1777
|
+
if (!latestVersion) {
|
|
1778
|
+
return;
|
|
1779
|
+
}
|
|
1780
|
+
if (isNewerVersion(currentVersion, latestVersion)) {
|
|
1781
|
+
console.log("");
|
|
1782
|
+
console.log(`\x1B[33m⚠️ A new version of OmniDev is available: ${latestVersion} (current: ${currentVersion})\x1B[0m`);
|
|
1783
|
+
console.log(` Run \x1B[36mnpm update -g @omnidev-ai/cli\x1B[0m to update`);
|
|
1784
|
+
console.log("");
|
|
1785
|
+
}
|
|
1786
|
+
} catch {}
|
|
1787
|
+
}
|
|
1788
|
+
|
|
1789
|
+
// src/index.ts
|
|
1738
1790
|
var app = await buildDynamicApp();
|
|
1739
1791
|
debug2("CLI startup", {
|
|
1740
1792
|
arguments: process.argv.slice(2),
|
|
1741
1793
|
cwd: process.cwd()
|
|
1742
1794
|
});
|
|
1795
|
+
var versionCheckPromise = checkForUpdates(readCliVersion());
|
|
1743
1796
|
try {
|
|
1744
1797
|
run(app, process.argv.slice(2), {
|
|
1745
1798
|
process
|
|
1746
1799
|
});
|
|
1800
|
+
await versionCheckPromise;
|
|
1747
1801
|
} catch (error) {
|
|
1748
1802
|
if (error instanceof Error) {
|
|
1749
1803
|
if (error.message.includes("getRoutingTargetForInput") || error.stack?.includes("@stricli/core")) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@omnidev-ai/cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.11.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
30
|
"@inquirer/prompts": "^8.1.0",
|
|
31
|
-
"@omnidev-ai/core": "0.
|
|
31
|
+
"@omnidev-ai/core": "0.11.1",
|
|
32
32
|
"@stricli/core": "^1.2.5"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|