caveat-cli 0.2.0 → 0.2.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 +21 -2
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -21251,7 +21251,7 @@ var stdoutLogger = {
|
|
|
21251
21251
|
};
|
|
21252
21252
|
|
|
21253
21253
|
// src/commands/init.ts
|
|
21254
|
-
import { existsSync as existsSync8, mkdirSync as mkdirSync4 } from "node:fs";
|
|
21254
|
+
import { existsSync as existsSync8, mkdirSync as mkdirSync4, writeFileSync as writeFileSync5 } from "node:fs";
|
|
21255
21255
|
import { join as join9 } from "node:path";
|
|
21256
21256
|
|
|
21257
21257
|
// src/claudeInstall.ts
|
|
@@ -21403,6 +21403,20 @@ function uninstallClaudeIntegration(opts) {
|
|
|
21403
21403
|
}
|
|
21404
21404
|
|
|
21405
21405
|
// src/commands/init.ts
|
|
21406
|
+
var KNOWLEDGE_GITIGNORE = [
|
|
21407
|
+
"# Never commit entries flagged private (visibility: private is enforced by the",
|
|
21408
|
+
"# pre-commit gate, but this is a filename-level backup guard).",
|
|
21409
|
+
"*.private.md",
|
|
21410
|
+
"",
|
|
21411
|
+
"# Obsidian per-user config: workspace layout, theme, plugin state, cache.",
|
|
21412
|
+
".obsidian/",
|
|
21413
|
+
"",
|
|
21414
|
+
"# community/ is a local cache of shallow-cloned third-party caveat repos",
|
|
21415
|
+
"# (populated by `caveat community add`). Each contains its own .git and is not",
|
|
21416
|
+
"# part of this repo's tracked knowledge.",
|
|
21417
|
+
"community/",
|
|
21418
|
+
""
|
|
21419
|
+
].join("\n");
|
|
21406
21420
|
function runInit(ctx, opts = { skipClaude: false, dryRun: false }) {
|
|
21407
21421
|
ensureUserConfig(ctx.userConfigPath);
|
|
21408
21422
|
ctx.logger.info(`user config: ${ctx.userConfigPath}`);
|
|
@@ -21413,6 +21427,11 @@ function runInit(ctx, opts = { skipClaude: false, dryRun: false }) {
|
|
|
21413
21427
|
} else {
|
|
21414
21428
|
ctx.logger.info(`knowledge repo: ${ctx.paths.knowledgeRepo}`);
|
|
21415
21429
|
}
|
|
21430
|
+
const gitignorePath = join9(ctx.paths.knowledgeRepo, ".gitignore");
|
|
21431
|
+
if (!existsSync8(gitignorePath)) {
|
|
21432
|
+
writeFileSync5(gitignorePath, KNOWLEDGE_GITIGNORE, "utf-8");
|
|
21433
|
+
ctx.logger.info(`.gitignore created: ${gitignorePath}`);
|
|
21434
|
+
}
|
|
21416
21435
|
const db = openDb({ path: ctx.paths.dbPath, logger: ctx.logger });
|
|
21417
21436
|
db.close();
|
|
21418
21437
|
ctx.logger.info(`db initialized: ${ctx.paths.dbPath}`);
|
|
@@ -44681,7 +44700,7 @@ function runCommunityList(ctx) {
|
|
|
44681
44700
|
|
|
44682
44701
|
// src/index.ts
|
|
44683
44702
|
var program = new Command();
|
|
44684
|
-
program.name("caveat").description("External spec gotcha knowledge base CLI").version("0.2.
|
|
44703
|
+
program.name("caveat").description("External spec gotcha knowledge base CLI").version("0.2.1");
|
|
44685
44704
|
program.command("init").description(
|
|
44686
44705
|
"Initialize ~/.caveatrc.json, ~/.caveat/, and register Claude Code integration"
|
|
44687
44706
|
).option("--skip-claude", "skip Claude Code MCP + hook registration", false).option("--dry-run", "show planned changes without writing", false).action((opts) => {
|