Skip to content

Commit 0f892db

Browse files
Implement end-to-end MVP: CLI init → index → MCP tools
This commit completes the core MVP implementation: **Core Storage Layer (@codebrain/core)** - Add SQLite schema with signals, documents, scopes tables - Implement SQLiteStorage class with SignalStore, DocumentStore, ScopeStore - Full-text search via FTS5 virtual tables with sync triggers - Add better-sqlite3 dependency for synchronous SQLite access **CLI (@codebrain/cli)** - Add config-loader.ts with jiti for TypeScript config loading - Implement `codebrain init` command (creates .codebrain, config, database) - Implement `codebrain index` command (indexes Claude Code conversations) - Implement `codebrain status` command (shows database statistics) - Implement `codebrain search/context/export` commands - Auto-detect Claude Code project paths **MCP Server (@codebrain/mcp-server)** - Wire all tool handlers to use SQLiteStorage - Implement codebrain_search, codebrain_context, codebrain_validate - Implement codebrain_record, codebrain_status tools **Verified:** - Build passes (all 5 packages) - TypeScript check passes - ESLint passes - CLI commands work: init, index, status Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent f6706d0 commit 0f892db

12 files changed

Lines changed: 2227 additions & 198 deletions

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ examples/**/*.js.map
1313

1414
# Codebrain data (user's local index)
1515
.codebrain/
16+
codebrain.config.ts
1617

1718
# Claude Code plugin state
1819
.claude/

.npmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
enable-pre-post-scripts=true

package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,5 +31,8 @@
3131
"eslint": "^8.55.0",
3232
"@typescript-eslint/eslint-plugin": "^6.13.0",
3333
"@typescript-eslint/parser": "^6.13.0"
34+
},
35+
"pnpm": {
36+
"onlyBuiltDependencies": ["better-sqlite3"]
3437
}
3538
}

packages/cli/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@
2323
"commander": "^12.0.0",
2424
"chalk": "^5.3.0",
2525
"ora": "^8.0.0",
26-
"inquirer": "^9.0.0"
26+
"inquirer": "^9.0.0",
27+
"jiti": "^2.0.0"
2728
},
2829
"devDependencies": {
2930
"typescript": "^5.3.0"

0 commit comments

Comments
 (0)