@braingrid/cli 0.2.21 → 0.2.22
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 +28 -0
- package/README.md +2 -2
- package/dist/cli.js +43 -29
- package/dist/cli.js.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,34 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [0.2.22] - 2025-12-18
|
|
11
|
+
|
|
12
|
+
### Added
|
|
13
|
+
|
|
14
|
+
- **Task commands documentation**
|
|
15
|
+
- Added `braingrid task` command examples to CLAUDE.md and AGENTS.md
|
|
16
|
+
- Documents `task list`, `task show`, and `task update` usage
|
|
17
|
+
|
|
18
|
+
### Changed
|
|
19
|
+
|
|
20
|
+
- **IDE integration update prompts**
|
|
21
|
+
- Now prompts for IDE integration updates even when CLI is already up to date
|
|
22
|
+
- Ensures users can update BrainGrid integration files independently of CLI version
|
|
23
|
+
|
|
24
|
+
- **Token efficiency optimizations**
|
|
25
|
+
- Optimized AGENTS.md and CLAUDE.md for reduced token usage
|
|
26
|
+
- Moved README.md from `.claude/` to `.braingrid/` for better organization
|
|
27
|
+
|
|
28
|
+
### Fixed
|
|
29
|
+
|
|
30
|
+
- **Duplicate BRAINGRID INTEGRATION markers**
|
|
31
|
+
- Fixed issue where setup could add duplicate integration markers to CLAUDE.md
|
|
32
|
+
- Content injection now properly checks for existing markers before adding
|
|
33
|
+
|
|
34
|
+
- **Flaky test in cli-tools**
|
|
35
|
+
- Fixed parallel timing assertion test that was too strict (50ms → 100ms threshold)
|
|
36
|
+
- Prevents intermittent test failures in CI environments
|
|
37
|
+
|
|
10
38
|
## [0.2.21] - 2025-12-18
|
|
11
39
|
|
|
12
40
|
### Fixed
|
package/README.md
CHANGED
|
@@ -47,7 +47,7 @@ braingrid setup claude-code
|
|
|
47
47
|
|
|
48
48
|
Installs slash commands (`/specify`, `/breakdown`, `/build`), BrainGrid skill, and status line showing your project/requirement/task context in real-time.
|
|
49
49
|
|
|
50
|
-
[→ Full Claude Code setup guide](./.
|
|
50
|
+
[→ Full Claude Code setup guide](./.braingrid/README.md)
|
|
51
51
|
|
|
52
52
|
### Cursor
|
|
53
53
|
|
|
@@ -115,7 +115,7 @@ The `init` command creates a `.braingrid/project.json` file in the `.braingrid/`
|
|
|
115
115
|
|
|
116
116
|
Install BrainGrid integration files for AI coding tools. These commands fetch integration files from the [BrainGrid repository](https://github.com/BrainGridAI/braingrid) and install them in your project.
|
|
117
117
|
|
|
118
|
-
For detailed usage guides, see [Claude Code setup](./.
|
|
118
|
+
For detailed usage guides, see [Claude Code setup](./.braingrid/README.md) or [Cursor setup](./.cursor/README.md).
|
|
119
119
|
|
|
120
120
|
**Prerequisites:**
|
|
121
121
|
|
package/dist/cli.js
CHANGED
|
@@ -422,7 +422,7 @@ import axios3, { AxiosError as AxiosError2 } from "axios";
|
|
|
422
422
|
|
|
423
423
|
// src/build-config.ts
|
|
424
424
|
var BUILD_ENV = true ? "production" : process.env.NODE_ENV === "test" ? "development" : "production";
|
|
425
|
-
var CLI_VERSION = true ? "0.2.
|
|
425
|
+
var CLI_VERSION = true ? "0.2.22" : "0.0.0-test";
|
|
426
426
|
var PRODUCTION_CONFIG = {
|
|
427
427
|
apiUrl: "https://app.braingrid.ai",
|
|
428
428
|
workosAuthUrl: "https://auth.braingrid.ai",
|
|
@@ -5803,6 +5803,14 @@ async function injectContentIntoFile(targetPath, content) {
|
|
|
5803
5803
|
} catch {
|
|
5804
5804
|
fileContent = "";
|
|
5805
5805
|
}
|
|
5806
|
+
let cleanContent = content;
|
|
5807
|
+
if (content.includes(BEGIN_MARKER)) {
|
|
5808
|
+
const beginIdx = content.indexOf(BEGIN_MARKER);
|
|
5809
|
+
const endIdx = content.indexOf(END_MARKER);
|
|
5810
|
+
if (beginIdx !== -1 && endIdx !== -1 && endIdx > beginIdx) {
|
|
5811
|
+
cleanContent = content.substring(beginIdx + BEGIN_MARKER.length, endIdx).trim();
|
|
5812
|
+
}
|
|
5813
|
+
}
|
|
5806
5814
|
if (fileExists3) {
|
|
5807
5815
|
const beginIndex = fileContent.indexOf(BEGIN_MARKER);
|
|
5808
5816
|
const endIndex = fileContent.indexOf(END_MARKER);
|
|
@@ -5810,14 +5818,14 @@ async function injectContentIntoFile(targetPath, content) {
|
|
|
5810
5818
|
const before = fileContent.substring(0, beginIndex);
|
|
5811
5819
|
const after = fileContent.substring(endIndex + END_MARKER.length);
|
|
5812
5820
|
const newContent = `${before}${BEGIN_MARKER}
|
|
5813
|
-
${
|
|
5821
|
+
${cleanContent}
|
|
5814
5822
|
${END_MARKER}${after}`;
|
|
5815
5823
|
await fs3.writeFile(targetPath, newContent, { encoding: "utf8" });
|
|
5816
5824
|
} else {
|
|
5817
5825
|
const newContent = `${fileContent}
|
|
5818
5826
|
|
|
5819
5827
|
${BEGIN_MARKER}
|
|
5820
|
-
${
|
|
5828
|
+
${cleanContent}
|
|
5821
5829
|
${END_MARKER}
|
|
5822
5830
|
`;
|
|
5823
5831
|
await fs3.writeFile(targetPath, newContent, { encoding: "utf8" });
|
|
@@ -5826,7 +5834,7 @@ ${END_MARKER}
|
|
|
5826
5834
|
const parentDir = path3.dirname(targetPath);
|
|
5827
5835
|
await fs3.mkdir(parentDir, { recursive: true });
|
|
5828
5836
|
const newContent = `${BEGIN_MARKER}
|
|
5829
|
-
${
|
|
5837
|
+
${cleanContent}
|
|
5830
5838
|
${END_MARKER}
|
|
5831
5839
|
`;
|
|
5832
5840
|
await fs3.writeFile(targetPath, newContent, { encoding: "utf8", mode: 420 });
|
|
@@ -6095,6 +6103,33 @@ async function handleSetupCursor(opts) {
|
|
|
6095
6103
|
}
|
|
6096
6104
|
|
|
6097
6105
|
// src/handlers/update.handlers.ts
|
|
6106
|
+
async function promptForIdeUpdates() {
|
|
6107
|
+
const cliTools = await checkInstalledCliTools();
|
|
6108
|
+
const claudeInstalled = cliTools.find((t) => t.command === "claude")?.installed;
|
|
6109
|
+
const cursorInstalled = cliTools.find((t) => t.command === "cursor")?.installed;
|
|
6110
|
+
let setupOutput = "";
|
|
6111
|
+
if (claudeInstalled) {
|
|
6112
|
+
const shouldUpdate = await confirm({
|
|
6113
|
+
message: "Claude Code detected. Update BrainGrid integration?",
|
|
6114
|
+
default: true
|
|
6115
|
+
});
|
|
6116
|
+
if (shouldUpdate) {
|
|
6117
|
+
const result = await handleSetupClaudeCode({ force: true });
|
|
6118
|
+
setupOutput += "\n" + result.message;
|
|
6119
|
+
}
|
|
6120
|
+
}
|
|
6121
|
+
if (cursorInstalled) {
|
|
6122
|
+
const shouldUpdate = await confirm({
|
|
6123
|
+
message: "Cursor detected. Update BrainGrid integration?",
|
|
6124
|
+
default: true
|
|
6125
|
+
});
|
|
6126
|
+
if (shouldUpdate) {
|
|
6127
|
+
const result = await handleSetupCursor({ force: true });
|
|
6128
|
+
setupOutput += "\n" + result.message;
|
|
6129
|
+
}
|
|
6130
|
+
}
|
|
6131
|
+
return setupOutput;
|
|
6132
|
+
}
|
|
6098
6133
|
async function handleUpdate(opts) {
|
|
6099
6134
|
try {
|
|
6100
6135
|
const currentVersion = getCurrentVersion();
|
|
@@ -6109,9 +6144,11 @@ async function handleUpdate(opts) {
|
|
|
6109
6144
|
const comparison = compareVersions(currentVersion, latestVersion);
|
|
6110
6145
|
if (comparison === 0) {
|
|
6111
6146
|
output += chalk13.green("\u2705 You are already on the latest version!\n");
|
|
6147
|
+
console.log(output);
|
|
6148
|
+
const setupOutput2 = await promptForIdeUpdates();
|
|
6112
6149
|
return {
|
|
6113
6150
|
success: true,
|
|
6114
|
-
message: output,
|
|
6151
|
+
message: output + setupOutput2,
|
|
6115
6152
|
data: { currentVersion, latestVersion, upToDate: true }
|
|
6116
6153
|
};
|
|
6117
6154
|
}
|
|
@@ -6144,30 +6181,7 @@ async function handleUpdate(opts) {
|
|
|
6144
6181
|
output += chalk13.dim("Running: ") + chalk13.cyan(updateCommand) + "\n\n";
|
|
6145
6182
|
console.log(output);
|
|
6146
6183
|
executeUpdate(packageManager, PACKAGE_NAME);
|
|
6147
|
-
const
|
|
6148
|
-
const claudeInstalled = cliTools.find((t) => t.command === "claude")?.installed;
|
|
6149
|
-
const cursorInstalled = cliTools.find((t) => t.command === "cursor")?.installed;
|
|
6150
|
-
let setupOutput = "";
|
|
6151
|
-
if (claudeInstalled) {
|
|
6152
|
-
const shouldUpdate = await confirm({
|
|
6153
|
-
message: "Claude Code detected. Update BrainGrid integration?",
|
|
6154
|
-
default: true
|
|
6155
|
-
});
|
|
6156
|
-
if (shouldUpdate) {
|
|
6157
|
-
const result = await handleSetupClaudeCode({ force: true });
|
|
6158
|
-
setupOutput += "\n" + result.message;
|
|
6159
|
-
}
|
|
6160
|
-
}
|
|
6161
|
-
if (cursorInstalled) {
|
|
6162
|
-
const shouldUpdate = await confirm({
|
|
6163
|
-
message: "Cursor detected. Update BrainGrid integration?",
|
|
6164
|
-
default: true
|
|
6165
|
-
});
|
|
6166
|
-
if (shouldUpdate) {
|
|
6167
|
-
const result = await handleSetupCursor({ force: true });
|
|
6168
|
-
setupOutput += "\n" + result.message;
|
|
6169
|
-
}
|
|
6170
|
-
}
|
|
6184
|
+
const setupOutput = await promptForIdeUpdates();
|
|
6171
6185
|
return {
|
|
6172
6186
|
success: true,
|
|
6173
6187
|
message: chalk13.green("\n\u2705 Successfully updated BrainGrid CLI!\n") + setupOutput,
|