From 35ec2973d1731d73df2305f8424d6d269fb9d3ec Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 24 Mar 2026 21:28:50 +0000 Subject: [PATCH 1/3] Initial plan From b1c22e01e79e2e5c62b643195e331fb28c4629ce Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 24 Mar 2026 21:37:08 +0000 Subject: [PATCH 2/3] feat: split CLI into lightweight falkordb-cgraph package Co-authored-by: gkorland <753206+gkorland@users.noreply.github.com> Agent-Logs-Url: https://github.com/FalkorDB/code-graph/sessions/b48ad8e3-c799-4522-9425-93bd5e5b2574 --- AGENTS.md | 26 +- Makefile | 4 +- README.md | 30 +- cli/README.md | 54 +++ cli/cgraph/__init__.py | 0 cli/cgraph/main.py | 421 +++++++++++++++++++++ cli/pyproject.toml | 25 ++ skills/code-graph/references/management.md | 18 +- 8 files changed, 557 insertions(+), 21 deletions(-) create mode 100644 cli/README.md create mode 100644 cli/cgraph/__init__.py create mode 100644 cli/cgraph/main.py create mode 100644 cli/pyproject.toml diff --git a/AGENTS.md b/AGENTS.md index 1b2679b9..519b563f 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -21,7 +21,7 @@ Knowledge graph visualization tool for codebases. Python FastAPI backend + React ```text api/ # Python backend - cli.py # cgraph CLI tool (typer) + cli.py # cgraph CLI tool (typer) — full version used during dev index.py # FastAPI app, routes, auth, SPA serving graph.py # FalkorDB graph operations (sync + async) llm.py # GraphRAG + LiteLLM chat @@ -32,6 +32,10 @@ api/ # Python backend analyzers/ # Language-specific code analyzers entities/ # Graph entity models git_utils/ # Git history graph construction +cli/ # Lightweight CLI package (falkordb-cgraph) + pyproject.toml # Minimal deps: falkordb + typer only + cgraph/ + main.py # Standalone CLI commands (list, search, neighbors, paths, info, ensure-db) app/ # React frontend (Vite) src/components/ # React components (ForceGraph, chat, code-graph, etc.) src/lib/ # Utilities @@ -136,16 +140,26 @@ Key variables (see `.env.template` for full list): ## CLI (`cgraph`) -Typer-based CLI wrapping the sync `Graph` and `Project` classes. Outputs JSON to stdout, status to stderr. Entry point: `api/cli.py`. +Two packages provide the `cgraph` command: -Install: `pipx install falkordb-code-graph` or `pip install falkordb-code-graph` +**Lightweight CLI** (`falkordb-cgraph` — the recommended install for end users): -For development: `make install-cli` or `uv pip install -e .` +Install: `pipx install falkordb-cgraph` + +For development: `make install-cli` (installs from `cli/`) + +Provides query commands only (`list`, `search`, `neighbors`, `paths`, `info`, `ensure-db`). The `index` and `index-repo` commands print a helpful message directing users to install `falkordb-code-graph`. + +**Full server package** (`falkordb-code-graph` — for development/Docker): + +Install: `pip install falkordb-code-graph` or `uv sync` + +Also provides `cgraph` via `api/cli.py` and includes all indexing commands. ```bash cgraph ensure-db # Start FalkorDB if not running -cgraph index . --ignore node_modules # Index local folder -cgraph index-repo # Clone + index a repo +cgraph index . --ignore node_modules # Index local folder (full package only) +cgraph index-repo # Clone + index a repo (full package only) cgraph list # List indexed repos cgraph search [--repo ] # Full-text prefix search cgraph neighbors ... [--repo ] [--rel ] [--label