Skip to content

Commit 8340ec2

Browse files
tae2089claude
andcommitted
docs: add npm/bun install, credit code-review-graph inspiration
- Add Installation section (npm, bun, go install, build from source) - Credit code-review-graph as inspiration - Normalize CLI examples to use 'ccg' (global install) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 7894a79 commit 8340ec2

1 file changed

Lines changed: 30 additions & 14 deletions

File tree

README.md

Lines changed: 30 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
Local code analysis tool that parses codebases via Tree-sitter into a knowledge graph. Supports 15 languages, 19 MCP tools, custom annotation search, and Apache AGE Cypher queries.
44

5+
Inspired by [code-review-graph](https://github.com/tirth8205/code-review-graph) — a Python-based code analysis tool. This project reimplements and extends the concept in Go with multi-DB support, custom annotation system, and MCP integration for AI-powered code understanding.
6+
57
## Features
68

79
- **15 languages**: Go, Python, TypeScript, Java, Ruby, JavaScript, C, C++, Rust, C#, Kotlin, PHP, Swift, Scala, Lua, Bash
@@ -11,9 +13,23 @@ Local code analysis tool that parses codebases via Tree-sitter into a knowledge
1113
- **Multi-DB**: SQLite (local), PostgreSQL, MySQL
1214
- **Full-text search**: FTS5 (SQLite), tsvector+GIN (PostgreSQL), FULLTEXT (MySQL)
1315

14-
## Quick Start
16+
## Installation
17+
18+
### npm / bun (recommended)
19+
20+
```bash
21+
npm install -g code-context-graph
22+
# or
23+
bun install -g code-context-graph
24+
```
25+
26+
### go install
27+
28+
```bash
29+
go install github.com/tae2089/code-context-graph/cmd/ccg@latest
30+
```
1531

16-
### Build
32+
### Build from source
1733

1834
```bash
1935
CGO_ENABLED=1 go build -tags "fts5" -o ccg ./cmd/ccg/
@@ -22,7 +38,7 @@ CGO_ENABLED=1 go build -tags "fts5" -o ccg ./cmd/ccg/
2238
### Parse your project
2339

2440
```bash
25-
./ccg build .
41+
ccg build .
2642
```
2743

2844
```
@@ -33,17 +49,17 @@ Build complete: 70 files, 749 nodes, 7387 edges
3349

3450
```bash
3551
# Keyword search (includes annotations)
36-
./ccg search "authentication"
52+
ccg search "authentication"
3753

3854
# Search by business context
39-
./ccg search "결제" # finds functions with @intent/@domainRule about payments
40-
./ccg search "dead code" # finds deadcode.Find via @intent annotation
55+
ccg search "결제" # finds functions with @intent/@domainRule about payments
56+
ccg search "dead code" # finds deadcode.Find via @intent annotation
4157
```
4258

4359
### Status
4460

4561
```bash
46-
./ccg status
62+
ccg status
4763
```
4864

4965
```
@@ -121,26 +137,26 @@ docker compose up age -d
121137
122138
```bash
123139
AGE_DSN="host=127.0.0.1 port=5455 dbname=ccg user=ccg password=ccg sslmode=disable" \
124-
./ccg build --graph .
140+
ccg build --graph .
125141
```
126142
127143
### Cypher queries
128144
129145
```bash
130146
# All function call relationships
131-
./ccg query "MATCH (a:Function)-[:CALLS]->(b:Function) RETURN a.name, b.name" --columns 2
147+
ccg query "MATCH (a:Function)-[:CALLS]->(b:Function) RETURN a.name, b.name" --columns 2
132148

133149
# Blast-radius (3 hops)
134-
./ccg query "MATCH ({name: 'Login'})-[*1..3]-(n) RETURN DISTINCT n.qualified_name"
150+
ccg query "MATCH ({name: 'Login'})-[*1..3]-(n) RETURN DISTINCT n.qualified_name"
135151

136152
# Call path between two functions
137-
./ccg query "MATCH path = (a {name: 'Handler'})-[:CALLS*]->(b {name: 'Save'}) RETURN path"
153+
ccg query "MATCH path = (a {name: 'Handler'})-[:CALLS*]->(b {name: 'Save'}) RETURN path"
138154

139155
# Dead code
140-
./ccg query "MATCH (n:Function) WHERE NOT ()-[:CALLS]->(n) RETURN n.qualified_name"
156+
ccg query "MATCH (n:Function) WHERE NOT ()-[:CALLS]->(n) RETURN n.qualified_name"
141157

142158
# Most called functions
143-
./ccg query "MATCH ()-[:CALLS]->(n) RETURN n.name, count(*) AS c ORDER BY c DESC LIMIT 10"
159+
ccg query "MATCH ()-[:CALLS]->(n) RETURN n.name, count(*) AS c ORDER BY c DESC LIMIT 10"
144160
```
145161
146162
### Graph Schema
@@ -159,7 +175,7 @@ Add `.mcp.json` to your project:
159175
{
160176
"mcpServers": {
161177
"ccg": {
162-
"command": "./ccg",
178+
"command": "ccg",
163179
"args": ["serve", "--db", "sqlite", "--dsn", "ccg.db"]
164180
}
165181
}

0 commit comments

Comments
 (0)