Skip to content

Commit 8cc07bc

Browse files
committed
docs: identify the CLI fork and refresh documentation [skip ci]
1 parent 13a86e9 commit 8cc07bc

9 files changed

Lines changed: 113 additions & 71 deletions

File tree

‎CONTRIBUTING.md‎

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Contributing to codebase-memory-mcp
1+
# Contributing to Codebase Memory CLI
22

33
Contributions are welcome. This guide covers setup, testing, and PR guidelines.
44

@@ -9,16 +9,16 @@ Contributions are welcome. This guide covers setup, testing, and PR guidelines.
99
**Prerequisites**: C compiler (gcc or clang), make, zlib, Git. Optional: Node.js 22+ (for graph UI).
1010

1111
```bash
12-
git clone https://github.com/DeusData/codebase-memory-mcp.git
13-
cd codebase-memory-mcp
12+
git clone https://github.com/ngallodev/codebase-memory-cli.git
13+
cd codebase-memory-cli
1414
git config core.hooksPath scripts/hooks # activates pre-commit security checks
1515
scripts/build.sh
1616
```
1717

1818
macOS: `xcode-select --install` provides clang.
1919
Linux: `sudo apt install build-essential zlib1g-dev` (Debian/Ubuntu) or `sudo dnf install gcc zlib-devel` (Fedora).
2020

21-
The binary is output to `build/c/codebase-memory-mcp`.
21+
The binary is output to `build/c/codebase-memory-cli`.
2222

2323
## Run Tests
2424

@@ -29,7 +29,7 @@ scripts/test.sh
2929
This builds with ASan + UBSan and runs the full C test suite. Key test files:
3030
- `tests/test_pipeline.c` — pipeline integration tests
3131
- `tests/test_httplink.c` — HTTP route extraction and linking
32-
- `tests/test_mcp.c` — MCP protocol and tool handler tests
32+
- `tests/test_cli.c` — CLI command and lifecycle tests
3333
- `tests/test_store_*.c` — SQLite graph store tests
3434

3535
## Run Linter
@@ -46,7 +46,7 @@ Runs clang-tidy, cppcheck, and clang-format. All must pass before committing (al
4646
make -f Makefile.cbm security
4747
```
4848

49-
Runs 8 security layers: static allow-list audit, binary string scan, UI audit, install audit, network egress test, MCP robustness (fuzz), vendored dependency integrity, and frontend integrity.
49+
Runs the repository's security layers: static allow-list audit, binary string scan, UI audit, install audit, network egress test, parser robustness, vendored dependency integrity, and frontend integrity.
5050

5151
## Project Structure
5252

@@ -55,7 +55,7 @@ src/
5555
foundation/ Arena allocator, hash table, string utils, platform compat
5656
store/ SQLite graph storage (WAL mode, FTS5)
5757
cypher/ Cypher query → SQL translation
58-
mcp/ MCP server (JSON-RPC 2.0 over stdio, 14 tools)
58+
operations/ Protocol-neutral CLI operations
5959
pipeline/ Multi-pass indexing pipeline
6060
pass_*.c Individual pipeline passes (definitions, calls, usages, etc.)
6161
httplink.c HTTP route extraction (Go/Express/Laravel/Ktor/Python)
@@ -127,7 +127,7 @@ Examples: `fix(store): set busy_timeout before WAL`, `feat(cli): add --progress
127127

128128
The following changes will not be merged without prior design discussion in an issue:
129129

130-
- **API surface changes** — adding, removing, renaming, or changing defaults of MCP tools
130+
- **CLI operation changes** — adding, removing, renaming, or changing defaults of supported operations
131131
- **New pipeline passes or indexing algorithms** — anything that changes what gets extracted or how
132132
- **Build system / Makefile changes** — beyond trivial fixes
133133
- **Project configuration** — CLAUDE.md, skill files, .mcp.json, CI workflows
@@ -160,7 +160,7 @@ If you add a new `system()`, `popen()`, `fork()`, or network call, it must be ju
160160

161161
## Good First Issues
162162

163-
Check [issues labeled `good first issue`](https://github.com/DeusData/codebase-memory-mcp/labels/good%20first%20issue) for beginner-friendly tasks with clear scope and guidance.
163+
Check [issues labeled `good first issue`](https://github.com/ngallodev/codebase-memory-cli/labels/good%20first%20issue) for beginner-friendly tasks with clear scope and guidance.
164164

165165
## License and sign-off (DCO) — required on every commit
166166

‎MAINTAINERS.md‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
This document defines how maintainer responsibility, review routing, and
44
operational authority work in this project.
55

6-
codebase-memory-mcp is currently a user-owned repository. Because GitHub teams
6+
codebase-memory-cli is currently a user-owned repository and a CLI-only fork of
7+
Codebase Memory MCP. Because GitHub teams
78
are not available here, all delegated ownership is expressed with individual
89
GitHub handles.
910

@@ -131,7 +132,7 @@ recorded in `.github/CODEOWNERS` and repository settings.
131132
These changes always require project-owner review, even if an area reviewer
132133
approves:
133134

134-
- MCP tool behavior, tool outputs, or protocol capabilities.
135+
- CLI operation behavior, output formats, or protocol-facing compatibility.
135136
- New process execution, shell invocation, network access, or file access.
136137
- CI, release, package publishing, installer, or updater changes.
137138
- Vendored dependency changes, generated grammar changes, or license policy.

‎README.md‎

Lines changed: 49 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,23 @@
1-
# Codebase Memory
1+
# Codebase Memory CLI
22

3-
Codebase Memory builds a persistent structural knowledge graph of a source repository and exposes it through a local command-line interface designed for coding agents and humans.
3+
Codebase Memory CLI builds a persistent structural knowledge graph of a source
4+
repository and exposes it through a local command-line interface for coding
5+
agents and humans.
6+
7+
This repository is a fork and C port of
8+
[Codebase Memory MCP](https://github.com/DeusData/codebase-memory-mcp). The
9+
fork keeps the code-intelligence engine, but removes the MCP server and its
10+
third-party MCP integration surface. It exists for workplace environments
11+
where policy prohibits using third-party MCP servers while still allowing a
12+
local, auditable developer tool.
413

514
The product executable is `codebase-memory-cli`. Running it with no command shows CLI help; there is no supported MCP stdio server entry point.
615

7-
> Migration status: application operations, daemon execution, supervised workers, UI dispatch, and store hosting are protocol-neutral. The physical MCP subsystem has been removed. Remaining MCP-era names are limited to compatibility-sensitive persisted paths/package history that are being retired deliberately. See [`docs/CLI_MIGRATION_STATUS.md`](docs/CLI_MIGRATION_STATUS.md).
16+
> The CLI is the supported product surface. Some cache and package paths retain
17+
> the historical `codebase-memory-mcp` name for compatibility; they do not
18+
> enable or start an MCP server.
819
9-
## What it does
20+
## Features
1021

1122
Codebase Memory parses source with tree-sitter and optional language-server enrichment, then stores functions, classes, methods, call relationships, imports, routes, cross-service links, and other structural facts in a local graph-backed index.
1223

@@ -22,6 +33,17 @@ Use it when you need to answer questions such as:
2233

2334
The graph is a discovery and structural-evidence layer, not a substitute for source verification. For material claims, especially negative or exhaustive claims, verify exact source and index coverage.
2435

36+
It includes:
37+
38+
- tree-sitter parsing for 162 languages;
39+
- hybrid LSP-style semantic enrichment for supported languages;
40+
- definitions, calls, imports, usages, routes, channels, and cross-service links;
41+
- architecture summaries, change-impact analysis, dead-code queries, ADRs, and Cypher queries;
42+
- BM25, semantic, structural, and graph-augmented source search;
43+
- cross-repository graph intelligence and optional 3D graph visualization;
44+
- a persistent local index with incremental updates and optional shared graph artifacts;
45+
- a coordination daemon, supervised workers, and filesystem watcher for reliable background indexing.
46+
2547
## Quick start
2648

2749
Build or install the binary, then from a repository:
@@ -42,7 +64,8 @@ codebase-memory-cli search "ClaimValidator" --json
4264
codebase-memory-cli trace ClaimValidator.validate --direction inbound --json
4365
```
4466

45-
Canonical machine output does not expose the historical MCP `content:[{type:"text"}]` envelope. Operational failures return a non-zero exit status.
67+
Canonical machine output is ordinary CLI output or stable JSON. Operational
68+
failures return a non-zero exit status.
4669

4770
## Core commands
4871

@@ -68,13 +91,14 @@ When the working directory does not identify the intended index unambiguously, p
6891

6992
### Compatibility interface
7093

71-
The historical generic form remains temporarily available as a parity/migration surface:
94+
The generic operation form remains available for scripts that need the complete
95+
operation catalog:
7296

7397
```sh
7498
codebase-memory-cli cli search_graph --project my-project --name-pattern '.*Handler.*'
7599
```
76100

77-
It is not the canonical interface and will be retired after the protocol-neutral operation layer replaces the remaining private dispatcher dependency.
101+
The named commands above are preferred for normal use.
78102

79103
## Agent workflow
80104

@@ -118,8 +142,8 @@ Use `install --plan` to inspect asset writes and `install-hooks --plan` to inspe
118142
### From source
119143

120144
```sh
121-
git clone https://github.com/DeusData/codebase-memory-mcp.git
122-
cd codebase-memory-mcp
145+
git clone https://github.com/ngallodev/codebase-memory-cli.git
146+
cd codebase-memory-cli
123147
scripts/build.sh
124148
./build/c/codebase-memory-cli --help
125149
```
@@ -129,16 +153,20 @@ scripts/build.sh
129153
macOS/Linux:
130154

131155
```sh
132-
curl -fsSL https://raw.githubusercontent.com/DeusData/codebase-memory-mcp/main/scripts/setup.sh | bash
156+
curl -fsSL https://raw.githubusercontent.com/ngallodev/codebase-memory-cli/main/scripts/setup.sh | bash
133157
```
134158

135159
Windows PowerShell:
136160

137161
```powershell
138-
irm https://raw.githubusercontent.com/DeusData/codebase-memory-mcp/main/scripts/setup-windows.ps1 | iex
162+
irm https://raw.githubusercontent.com/ngallodev/codebase-memory-cli/main/scripts/setup-windows.ps1 | iex
139163
```
140164

141-
The setup scripts install the executable. They do not install hooks or write MCP client configuration. Afterward, run `codebase-memory-cli install --skip-binary` for CLI-first skills/instructions. Run `codebase-memory-cli install-hooks` separately only if you explicitly want CLI-owned agent hooks.
165+
The setup scripts install the executable. They do not install hooks or write
166+
MCP client configuration. Afterward, run `codebase-memory-cli install
167+
--skip-binary` for CLI skills and instructions. Run
168+
`codebase-memory-cli install-hooks` separately only if you explicitly want
169+
CLI-owned agent hooks.
142170

143171
## Human and machine output
144172

@@ -170,7 +198,7 @@ The existing indexing engine is intentionally unchanged by the CLI-first migrati
170198
- hybrid LSP semantic enrichment for selected languages;
171199
- persistent local indexes;
172200
- call/import/definition and selected cross-service relationships;
173-
- change detection, architecture, Cypher, ADR, trace-ingestion, and other operations still available through the temporary compatibility interface while canonical named commands are expanded.
201+
- change detection, architecture, Cypher, ADR, trace ingestion, and other operations exposed through the canonical CLI and its compatibility form.
174202

175203
The first vertical slice does **not** rewrite the graph schema, parser pipeline, store format, or existing indexes.
176204

@@ -198,7 +226,7 @@ Important environment variables include:
198226

199227
See [`docs/CONFIGURATION.md`](docs/CONFIGURATION.md) for the full reference.
200228

201-
## Architecture during the CLI-first migration
229+
## Architecture
202230

203231
The intended direction is:
204232

@@ -208,7 +236,10 @@ agent skill ─┼──> CLI / hooks ──> protocol-neutral operations ──
208236
agent hooks ─┘
209237
```
210238

211-
The CLI, hooks, daemon, supervised workers, and UI now dispatch through the neutral operation/runtime layers. Index supervision, project mutation locks, version-cohort checks, process containment, memory limits, cancellation, store recovery, and secure local coordination remain part of the correctness kernel rather than protocol adapters.
239+
The CLI, hooks, daemon, supervised workers, watcher, and UI dispatch through
240+
the operation and runtime layers. Index supervision, project mutation locks,
241+
version-cohort checks, process containment, memory limits, cancellation, store
242+
recovery, and secure local coordination are part of the application itself.
212243

213244
## Build
214245

@@ -244,8 +275,9 @@ See [`SECURITY.md`](SECURITY.md) and [`docs/SECURITY-DISCLOSURE.md`](docs/SECURI
244275

245276
## Migration documents
246277

247-
- [`docs/CLI_FIRST_VERTICAL_SLICE_IMPLEMENTATION_PLAN.md`](docs/CLI_FIRST_VERTICAL_SLICE_IMPLEMENTATION_PLAN.md) — implementation-grade first-slice plan, critical review, checkpoints, and definition of done.
248-
- [`docs/CLI_ONLY_MIGRATION_PLAN.md`](docs/CLI_ONLY_MIGRATION_PLAN.md) — original high-level CLI-only direction retained as historical input.
278+
- [`docs/CLI_MIGRATION_STATUS.md`](docs/CLI_MIGRATION_STATUS.md) — current port and qualification status.
279+
- [`docs/RELEASE_QUALIFICATION_PLAN.md`](docs/RELEASE_QUALIFICATION_PLAN.md) — build, platform, benchmark, and release gates.
280+
- [`docs/CLI_ONLY_MIGRATION_PLAN.md`](docs/CLI_ONLY_MIGRATION_PLAN.md) — historical rationale and scope of the MCP removal.
249281

250282
## License
251283

‎SECURITY.md‎

Lines changed: 22 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,30 @@
1-
# Security Policy
1+
# Security Policy — Codebase Memory CLI
22

33
## Transparency & Disclaimer
44

5-
codebase-memory-mcp interacts deeply with your filesystem. It reads source files across your entire codebase, writes to agent configuration files, and spawns background processes. This is inherent to what it does — not a bug.
5+
Codebase Memory CLI interacts deeply with your filesystem. It reads source
6+
files across your codebase, writes to agent configuration files when explicitly
7+
requested, and may spawn local background processes for indexing. This is
8+
inherent to what it does — not a bug. It is a CLI-only fork and C port of
9+
Codebase Memory MCP, created for workplaces that prohibit third-party MCP
10+
servers.
611

712
**If you are uncomfortable with these access patterns**, please audit the source code before running. The full source is available in this repository. Release archives produced by the current release pipeline are verifiably built from this source and can be independently verified via SLSA Build Level 3 provenance, Sigstore signatures, and SHA-256 checksums (see [Verification](#verification) below). Each archive contains a native executable and its authenticated release-owned runtime assets.
813

914
We are humans and can make mistakes. We take security seriously — it is Priority #1 for this project — but we cannot guarantee perfection. By using this software you accept responsibility for evaluating whether it meets your own security requirements.
1015

1116
## Runtime Network Behavior
1217

13-
Indexing, graph queries, semantic search, and MCP tool handling run locally. The
14-
MCP server does not upload source code, repository paths, graph indexes, query
18+
Indexing, graph queries, semantic search, and CLI operation handling run locally.
19+
The CLI does not upload source code, repository paths, graph indexes, query
1520
contents, environment variables, usage metrics, or telemetry.
1621

17-
The MCP server has one best-effort external runtime check: after MCP
18-
`initialize`, it starts a background update-check thread that requests release
19-
metadata from
20-
`https://api.github.com/repos/DeusData/codebase-memory-mcp/releases/latest`.
21-
That request is used only to show an update notice when a newer release exists.
22-
It sends no project data; only standard HTTPS metadata, such as the destination
23-
host and the normal `curl` request headers, are visible to GitHub and the
24-
network path.
25-
26-
The update check is non-blocking for MCP startup and tool calls. If the machine
27-
is offline, DNS fails, GitHub is unreachable, or `curl` exits with an error, the
28-
check is ignored. The request is also bounded with `curl --max-time 5`; a
29-
process shutting down immediately while the check is still running may wait for
30-
that bounded background thread to finish.
31-
32-
Explicit install, package-manager, and `codebase-memory-mcp update` flows are
33-
separate user-initiated network operations that download release assets and
34-
checksums from GitHub.
22+
The CLI has no MCP runtime or MCP startup path. Explicit install and update
23+
commands may request release metadata from GitHub to locate or verify release
24+
assets. No project data is sent.
25+
26+
Network access is limited to explicit installation and update workflows that
27+
download release assets and checksums from GitHub.
3528

3629
## Help Us Stay Secure
3730

@@ -56,7 +49,7 @@ can fix it before public disclosure:
5649

5750
1. **Do NOT open a public issue, PR, or social-media post** for security
5851
vulnerabilities.
59-
2. **Preferred:** use GitHub's [private vulnerability reporting](https://github.com/DeusData/codebase-memory-mcp/security/advisories/new)
52+
2. **Preferred:** use GitHub's [private vulnerability reporting](https://github.com/ngallodev/codebase-memory-cli/security/advisories/new)
6053
(the repository's **Security → Report a vulnerability** button). This keeps
6154
everything in one place and starts a private advisory automatically.
6255
3. **Alternative:** email martin.vogel.tech@gmail.com.
@@ -81,7 +74,7 @@ can fix it before public disclosure:
8174
8275
We follow **coordinated disclosure**: fixes are developed privately, validated
8376
across all supported platforms, released, and only then disclosed publicly via a
84-
[GitHub Security Advisory](https://github.com/DeusData/codebase-memory-mcp/security/advisories)
77+
[GitHub Security Advisory](https://github.com/ngallodev/codebase-memory-cli/security/advisories)
8578
with a **CVE** and credit to you. The full handling process — including how you
8679
can verify the fix before release — is documented in
8780
[`docs/SECURITY-DISCLOSURE.md`](docs/SECURITY-DISCLOSURE.md).
@@ -106,13 +99,12 @@ This project implements multiple layers of security verification. Every release
10699
- Layer 4: Install output path + content validation
107100
- Layer 5: Smoke test hardening (clean shutdown, residual processes, version integrity)
108101
- Layer 6: Graph UI audit (external domains, CORS, server binding, eval/iframe)
109-
- Layer 7: MCP robustness (23 adversarial JSON-RPC payloads)
102+
- Layer 7: parser and CLI robustness tests
110103
- Layer 8: Vendored dependency integrity (SHA-256 checksums, dangerous call scan)
111104
- **All dangerous function calls** require a reviewed entry in `scripts/security-allowlist.txt`
112105
- **Time-bomb pattern detection** — scans for `time()`/`sleep()` near dangerous calls (could indicate delayed activation)
113-
- **MCP tool handler file read audit** — tracks file read count in `mcp.c` against an expected maximum (detects added file reads that could exfiltrate data through tool responses)
114106
- **CodeQL SAST** — static application security testing on every push (taint analysis, CWE detection, data flow tracking). Any open alert blocks the release.
115-
- **Fuzz testing** — random/mutated inputs to MCP server and Cypher parser (60 seconds per build). Catches crashes, segfaults, and memory errors that structured tests miss.
107+
- **Fuzz testing** — random/mutated inputs to the CLI parser and Cypher parser (60 seconds per build). Catches crashes, segfaults, and memory errors that structured tests miss.
116108
- **Native antivirus scanning** on every platform (any detection fails the build):
117109
- **Windows**: Windows Defender with ML heuristics — the same engine end users run
118110
- **Linux**: ClamAV with daily signature updates
@@ -159,8 +151,8 @@ Users can independently verify any release archive and the runtime set it contai
159151
```bash
160152
# SLSA Build Level 3 provenance for release archives
161153
gh attestation verify <downloaded-file> \
162-
--repo DeusData/codebase-memory-mcp \
163-
--signer-workflow DeusData/codebase-memory-mcp/.github/workflows/_build.yml
154+
--repo ngallodev/codebase-memory-cli \
155+
--signer-workflow ngallodev/codebase-memory-cli/.github/workflows/_build.yml
164156

165157
# Sigstore cosign (keyless signature)
166158
cosign verify-blob --bundle <file>.bundle <file>
@@ -289,7 +281,7 @@ Any other verdict, an incomplete scan, a missing sibling, or a provenance/hash
289281
mismatch blocks the complete release. The selected bytes are then packaged
290282
without stripping, signing, relinking, or any other content mutation, and the
291283
resulting archives—not rejected candidates—are what smoke and soak testing execute.
292-
After packaging, every archive and MCPB executable is extracted and its SHA-256
284+
After packaging, every archive and executable is extracted and its SHA-256
293285
must still equal the selected candidate. This identity check makes a second
294286
VirusTotal submission of the same bytes unnecessary.
295287

0 commit comments

Comments
 (0)