ex-brain 0.2.1 → 0.2.2

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ex-brain",
3
- "version": "0.2.1",
3
+ "version": "0.2.2",
4
4
  "description": "CLI personal knowledge base powered by seekdb",
5
5
  "module": "src/cli.ts",
6
6
  "type": "module",
@@ -1,4 +1,5 @@
1
1
  import { basename, resolve } from "node:path";
2
+ import { readFileSync } from "node:fs";
2
3
  import { Command } from "commander";
3
4
  import { DEFAULT_DB_NAME, inferTypeFromSlug, slugToTitle, normalizeLongSlug, slugify } from "../config";
4
5
  import { BrainDb } from "../db/client";
@@ -168,8 +169,11 @@ async function resolveInput(
168
169
  // ---------------------------------------------------------------------------
169
170
 
170
171
  export function buildProgram(): Command {
172
+ const pkgPath = new URL("../../package.json", import.meta.url);
173
+ const pkg = JSON.parse(readFileSync(pkgPath, "utf-8"));
171
174
  const program = new Command("ebrain")
172
175
  .description("Personal knowledge base CLI powered by seekdb")
176
+ .version(pkg.version, "-V, --version", "output the version number")
173
177
  .addHelpText(
174
178
  "after",
175
179
  `