@braingrid/cli 0.2.30 → 0.2.31

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/CHANGELOG.md CHANGED
@@ -7,6 +7,15 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [0.2.31] - 2026-02-03
11
+
12
+ ### Added
13
+
14
+ - **Hook script installation during setup**
15
+ - `braingrid setup claude-code` now installs sync-braingrid-task.sh hook
16
+ - Hook automatically syncs task status between Claude Code and BrainGrid
17
+ - Installed to `.claude/hooks/` with executable permissions
18
+
10
19
  ## [0.2.30] - 2025-02-02
11
20
 
12
21
  ### Fixed
package/dist/cli.js CHANGED
@@ -222,7 +222,7 @@ async function axiosWithRetry(config2, options) {
222
222
 
223
223
  // src/build-config.ts
224
224
  var BUILD_ENV = true ? "production" : process.env.NODE_ENV === "test" ? "development" : "production";
225
- var CLI_VERSION = true ? "0.2.30" : "0.0.0-test";
225
+ var CLI_VERSION = true ? "0.2.31" : "0.0.0-test";
226
226
  var PRODUCTION_CONFIG = {
227
227
  apiUrl: "https://app.braingrid.ai",
228
228
  workosAuthUrl: "https://auth.braingrid.ai",
@@ -2658,6 +2658,16 @@ async function installStatusLineScript(scriptContent, targetPath = ".claude/stat
2658
2658
  throw new Error(`Failed to install status line script to ${targetPath}: ${errorMessage}`);
2659
2659
  }
2660
2660
  }
2661
+ async function installHookScript(scriptContent, targetPath = ".claude/hooks/sync-braingrid-task.sh") {
2662
+ try {
2663
+ const parentDir = path2.dirname(targetPath);
2664
+ await fs2.mkdir(parentDir, { recursive: true });
2665
+ await fs2.writeFile(targetPath, scriptContent, { encoding: "utf8", mode: 493 });
2666
+ } catch (error) {
2667
+ const errorMessage = error instanceof Error ? error.message : String(error);
2668
+ throw new Error(`Failed to install hook script to ${targetPath}: ${errorMessage}`);
2669
+ }
2670
+ }
2661
2671
  async function copyBraingridReadme(targetPath = ".braingrid/README.md") {
2662
2672
  try {
2663
2673
  const content = await fetchFileFromGitHub("claude-code/README.md");
@@ -3378,14 +3388,28 @@ async function _handleSetup(config2, opts) {
3378
3388
  );
3379
3389
  }
3380
3390
  }
3391
+ let hookInstalled = false;
3392
+ if (config2.name === "Claude Code") {
3393
+ try {
3394
+ const hookContent = await fetchFileFromGitHub("claude-code/hooks/sync-braingrid-task.sh");
3395
+ await installHookScript(hookContent);
3396
+ hookInstalled = true;
3397
+ } catch (error) {
3398
+ console.error(
3399
+ chalk8.yellow("\u26A0\uFE0F Failed to install hook script:"),
3400
+ error instanceof Error ? error.message : String(error)
3401
+ );
3402
+ }
3403
+ }
3381
3404
  await copyBraingridReadme();
3382
3405
  const statusLineMessage = statusLineInstalled ? chalk8.dim(" Status line: .claude/statusline.sh\n") : "";
3406
+ const hookMessage = hookInstalled ? chalk8.dim(" Hook script: .claude/hooks/sync-braingrid-task.sh\n") : "";
3383
3407
  return {
3384
3408
  success: true,
3385
3409
  message: chalk8.green(`\u2705 ${config2.name} integration installed successfully!
3386
3410
 
3387
3411
  `) + chalk8.dim("Files installed:\n") + chalk8.dim(` Commands: ${result.installed} files
3388
- `) + statusLineMessage + chalk8.dim(` Content injected into: ${config2.injection.targetFile}
3412
+ `) + statusLineMessage + hookMessage + chalk8.dim(` Content injected into: ${config2.injection.targetFile}
3389
3413
 
3390
3414
  `) + chalk8.dim("Next steps:\n") + chalk8.dim(" 1. Review the integration files\n") + chalk8.dim(` 2. Open ${config2.name}
3391
3415
  `) + chalk8.dim(" 3. Try the /specify or /breakdown commands\n") + chalk8.dim(" 4. Learn more: ") + chalk8.cyan(config2.docsUrl)