bitcompass 0.3.1 → 0.3.3

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 CHANGED
@@ -2,6 +2,9 @@
2
2
  import 'dotenv/config';
3
3
  import chalk from 'chalk';
4
4
  import { Command } from 'commander';
5
+ import { readFileSync } from 'fs';
6
+ import { dirname, join } from 'path';
7
+ import { fileURLToPath } from 'url';
5
8
  import { runConfigGet, runConfigList, runConfigSet } from './commands/config-cmd.js';
6
9
  import { runInit } from './commands/init.js';
7
10
  import { runLogin } from './commands/login.js';
@@ -11,11 +14,16 @@ import { runLog } from './commands/log.js';
11
14
  import { runRulesList, runRulesPull, runRulesPush, runRulesSearch } from './commands/rules.js';
12
15
  import { runSolutionsPull, runSolutionsPush, runSolutionsSearch } from './commands/solutions.js';
13
16
  import { runWhoami } from './commands/whoami.js';
17
+ // Read version from package.json
18
+ const __dirname = dirname(fileURLToPath(import.meta.url));
19
+ const packageJsonPath = join(__dirname, '..', 'package.json');
20
+ const packageJson = JSON.parse(readFileSync(packageJsonPath, 'utf8'));
21
+ const version = packageJson.version;
14
22
  const program = new Command();
15
23
  program
16
24
  .name('bitcompass')
17
25
  .description('BitCompass CLI - rules, solutions, and MCP server')
18
- .version('0.1.0');
26
+ .version(version, '-v, -V, --version', 'display version number');
19
27
  program
20
28
  .command('login')
21
29
  .description('Log in with Google (opens browser)')
@@ -2,7 +2,7 @@ export type TimeFrame = 'day' | 'week' | 'month';
2
2
  export interface RepoSummary {
3
3
  remote_url: string;
4
4
  branch: string;
5
- repo_path: string;
5
+ repo_path?: string;
6
6
  }
7
7
  export interface GitCommitInfo {
8
8
  hash: string;
@@ -28,7 +28,8 @@ export interface PeriodBounds {
28
28
  */
29
29
  export declare const getRepoRoot: (cwd: string) => string | null;
30
30
  /**
31
- * Get a short summary of the repo: remote URL, current branch, path.
31
+ * Get a short summary of the repo: remote URL, current branch.
32
+ * Note: repo_path is no longer included to avoid storing absolute paths.
32
33
  */
33
34
  export declare const getRepoSummary: (repoRoot: string) => RepoSummary;
34
35
  /**
@@ -24,7 +24,8 @@ export const getRepoRoot = (cwd) => {
24
24
  }
25
25
  };
26
26
  /**
27
- * Get a short summary of the repo: remote URL, current branch, path.
27
+ * Get a short summary of the repo: remote URL, current branch.
28
+ * Note: repo_path is no longer included to avoid storing absolute paths.
28
29
  */
29
30
  export const getRepoSummary = (repoRoot) => {
30
31
  const remoteUrl = exec('git remote get-url origin', repoRoot) || '';
@@ -32,7 +33,6 @@ export const getRepoSummary = (repoRoot) => {
32
33
  return {
33
34
  remote_url: remoteUrl,
34
35
  branch,
35
- repo_path: repoRoot,
36
36
  };
37
37
  };
38
38
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bitcompass",
3
- "version": "0.3.1",
3
+ "version": "0.3.3",
4
4
  "description": "BitCompass CLI - rules, solutions, and MCP server",
5
5
  "type": "module",
6
6
  "bin": {
@@ -10,7 +10,6 @@
10
10
  "build": "tsc",
11
11
  "dev": "tsc --watch",
12
12
  "start": "node dist/index.js",
13
- "publish": "npm publish --access public",
14
13
  "prepare": "npm run build",
15
14
  "postinstall": "node scripts/postinstall.js"
16
15
  },