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 +1 -1
- package/src/commands/index.ts +4 -0
package/package.json
CHANGED
package/src/commands/index.ts
CHANGED
|
@@ -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
|
`
|