@codragraph/cli 2.0.0 → 2.1.1
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/README.md +60 -22
- package/dist/_shared/cgdb/schema-constants.d.ts +16 -0
- package/dist/_shared/cgdb/schema-constants.d.ts.map +1 -0
- package/dist/_shared/cgdb/schema-constants.js +70 -0
- package/dist/_shared/cgdb/schema-constants.js.map +1 -0
- package/dist/_shared/feature-clusters.d.ts +99 -0
- package/dist/_shared/feature-clusters.d.ts.map +1 -0
- package/dist/_shared/feature-clusters.js +2 -0
- package/dist/_shared/feature-clusters.js.map +1 -0
- package/dist/_shared/graph/types.d.ts +16 -2
- package/dist/_shared/graph/types.d.ts.map +1 -1
- package/dist/_shared/index.d.ts +3 -2
- package/dist/_shared/index.d.ts.map +1 -1
- package/dist/_shared/index.js +1 -1
- package/dist/_shared/index.js.map +1 -1
- package/dist/_shared/pipeline.d.ts +1 -1
- package/dist/_shared/pipeline.d.ts.map +1 -1
- package/dist/cli/ai-context.js +4 -0
- package/dist/cli/analyze.js +30 -27
- package/dist/cli/graphstore.js +21 -21
- package/dist/cli/index-repo.js +3 -3
- package/dist/cli/index.js +37 -0
- package/dist/cli/setup.js +9 -5
- package/dist/cli/tool.d.ts +25 -0
- package/dist/cli/tool.js +74 -0
- package/dist/cli/wiki.js +3 -3
- package/dist/config/supported-languages.d.ts +3 -3
- package/dist/config/supported-languages.js +3 -3
- package/dist/core/augmentation/engine.js +7 -7
- package/dist/core/cgdb/cgdb-adapter.d.ts +176 -0
- package/dist/core/cgdb/cgdb-adapter.js +1336 -0
- package/dist/core/cgdb/content-read.d.ts +46 -0
- package/dist/core/cgdb/content-read.js +64 -0
- package/dist/core/cgdb/csv-generator.d.ts +29 -0
- package/dist/core/cgdb/csv-generator.js +523 -0
- package/dist/core/cgdb/pool-adapter.d.ts +93 -0
- package/dist/core/cgdb/pool-adapter.js +550 -0
- package/dist/core/cgdb/schema.d.ts +63 -0
- package/dist/core/cgdb/schema.js +557 -0
- package/dist/core/embeddings/embedder.js +4 -2
- package/dist/core/embeddings/embedding-pipeline.js +4 -4
- package/dist/core/graphstore/cgdb-row-source.d.ts +19 -0
- package/dist/core/graphstore/cgdb-row-source.js +141 -0
- package/dist/core/graphstore/index.d.ts +2 -2
- package/dist/core/graphstore/index.js +4 -4
- package/dist/core/group/bridge-db.d.ts +2 -2
- package/dist/core/group/bridge-db.js +18 -18
- package/dist/core/group/bridge-schema.d.ts +4 -4
- package/dist/core/group/bridge-schema.js +4 -4
- package/dist/core/group/cross-impact.js +3 -3
- package/dist/core/group/service.d.ts +16 -0
- package/dist/core/group/service.js +360 -0
- package/dist/core/group/sync.js +4 -4
- package/dist/core/ingestion/emit-references.d.ts +1 -1
- package/dist/core/ingestion/emit-references.js +1 -1
- package/dist/core/ingestion/feature-cluster-processor.d.ts +62 -0
- package/dist/core/ingestion/feature-cluster-processor.js +626 -0
- package/dist/core/ingestion/finalize-orchestrator.js +1 -1
- package/dist/core/ingestion/model/registration-table.js +1 -0
- package/dist/core/ingestion/model/resolve.d.ts +2 -2
- package/dist/core/ingestion/model/resolve.js +3 -3
- package/dist/core/ingestion/model/semantic-model.d.ts +1 -1
- package/dist/core/ingestion/model/semantic-model.js +1 -1
- package/dist/core/ingestion/model/symbol-table.d.ts +1 -1
- package/dist/core/ingestion/model/symbol-table.js +1 -1
- package/dist/core/ingestion/pipeline-phases/feature-clusters.d.ts +17 -0
- package/dist/core/ingestion/pipeline-phases/feature-clusters.js +88 -0
- package/dist/core/ingestion/pipeline-phases/index.d.ts +1 -0
- package/dist/core/ingestion/pipeline-phases/index.js +1 -0
- package/dist/core/ingestion/pipeline.d.ts +4 -0
- package/dist/core/ingestion/pipeline.js +9 -5
- package/dist/core/run-analyze.d.ts +1 -0
- package/dist/core/run-analyze.js +36 -30
- package/dist/core/search/bm25-index.d.ts +3 -3
- package/dist/core/search/bm25-index.js +9 -9
- package/dist/core/search/hybrid-search.js +2 -2
- package/dist/core/wiki/generator.d.ts +2 -2
- package/dist/core/wiki/generator.js +4 -4
- package/dist/core/wiki/graph-queries.d.ts +2 -2
- package/dist/core/wiki/graph-queries.js +5 -5
- package/dist/mcp/core/cgdb-adapter.d.ts +5 -0
- package/dist/mcp/core/cgdb-adapter.js +5 -0
- package/dist/mcp/core/embedder.js +6 -3
- package/dist/mcp/local/local-backend.d.ts +14 -2
- package/dist/mcp/local/local-backend.js +396 -18
- package/dist/mcp/resources.js +139 -0
- package/dist/mcp/server.js +3 -3
- package/dist/mcp/tools.js +175 -3
- package/dist/server/analyze-worker.js +2 -2
- package/dist/server/api.js +147 -31
- package/dist/storage/repo-manager.d.ts +10 -5
- package/dist/storage/repo-manager.js +10 -6
- package/dist/types/pipeline.d.ts +2 -0
- package/hooks/claude/codragraph-hook.cjs +4 -4
- package/package.json +15 -6
- package/scripts/build.js +21 -21
- package/skills/codragraph-cli.md +17 -1
- package/skills/codragraph-guide.md +6 -2
- package/skills/codragraph-onboarding.md +2 -2
- package/vendor/tree-sitter-proto/bindings/node/index.js +3 -3
- package/vendor/tree-sitter-proto/src/node-types.json +1 -1
package/skills/codragraph-cli.md
CHANGED
|
@@ -5,7 +5,7 @@ description: "Use when the user needs to run CodraGraph CLI commands like analyz
|
|
|
5
5
|
|
|
6
6
|
# CodraGraph CLI Commands
|
|
7
7
|
|
|
8
|
-
All commands work via `npx` — no global install required.
|
|
8
|
+
All commands work via `npx` — no global install required. The examples are safe in Windows PowerShell, macOS bash/zsh, and Linux shells; prefer `npm --prefix <package> <script>` from the repo root when running package-local checks.
|
|
9
9
|
|
|
10
10
|
## Commands
|
|
11
11
|
|
|
@@ -32,6 +32,22 @@ npx @codragraph/cli status
|
|
|
32
32
|
|
|
33
33
|
Shows whether the current repo has a CodraGraph index, when it was last updated, and symbol/relationship counts. Use this to check if re-indexing is needed.
|
|
34
34
|
|
|
35
|
+
### feature-clusters — List product/domain areas
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
npx @codragraph/cli feature-clusters
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
Shows the human-facing feature clusters CodraGraph detected: areas like Settings, Auth, AI, Billing, or Admin, with member counts and confidence. Use this before asking an agent to work on a product area.
|
|
42
|
+
|
|
43
|
+
### feature-context — Load one focused context pack
|
|
44
|
+
|
|
45
|
+
```bash
|
|
46
|
+
npx @codragraph/cli feature-context Settings
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
Returns the members, file paths, line ranges, dependencies, and flows for one feature cluster so an agent can edit the right files without re-exploring the whole repo.
|
|
50
|
+
|
|
35
51
|
### clean — Delete the index
|
|
36
52
|
|
|
37
53
|
```bash
|
|
@@ -37,6 +37,8 @@ For any task involving code understanding, debugging, impact analysis, or refact
|
|
|
37
37
|
| `impact` | Symbol blast radius — what breaks at depth 1/2/3 with confidence |
|
|
38
38
|
| `detect_changes` | Git-diff impact — what do your current changes affect |
|
|
39
39
|
| `rename` | Multi-file coordinated rename with confidence-tagged edits |
|
|
40
|
+
| `feature_clusters` | Product/domain feature map for targeted context |
|
|
41
|
+
| `feature_context` | Members, line ranges, dependencies, and flows for one feature |
|
|
40
42
|
| `cypher` | Raw graph queries (read `codragraph://repo/{name}/schema` first) |
|
|
41
43
|
| `list_repos` | Discover indexed repos |
|
|
42
44
|
|
|
@@ -48,6 +50,8 @@ Lightweight reads (~100-500 tokens) for navigation:
|
|
|
48
50
|
| ---------------------------------------------- | ----------------------------------------- |
|
|
49
51
|
| `codragraph://repo/{name}/context` | Stats, staleness check |
|
|
50
52
|
| `codragraph://repo/{name}/clusters` | All functional areas with cohesion scores |
|
|
53
|
+
| `codragraph://repo/{name}/feature-clusters` | Product/domain feature areas |
|
|
54
|
+
| `codragraph://repo/{name}/feature/{featureName}` | Focused files, line ranges, flows, deps |
|
|
51
55
|
| `codragraph://repo/{name}/cluster/{clusterName}` | Area members |
|
|
52
56
|
| `codragraph://repo/{name}/processes` | All execution flows |
|
|
53
57
|
| `codragraph://repo/{name}/process/{processName}` | Step-by-step trace |
|
|
@@ -55,8 +59,8 @@ Lightweight reads (~100-500 tokens) for navigation:
|
|
|
55
59
|
|
|
56
60
|
## Graph Schema
|
|
57
61
|
|
|
58
|
-
**Nodes:** File, Function, Class, Interface, Method, Community, Process
|
|
59
|
-
**Edges (via CodeRelation.type):** CALLS, IMPORTS, EXTENDS, IMPLEMENTS, DEFINES, MEMBER_OF, STEP_IN_PROCESS
|
|
62
|
+
**Nodes:** File, Function, Class, Interface, Method, Community, Process, FeatureCluster
|
|
63
|
+
**Edges (via CodeRelation.type):** CALLS, IMPORTS, EXTENDS, IMPLEMENTS, DEFINES, MEMBER_OF, STEP_IN_PROCESS, FEATURE_MEMBER_OF, FEATURE_DEPENDS_ON
|
|
60
64
|
|
|
61
65
|
```cypher
|
|
62
66
|
MATCH (caller)-[:CodeRelation {type: 'CALLS'}]->(f:Function {name: "myFunc"})
|
|
@@ -89,7 +89,7 @@ running through it."
|
|
|
89
89
|
|
|
90
90
|
3. READ .claude/skills/generated/ingestion/SKILL.md
|
|
91
91
|
→ Entry points: runFullAnalysis, IngestionPipeline.run
|
|
92
|
-
→ Key files:
|
|
92
|
+
→ Key files: packages/core/src/core/ingestion/
|
|
93
93
|
|
|
94
94
|
4. READ codragraph://repo/CodraGraph/processes
|
|
95
95
|
→ Top flows: AnalyzeFlow, McpQueryFlow, GraphstoreCommitFlow
|
|
@@ -101,7 +101,7 @@ running through it."
|
|
|
101
101
|
→ orchestrator that takes (repoPath, options, hooks) and runs the pipeline.
|
|
102
102
|
→ Called by: analyzeCommand (CLI), eval-server, augment hook
|
|
103
103
|
|
|
104
|
-
Tour result: "Start at runFullAnalysis (
|
|
104
|
+
Tour result: "Start at runFullAnalysis (packages/core/src/core/run-analyze.ts).
|
|
105
105
|
That's the orchestrator. The 12-stage pipeline lives under
|
|
106
106
|
src/core/ingestion/. Phase 4 graphstore is in src/core/graphstore/."
|
|
107
107
|
```
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
const root = require(
|
|
1
|
+
const root = require('path').join(__dirname, '..', '..');
|
|
2
2
|
|
|
3
|
-
module.exports = require(
|
|
3
|
+
module.exports = require('node-gyp-build')(root);
|
|
4
4
|
|
|
5
5
|
try {
|
|
6
|
-
module.exports.nodeTypeInfo = require(
|
|
6
|
+
module.exports.nodeTypeInfo = require('../../src/node-types.json');
|
|
7
7
|
} catch (_) {}
|