@awarded/log4brains-cli 0.0.0-stage → 2.0.0-beta.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/README.md CHANGED
@@ -1,3 +1,14 @@
1
- # Temporary Holding Version
1
+ # @awarded/log4brains-cli
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ This package provides the CLI features of the [Log4brains](https://github.com/FreakinWard/log4brains) architecture knowledge base.
4
+ It is not meant to be used directly.
5
+
6
+ Install [the main log4brains package](https://www.npmjs.com/package/log4brains) instead:
7
+
8
+ ```bash
9
+ npm install -g @awarded/log4brains
10
+ ```
11
+
12
+ ## Documentation
13
+
14
+ - [Log4brains README](https://github.com/FreakinWard/log4brains/blob/develop/README.md)
@@ -0,0 +1,9 @@
1
+ import { Command } from 'commander';
2
+ import { AppConsole } from '@awarded/log4brains-cli-common';
3
+
4
+ type Deps = {
5
+ appConsole: AppConsole;
6
+ };
7
+ declare function createCli({ appConsole }: Deps): Command;
8
+
9
+ export { createCli };
package/dist/index.js ADDED
@@ -0,0 +1,230 @@
1
+ // src/cli.ts
2
+ import { Command } from "commander";
3
+ import terminalLink from "terminal-link";
4
+ import { Log4brains as Log4brains2, Log4brainsError as Log4brainsError2 } from "@awarded/log4brains-core";
5
+ import { FailureExit } from "@awarded/log4brains-cli-common";
6
+
7
+ // src/commands/ListCommand.ts
8
+ var ListCommand = class {
9
+ constructor({ l4bInstance: l4bInstance2, appConsole }) {
10
+ this.l4bInstance = l4bInstance2;
11
+ this.console = appConsole;
12
+ }
13
+ async execute(opts) {
14
+ const filters = {};
15
+ if (opts.statuses) {
16
+ filters.statuses = opts.statuses.split(",");
17
+ }
18
+ const adrs = await this.l4bInstance.searchAdrs(filters);
19
+ const table = this.console.createTable({
20
+ head: ["Slug", "Status", "Package", "Title"]
21
+ });
22
+ adrs.forEach((adr) => {
23
+ table.push([
24
+ adr.slug,
25
+ adr.status.toUpperCase(),
26
+ adr.package || "",
27
+ adr.title || "Untitled"
28
+ ]);
29
+ });
30
+ this.console.printTable(table, opts.raw);
31
+ }
32
+ };
33
+
34
+ // src/commands/NewCommand.ts
35
+ import path from "path";
36
+ import { Log4brainsError } from "@awarded/log4brains-core";
37
+ import fs, { promises as fsP } from "fs";
38
+
39
+ // src/utils.ts
40
+ import { execa } from "execa";
41
+ async function previewAdr(slug) {
42
+ const subprocess = execa("log4brains", ["preview", slug], {
43
+ stdio: "inherit"
44
+ });
45
+ await subprocess;
46
+ }
47
+
48
+ // src/commands/NewCommand.ts
49
+ var NewCommand = class {
50
+ constructor({ l4bInstance: l4bInstance2, appConsole }) {
51
+ this.l4bInstance = l4bInstance2;
52
+ this.console = appConsole;
53
+ }
54
+ detectCurrentPackageFromCwd() {
55
+ const { packages } = this.l4bInstance.config.project;
56
+ if (!packages) {
57
+ return void 0;
58
+ }
59
+ const cwd = path.resolve(".");
60
+ const match = packages.filter((pkg) => cwd.includes(pkg.path)).sort((a, b) => a.path.length - b.path.length).pop();
61
+ return match?.name;
62
+ }
63
+ // eslint-disable-next-line sonarjs/cognitive-complexity
64
+ async execute(opts, titleArg) {
65
+ const { packages } = this.l4bInstance.config.project;
66
+ let pkg = opts.package;
67
+ if (!opts.quiet && !pkg && packages && packages.length > 0) {
68
+ const currentPackage = this.detectCurrentPackageFromCwd();
69
+ const packageChoices = [
70
+ {
71
+ name: `Global`,
72
+ value: ""
73
+ },
74
+ ...packages.map((p) => ({
75
+ name: `Package: ${p.name}`,
76
+ value: p.name
77
+ }))
78
+ ];
79
+ pkg = await this.console.askListQuestion(
80
+ "For which package do you want to create this new ADR?",
81
+ packageChoices,
82
+ currentPackage
83
+ ) || void 0;
84
+ }
85
+ if (opts.quiet && !titleArg) {
86
+ throw new Log4brainsError("<title> is required when using --quiet");
87
+ }
88
+ let title;
89
+ do {
90
+ title = titleArg || await this.console.askInputQuestion(
91
+ "Title of the solved problem and its solution?"
92
+ );
93
+ if (!title.trim()) {
94
+ this.console.warn("Please enter a title");
95
+ }
96
+ } while (!title.trim());
97
+ const slug = await this.l4bInstance.generateAdrSlug(title, pkg);
98
+ const adrDto = await this.l4bInstance.createAdrFromTemplate(slug, title);
99
+ if (opts.from) {
100
+ if (!fs.existsSync(opts.from)) {
101
+ throw new Log4brainsError("The given file does not exist", opts.from);
102
+ }
103
+ await fsP.writeFile(
104
+ adrDto.file.absolutePath,
105
+ await fsP.readFile(opts.from, "utf-8"),
106
+ "utf-8"
107
+ );
108
+ }
109
+ if (opts.quiet) {
110
+ this.console.println(adrDto.slug);
111
+ process.exit(0);
112
+ }
113
+ const activeAdrs = await this.l4bInstance.searchAdrs({
114
+ statuses: ["accepted"]
115
+ });
116
+ if (activeAdrs.length > 0) {
117
+ const supersedeChoices = [
118
+ {
119
+ name: "No",
120
+ value: ""
121
+ },
122
+ ...activeAdrs.map((a) => ({
123
+ name: a.title || "Untitled",
124
+ // TODO: add package and maybe date + format with tabs
125
+ value: a.slug
126
+ }))
127
+ ];
128
+ const supersededSlug = await this.console.askListQuestion(
129
+ "Does this ADR supersede a previous one?",
130
+ supersedeChoices,
131
+ ""
132
+ );
133
+ if (supersededSlug !== "") {
134
+ await this.l4bInstance.supersedeAdr(supersededSlug, slug);
135
+ this.console.debug(
136
+ `${supersededSlug} was marked as superseded by ${slug}`
137
+ );
138
+ }
139
+ }
140
+ this.console.println();
141
+ this.console.success(`New ADR created: ${adrDto.file.relativePath}`);
142
+ this.console.println();
143
+ const actionChoices = [
144
+ {
145
+ name: "Edit and preview",
146
+ value: "edit-and-preview"
147
+ },
148
+ { name: "Edit", value: "edit" },
149
+ { name: "Later", value: "close" }
150
+ ];
151
+ const action = await this.console.askListQuestion(
152
+ "How would you like to edit it?",
153
+ actionChoices,
154
+ "edit-and-preview"
155
+ );
156
+ if (action === "edit-and-preview" || action === "edit") {
157
+ await this.l4bInstance.openAdrInEditor(slug, () => {
158
+ this.console.warn(
159
+ "We were not able to detect your preferred editor :("
160
+ );
161
+ this.console.warn(
162
+ "You can define it by setting your $VISUAL or $EDITOR environment variable in ~/.zshenv or ~/.bashrc"
163
+ );
164
+ });
165
+ if (action === "edit-and-preview") {
166
+ await previewAdr(slug);
167
+ }
168
+ }
169
+ process.exit(0);
170
+ }
171
+ };
172
+
173
+ // src/cli.ts
174
+ var templateExampleUrl = "https://raw.githubusercontent.com/FreakinWard/log4brains/develop/packages/init/assets/template.md";
175
+ var l4bInstance;
176
+ function getL4bInstance() {
177
+ if (!l4bInstance) {
178
+ l4bInstance = Log4brains2.createFromCwd(process.env.LOG4BRAINS_CWD || ".");
179
+ }
180
+ return l4bInstance;
181
+ }
182
+ function execWithErrorHandler(promise, appConsole) {
183
+ promise.catch((err) => {
184
+ if (err instanceof Log4brainsError2 && err.name === "The template.md file does not exist") {
185
+ appConsole.error(err);
186
+ appConsole.printlnErr(
187
+ `You can use this ${terminalLink(
188
+ "template",
189
+ templateExampleUrl
190
+ )} as an example`
191
+ );
192
+ throw new FailureExit();
193
+ }
194
+ });
195
+ return promise;
196
+ }
197
+ function createCli({ appConsole }) {
198
+ const program = new Command().allowExcessArguments();
199
+ const adr = program.command("adr").description("Group of commands to manage your ADRs...");
200
+ adr.command("new").argument("[title]", "The title of the ADR. Required if --quiet is passed").description("Create an ADR").option("-q, --quiet", "Disable interactive mode", false).option(
201
+ "-p, --package <package>",
202
+ "To create the ADR for a specific package"
203
+ ).option(
204
+ "--from <file>",
205
+ "Copy <file> contents into the ADR instead of using the default template"
206
+ ).action(
207
+ (title, opts) => {
208
+ const cmd = new NewCommand({
209
+ l4bInstance: getL4bInstance(),
210
+ appConsole
211
+ });
212
+ return execWithErrorHandler(cmd.execute(opts, title), appConsole);
213
+ }
214
+ );
215
+ adr.command("list").option(
216
+ "-s, --statuses <statuses>",
217
+ "Filter on the given statuses, comma-separated"
218
+ ).option("-r, --raw", "Use a raw format instead of a table", false).description("List ADRs").action((opts) => {
219
+ const cmd = new ListCommand({
220
+ l4bInstance: getL4bInstance(),
221
+ appConsole
222
+ });
223
+ return execWithErrorHandler(cmd.execute(opts), appConsole);
224
+ });
225
+ return program;
226
+ }
227
+ export {
228
+ createCli
229
+ };
230
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/cli.ts","../src/commands/ListCommand.ts","../src/commands/NewCommand.ts","../src/utils.ts"],"sourcesContent":["import { Command } from \"commander\";\nimport terminalLink from \"terminal-link\";\nimport { Log4brains, Log4brainsError } from \"@awarded/log4brains-core\";\nimport { AppConsole, FailureExit } from \"@awarded/log4brains-cli-common\";\n\nimport {\n ListCommand,\n ListCommandOpts,\n NewCommand,\n NewCommandOpts\n} from \"./commands\";\n\nconst templateExampleUrl =\n \"https://raw.githubusercontent.com/FreakinWard/log4brains/develop/packages/init/assets/template.md\";\n\nlet l4bInstance: Log4brains;\nfunction getL4bInstance(): Log4brains {\n if (!l4bInstance) {\n l4bInstance = Log4brains.createFromCwd(process.env.LOG4BRAINS_CWD || \".\");\n }\n return l4bInstance;\n}\n\nfunction execWithErrorHandler<T>(\n promise: Promise<T>,\n appConsole: AppConsole\n): Promise<T> {\n promise.catch((err) => {\n if (\n err instanceof Log4brainsError &&\n err.name === \"The template.md file does not exist\"\n ) {\n appConsole.error(err);\n appConsole.printlnErr(\n `You can use this ${terminalLink(\n \"template\",\n templateExampleUrl\n )} as an example`\n );\n throw new FailureExit();\n }\n });\n return promise;\n}\n\ntype Deps = {\n appConsole: AppConsole;\n};\n\nexport function createCli({ appConsole }: Deps): Command {\n const program = new Command().allowExcessArguments(); // commander >=13 rejects extra arguments; keep the previous lenient behavior\n\n const adr = program\n .command(\"adr\")\n .description(\"Group of commands to manage your ADRs...\");\n\n adr\n .command(\"new\")\n .argument(\"[title]\", \"The title of the ADR. Required if --quiet is passed\")\n .description(\"Create an ADR\")\n .option(\"-q, --quiet\", \"Disable interactive mode\", false)\n .option(\n \"-p, --package <package>\",\n \"To create the ADR for a specific package\"\n )\n .option(\n \"--from <file>\",\n \"Copy <file> contents into the ADR instead of using the default template\"\n )\n .action(\n (title: string | undefined, opts: NewCommandOpts): Promise<void> => {\n const cmd = new NewCommand({\n l4bInstance: getL4bInstance(),\n appConsole\n });\n return execWithErrorHandler(cmd.execute(opts, title), appConsole);\n }\n );\n\n // adr\n // .command(\"quick\")\n // .description(\"Create a one-sentence ADR (Y-Statement)\")\n // .action(\n // (): Promise<void> => {\n // // TODO\n // }\n // );\n\n adr\n .command(\"list\")\n .option(\n \"-s, --statuses <statuses>\",\n \"Filter on the given statuses, comma-separated\"\n ) // TODO: list available statuses\n .option(\"-r, --raw\", \"Use a raw format instead of a table\", false)\n .description(\"List ADRs\")\n .action((opts: ListCommandOpts): Promise<void> => {\n const cmd = new ListCommand({\n l4bInstance: getL4bInstance(),\n appConsole\n });\n return execWithErrorHandler(cmd.execute(opts), appConsole);\n });\n\n return program;\n}\n","import {\n Log4brains,\n SearchAdrsFilters,\n AdrDtoStatus\n} from \"@awarded/log4brains-core\";\nimport type { AppConsole } from \"@awarded/log4brains-cli-common\";\n\ntype Deps = {\n l4bInstance: Log4brains;\n appConsole: AppConsole;\n};\n\nexport type ListCommandOpts = {\n statuses: string;\n raw: boolean;\n};\n\nexport class ListCommand {\n private readonly l4bInstance: Log4brains;\n\n private readonly console: AppConsole;\n\n constructor({ l4bInstance, appConsole }: Deps) {\n this.l4bInstance = l4bInstance;\n this.console = appConsole;\n }\n\n async execute(opts: ListCommandOpts): Promise<void> {\n const filters: SearchAdrsFilters = {};\n if (opts.statuses) {\n filters.statuses = opts.statuses.split(\",\") as AdrDtoStatus[];\n }\n const adrs = await this.l4bInstance.searchAdrs(filters);\n const table = this.console.createTable({\n head: [\"Slug\", \"Status\", \"Package\", \"Title\"]\n });\n adrs.forEach((adr) => {\n table.push([\n adr.slug,\n adr.status.toUpperCase(),\n adr.package || \"\",\n adr.title || \"Untitled\"\n ]);\n });\n this.console.printTable(table, opts.raw);\n }\n}\n","/* eslint-disable no-await-in-loop */\nimport path from \"path\";\nimport { Log4brains, Log4brainsError } from \"@awarded/log4brains-core\";\nimport fs, { promises as fsP } from \"fs\";\nimport type { AppConsole } from \"@awarded/log4brains-cli-common\";\nimport { previewAdr } from \"../utils\";\n\ntype Deps = {\n l4bInstance: Log4brains;\n appConsole: AppConsole;\n};\n\nexport type NewCommandOpts = {\n quiet: boolean;\n package?: string;\n from?: string;\n};\n\nexport class NewCommand {\n private readonly l4bInstance: Log4brains;\n\n private readonly console: AppConsole;\n\n constructor({ l4bInstance, appConsole }: Deps) {\n this.l4bInstance = l4bInstance;\n this.console = appConsole;\n }\n\n private detectCurrentPackageFromCwd(): string | undefined {\n const { packages } = this.l4bInstance.config.project;\n if (!packages) {\n return undefined;\n }\n const cwd = path.resolve(\".\");\n const match = packages\n .filter((pkg) => cwd.includes(pkg.path))\n .sort((a, b) => a.path.length - b.path.length)\n .pop(); // returns the most precise path (ie. longest)\n return match?.name;\n }\n\n // eslint-disable-next-line sonarjs/cognitive-complexity\n async execute(opts: NewCommandOpts, titleArg?: string): Promise<void> {\n const { packages } = this.l4bInstance.config.project;\n\n let pkg = opts.package;\n if (!opts.quiet && !pkg && packages && packages.length > 0) {\n const currentPackage = this.detectCurrentPackageFromCwd();\n const packageChoices = [\n {\n name: `Global`,\n value: \"\"\n },\n ...packages.map((p) => ({\n name: `Package: ${p.name}`,\n value: p.name\n }))\n ];\n pkg =\n (await this.console.askListQuestion(\n \"For which package do you want to create this new ADR?\",\n packageChoices,\n currentPackage\n )) || undefined;\n }\n\n if (opts.quiet && !titleArg) {\n throw new Log4brainsError(\"<title> is required when using --quiet\");\n }\n let title;\n do {\n title =\n titleArg ||\n (await this.console.askInputQuestion(\n \"Title of the solved problem and its solution?\"\n ));\n if (!title.trim()) {\n this.console.warn(\"Please enter a title\");\n }\n } while (!title.trim());\n\n // const slug = await this.console.askInputQuestion(\n // \"We pre-generated a slug to identify this ADR. Press [ENTER] or enter another one.\",\n // await this.l4bInstance.generateAdrSlug(title, pkg)\n // );\n const slug = await this.l4bInstance.generateAdrSlug(title, pkg);\n\n const adrDto = await this.l4bInstance.createAdrFromTemplate(slug, title);\n\n // --from option (used by init-log4brains to create the starter ADRs)\n // Since this is a private use case, we don't include it in CORE for now\n if (opts.from) {\n if (!fs.existsSync(opts.from)) {\n throw new Log4brainsError(\"The given file does not exist\", opts.from);\n }\n // TODO: use streams\n await fsP.writeFile(\n adrDto.file.absolutePath,\n await fsP.readFile(opts.from, \"utf-8\"),\n \"utf-8\"\n );\n }\n\n if (opts.quiet) {\n this.console.println(adrDto.slug);\n process.exit(0);\n }\n\n const activeAdrs = await this.l4bInstance.searchAdrs({\n statuses: [\"accepted\"]\n });\n if (activeAdrs.length > 0) {\n const supersedeChoices = [\n {\n name: \"No\",\n value: \"\"\n },\n ...activeAdrs.map((a) => ({\n name: a.title || \"Untitled\", // TODO: add package and maybe date + format with tabs\n value: a.slug\n }))\n ];\n const supersededSlug = await this.console.askListQuestion(\n \"Does this ADR supersede a previous one?\",\n supersedeChoices,\n \"\"\n );\n\n if (supersededSlug !== \"\") {\n await this.l4bInstance.supersedeAdr(supersededSlug, slug);\n this.console.debug(\n `${supersededSlug} was marked as superseded by ${slug}`\n );\n }\n }\n\n this.console.println();\n this.console.success(`New ADR created: ${adrDto.file.relativePath}`);\n this.console.println();\n\n const actionChoices = [\n {\n name: \"Edit and preview\",\n value: \"edit-and-preview\"\n },\n { name: \"Edit\", value: \"edit\" },\n { name: \"Later\", value: \"close\" }\n ];\n const action = await this.console.askListQuestion(\n \"How would you like to edit it?\",\n actionChoices,\n \"edit-and-preview\"\n );\n\n if (action === \"edit-and-preview\" || action === \"edit\") {\n await this.l4bInstance.openAdrInEditor(slug, () => {\n this.console.warn(\n \"We were not able to detect your preferred editor :(\"\n );\n this.console.warn(\n \"You can define it by setting your $VISUAL or $EDITOR environment variable in ~/.zshenv or ~/.bashrc\"\n );\n });\n\n if (action === \"edit-and-preview\") {\n await previewAdr(slug);\n }\n }\n\n process.exit(0);\n }\n}\n","import { execa } from \"execa\";\n\nexport async function previewAdr(slug: string): Promise<void> {\n const subprocess = execa(\"log4brains\", [\"preview\", slug], {\n stdio: \"inherit\"\n });\n await subprocess;\n}\n"],"mappings":";AAAA,SAAS,eAAe;AACxB,OAAO,kBAAkB;AACzB,SAAS,cAAAA,aAAY,mBAAAC,wBAAuB;AAC5C,SAAqB,mBAAmB;;;ACcjC,IAAM,cAAN,MAAkB;AAAA,EAKvB,YAAY,EAAE,aAAAC,cAAa,WAAW,GAAS;AAC7C,SAAK,cAAcA;AACnB,SAAK,UAAU;AAAA,EACjB;AAAA,EAEA,MAAM,QAAQ,MAAsC;AAClD,UAAM,UAA6B,CAAC;AACpC,QAAI,KAAK,UAAU;AACjB,cAAQ,WAAW,KAAK,SAAS,MAAM,GAAG;AAAA,IAC5C;AACA,UAAM,OAAO,MAAM,KAAK,YAAY,WAAW,OAAO;AACtD,UAAM,QAAQ,KAAK,QAAQ,YAAY;AAAA,MACrC,MAAM,CAAC,QAAQ,UAAU,WAAW,OAAO;AAAA,IAC7C,CAAC;AACD,SAAK,QAAQ,CAAC,QAAQ;AACpB,YAAM,KAAK;AAAA,QACT,IAAI;AAAA,QACJ,IAAI,OAAO,YAAY;AAAA,QACvB,IAAI,WAAW;AAAA,QACf,IAAI,SAAS;AAAA,MACf,CAAC;AAAA,IACH,CAAC;AACD,SAAK,QAAQ,WAAW,OAAO,KAAK,GAAG;AAAA,EACzC;AACF;;;AC7CA,OAAO,UAAU;AACjB,SAAqB,uBAAuB;AAC5C,OAAO,MAAM,YAAY,WAAW;;;ACHpC,SAAS,aAAa;AAEtB,eAAsB,WAAW,MAA6B;AAC5D,QAAM,aAAa,MAAM,cAAc,CAAC,WAAW,IAAI,GAAG;AAAA,IACxD,OAAO;AAAA,EACT,CAAC;AACD,QAAM;AACR;;;ADWO,IAAM,aAAN,MAAiB;AAAA,EAKtB,YAAY,EAAE,aAAAC,cAAa,WAAW,GAAS;AAC7C,SAAK,cAAcA;AACnB,SAAK,UAAU;AAAA,EACj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5B;AAAA,MACF,CAAC;AACD,aAAO,qBAAqB,IAAI,QAAQ,MAAM,KAAK,GAAG,UAAU;AAAA,IAClE;AAAA,EACF;AAWF,MACG,QAAQ,MAAM,EACd;AAAA,IACC;AAAA,IACA;AAAA,EACF,EACC,OAAO,aAAa,uCAAuC,KAAK,EAChE,YAAY,WAAW,EACvB,OAAO,CAAC,SAAyC;AAChD,UAAM,MAAM,IAAI,YAAY;AAAA,MAC1B,aAAa,eAAe;AAAA,MAC5B;AAAA,IACF,CAAC;AACD,WAAO,qBAAqB,IAAI,QAAQ,IAAI,GAAG,UAAU;AAAA,EAC3D,CAAC;AAEH,SAAO;AACT;","names":["Log4brains","Log4brainsError","l4bInstance","l4bInstance","Log4brains","Log4brainsError"]}
package/package.json CHANGED
@@ -1,6 +1,51 @@
1
1
  {
2
2
  "name": "@awarded/log4brains-cli",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "2.0.0-beta.1",
4
+ "description": "Log4brains architecture knowledge base CLI",
5
+ "keywords": [
6
+ "log4brains"
7
+ ],
8
+ "author": "Thomas Vaillant <thomvaill@bluebricks.dev>",
9
+ "license": "Apache-2.0",
10
+ "private": false,
11
+ "publishConfig": {
12
+ "access": "public"
13
+ },
14
+ "homepage": "https://github.com/FreakinWard/log4brains",
15
+ "repository": {
16
+ "type": "git",
17
+ "url": "https://github.com/FreakinWard/log4brains",
18
+ "directory": "packages/cli"
19
+ },
20
+ "engines": {
21
+ "node": "^22.22.2 || >=24.15.0"
22
+ },
23
+ "files": [
24
+ "dist"
25
+ ],
26
+ "source": "./src/index.ts",
27
+ "main": "./dist/index.js",
28
+ "type": "module",
29
+ "exports": {
30
+ ".": {
31
+ "types": "./dist/index.d.ts",
32
+ "default": "./dist/index.js"
33
+ }
34
+ },
35
+ "types": "./dist/index.d.ts",
36
+ "scripts": {
37
+ "dev": "tsup --watch",
38
+ "build": "tsup",
39
+ "clean": "rimraf ./dist",
40
+ "typescript": "tsc --noEmit",
41
+ "lint": "eslint . --max-warnings=0",
42
+ "prepublishOnly": "npm run build"
43
+ },
44
+ "dependencies": {
45
+ "@awarded/log4brains-cli-common": "2.0.0-beta.1",
46
+ "@awarded/log4brains-core": "2.0.0-beta.1",
47
+ "commander": "^15.1.0",
48
+ "execa": "^10.2.1",
49
+ "terminal-link": "^5.0.0"
50
+ }
51
+ }