@0dai-dev/cli 3.1.7 → 3.1.9

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.
Files changed (2) hide show
  1. package/bin/0dai.js +16 -5
  2. package/package.json +1 -1
package/bin/0dai.js CHANGED
@@ -344,9 +344,16 @@ function writeFiles(target, files) {
344
344
  if (rel.endsWith("settings.json")) {
345
345
  finalContent = mergeSettingsJson(existing, content);
346
346
  merged++;
347
- } else if (rel === "AGENTS.md" && existing.includes("managed: false")) {
348
- unchanged++; // User owns this file, skip
349
- continue;
347
+ } else if (rel === "AGENTS.md") {
348
+ if (existing.includes("managed: false")) {
349
+ unchanged++; // User owns this file, skip
350
+ continue;
351
+ }
352
+ // Backup existing AGENTS.md before overwrite
353
+ const backupDir = path.join(target, "ai", ".backups");
354
+ fs.mkdirSync(backupDir, { recursive: true });
355
+ fs.writeFileSync(path.join(backupDir, "AGENTS.md.bak"), existing, "utf8");
356
+ updated++;
350
357
  } else {
351
358
  updated++;
352
359
  }
@@ -1379,8 +1386,12 @@ async function checkVersion() {
1379
1386
 
1380
1387
  const result = await apiCall("/v1/version");
1381
1388
  if (result.version && result.version !== VERSION) {
1382
- log(`Update available: ${VERSION} ${result.version}`);
1383
- console.log(` Run: npm update -g @0dai-dev/cli\n`);
1389
+ // Only suggest update if remote version is actually newer
1390
+ const cmp = (a, b) => { const [a1,a2,a3] = a.split(".").map(Number); const [b1,b2,b3] = b.split(".").map(Number); return a1 - b1 || a2 - b2 || a3 - b3; };
1391
+ if (cmp(result.version, VERSION) > 0) {
1392
+ log(`Update available: ${VERSION} → ${result.version}`);
1393
+ console.log(` Run: npm update -g @0dai-dev/cli\n`);
1394
+ }
1384
1395
  }
1385
1396
  } catch {}
1386
1397
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@0dai-dev/cli",
3
- "version": "3.1.7",
3
+ "version": "3.1.9",
4
4
  "description": "One config layer for 5 AI agent CLIs — Claude Code, Codex, OpenCode, Gemini, Aider",
5
5
  "bin": {
6
6
  "0dai": "./bin/0dai.js"