@hasna/configs 0.2.7 → 0.2.8

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/dist/cli/index.js +25 -1
  2. package/package.json +1 -1
package/dist/cli/index.js CHANGED
@@ -3411,7 +3411,7 @@ program.command("diff [id]").description("Show diff between stored config and di
3411
3411
  process.exit(1);
3412
3412
  }
3413
3413
  });
3414
- program.command("sync").description("Sync known AI coding configs from disk into DB (claude, codex, gemini, zsh, git, npm)").option("-a, --agent <agent>", "only sync configs for this agent (claude|codex|gemini|zsh|git|npm)").option("-c, --category <cat>", "only sync configs in this category").option("-p, --project [dir]", "sync project-scoped configs (CLAUDE.md, .mcp.json, etc.) from a project dir").option("--to-disk", "apply DB configs back to disk instead").option("--dry-run", "preview without writing").option("--list", "show which files would be synced without doing anything").action(async (opts) => {
3414
+ program.command("sync").description("Sync known AI coding configs from disk into DB (claude, codex, gemini, zsh, git, npm)").option("-a, --agent <agent>", "only sync configs for this agent (claude|codex|gemini|zsh|git|npm)").option("-c, --category <cat>", "only sync configs in this category").option("-p, --project [dir]", "sync project-scoped configs (CLAUDE.md, .mcp.json, etc.) from a project dir").option("--all", "with --project: scan all subdirs for projects to sync").option("--to-disk", "apply DB configs back to disk instead").option("--dry-run", "preview without writing").option("--list", "show which files would be synced without doing anything").action(async (opts) => {
3415
3415
  if (opts.list) {
3416
3416
  const targets = KNOWN_CONFIGS.filter((k) => {
3417
3417
  if (opts.agent && k.agent !== opts.agent)
@@ -3428,6 +3428,30 @@ program.command("sync").description("Sync known AI coding configs from disk into
3428
3428
  }
3429
3429
  if (opts.project) {
3430
3430
  const dir = typeof opts.project === "string" ? opts.project : process.cwd();
3431
+ if (opts.all) {
3432
+ const { readdirSync: readdirSync3, statSync: st } = await import("fs");
3433
+ const absDir = expandPath(dir);
3434
+ const entries = readdirSync3(absDir, { withFileTypes: true });
3435
+ let totalAdded = 0, totalUpdated = 0, totalUnchanged = 0, projects = 0;
3436
+ for (const entry of entries) {
3437
+ if (!entry.isDirectory())
3438
+ continue;
3439
+ const projDir = join6(absDir, entry.name);
3440
+ const hasClaude = existsSync7(join6(projDir, "CLAUDE.md")) || existsSync7(join6(projDir, ".mcp.json")) || existsSync7(join6(projDir, ".claude"));
3441
+ if (!hasClaude)
3442
+ continue;
3443
+ const result2 = await syncProject({ projectDir: projDir, dryRun: opts.dryRun });
3444
+ if (result2.added + result2.updated > 0) {
3445
+ console.log(` ${chalk.green("\u2713")} ${entry.name}: +${result2.added} updated:${result2.updated}`);
3446
+ }
3447
+ totalAdded += result2.added;
3448
+ totalUpdated += result2.updated;
3449
+ totalUnchanged += result2.unchanged;
3450
+ projects++;
3451
+ }
3452
+ console.log(chalk.green("\u2713") + ` Synced ${projects} projects: +${totalAdded} updated:${totalUpdated} unchanged:${totalUnchanged}`);
3453
+ return;
3454
+ }
3431
3455
  const result = await syncProject({ projectDir: dir, dryRun: opts.dryRun });
3432
3456
  console.log(chalk.green("\u2713") + ` Project sync: +${result.added} updated:${result.updated} unchanged:${result.unchanged} skipped:${result.skipped.length}`);
3433
3457
  return;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hasna/configs",
3
- "version": "0.2.7",
3
+ "version": "0.2.8",
4
4
  "description": "AI coding agent configuration manager — store, version, apply, and share all your AI coding configs. CLI + MCP + REST API + Dashboard.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",