Skip to content

Commit 36997d0

Browse files
refactor(cli): read version from package.json
1 parent 75ce134 commit 36997d0

3 files changed

Lines changed: 5 additions & 2 deletions

File tree

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "code-ollama",
33
"version": "0.0.0",
4-
"description": "Ollama Code",
4+
"description": "Ollama coding agent that runs in your terminal",
55
"author": "Mark <mark@remarkablemark.org> (https://remarkablemark.org)",
66
"type": "module",
77
"bin": {

src/cli.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,11 @@
22

33
import cac from 'cac';
44

5+
import pkg from '../package.json' with { type: 'json' };
6+
57
const cli = cac('code-ollama');
68

7-
cli.version('0.0.0');
9+
cli.version(pkg.version);
810
cli.help();
911

1012
export function main(args: string[] = process.argv.slice(2)): void {

tsconfig.test.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
"strict": true,
1313
"types": ["vitest/globals"],
1414
"noEmit": true,
15+
"resolveJsonModule": true,
1516
"skipLibCheck": true
1617
},
1718
"include": ["src", "vitest.config.mts", "eslint.config.mts", "*.mjs", "*.ts"]

0 commit comments

Comments
 (0)