Developer CLI
Fastest path for engineers who already have Python. Install with pip and verify with `repo --help`.
RIP turns repositories into queryable knowledge graphs, semantic indexes, architecture maps, and AI-ready context packages. Use it from the CLI, REST API, Context Gateway, Flutter app, VS Code, and MCP-aware coding agents.
The core loop is intentionally short: install the CLI, initialize a repository, index it, then ask questions. Indexing creates the graph and vector data used by every analysis command.
pip install repo-intelligence==0.1.0
cd path\to\your\project
repo init --project-name "My Awesome Project"
repo index -v
repo search "authentication flow"
repo trace UserService --depth 8
repo impact UserService
repo explain "how login works" --diagram --tree --deps
repo architecture
repo onboard --output ONBOARDING.md
Fastest path for engineers who already have Python. Install with pip and verify with `repo --help`.
Use OS-specific installers when users do not want to manage Python, venvs, or dependencies directly.
Clone the repository, install dependencies with `uv sync`, and start Docker only when server mode is needed.
Use editor and mobile surfaces after the RIP server is reachable and API keys are configured.
# Contributor setup
git clone https://github.com/pratiksingh1702/RIP.git
cd RIP
uv sync
docker compose up -d
uv run repo --help
Runtime-aware commands accept `--mode auto|server|local`. Local mode is for offline single-developer analysis. Server mode is required for REST, Flutter, Gateway, WebSockets, remote Git indexing, shared indexes, and concurrent users.
| Capability | Local mode | Server mode |
|---|---|---|
| Storage | `.repo-intel/local/` SQLite, graph JSON, vector JSON | Neo4j, Qdrant, Postgres, Redis |
| Offline | Yes | No |
| CLI and MCP | Supported | Supported |
| REST, Flutter, Gateway | Unavailable | Available |
| Remote Git indexing | Unavailable | Available |
repo doctor . --mode local
repo index . --mode local
repo explain PaymentService --mode local --no-llm --tree --deps
docker compose up -d
uv run repo serve --mode server --host 0.0.0.0 --port 8000
Configuration priority is command-line options first, environment variables second, and `.repo-intel/config.toml` third. Local mode works with no server config; server mode needs service URLs and credentials.
[graph]
neo4j_uri = "bolt://localhost:7687"
neo4j_user = "neo4j"
neo4j_password = "your-password"
[search]
qdrant_host = "localhost"
qdrant_port = 6333
embedding_model = "BAAI/bge-small-en-v1.5"
[storage]
postgres_url = "postgresql+asyncpg://user:pass@localhost:5433/db"
redis_url = "redis://localhost:6379"
[llm]
primary_provider = "ollama"
primary_model = "qwen2.5-coder:7b"
ollama_host = "http://localhost:11434"
repo config
repo config --get llm.primary_provider
repo config --set llm.primary_provider=openai
repo explain "how auth works" --no-llm --tree --deps
Every `repo` command accepts `-v` / `--verbose`. Verbose mode prints detailed runtime logs and writes `.repo-intel/logs/<command>-YYYYMMDD-HHMMSS.log` when a target repository is available.
`repo init`, `repo index`, `repo status`, and `repo git-index` create and inspect indexed repository data.
`repo search`, `trace`, `impact`, `dependencies`, `explain`, `architecture`, `metrics`, `dead-code`, and `onboard` answer codebase questions.
`repo serve`, `projects`, `use`, `delete`, `config`, `api-keys`, and `doctor` manage runtime, projects, auth, and diagnostics.
Initialize `.repo-intel/` configuration for a repository and set project isolation defaults.
repo init [repo_path] --project-name billing-api
repo init C:\path\to\project --project-name flutter-app --qdrant-strategy payload_filter
Build or refresh graph and semantic indexes for a repository.
repo index . -v
repo index --incremental
repo index --smart
repo index --watch
repo index C:\path\to\project --languages python,typescript
Check whether a repository is initialized and indexed.
repo status
repo status C:\path\to\project
Server-mode remote Git indexing. Use `--subdir lib` to index only a Flutter app's `lib` folder rather than the whole repository.
repo git-index https://github.com/pratiksingh1702/flutter_music_app.git \
--folder-name flutter_music_app_lib \
--project-name flutter_music_app_lib \
--subdir lib \
--branch main
Semantic search for code by behavior or concept.
repo search "database queries" --language python --limit 50
repo search "login flow" --project 3f2f-project-idTrace call graph paths from an entry point.
repo trace main --depth 20 --format json
repo trace BaseParser --explainFind downstream files and symbols that may be affected by a change.
repo impact PythonParser
repo impact core/parser/base.py --format jsonInspect file-level importers, imports, contained symbols, and dependency graph.
repo dependencies type_provider.dart
repo dependencies auth_service.dart --project 3f2f-project-id --limit 50Explain architecture with graph context, diagrams, tree views, dependency tables, and optional LLM narration.
repo explain "how login works" --diagram --tree --deps
repo explain "how auth works" --no-llm --tree --deps
repo explain PythonParser --provider google --model gemini-2.5-flashGenerate system diagrams, risk metrics, onboarding guides, and unused-code candidates.
repo architecture --format mermaid
repo metrics --module core.parser --top-risk 10
repo onboard --output ONBOARDING.md
repo dead-code --type functions --format jsonProjects isolate graph and vector results. API keys protect server access and can be used by Flutter, REST clients, and integrations.
repo projects
repo use 3f2f-project-id
repo use 3f2f-project-id --repo-path C:\path\to\project
repo search "something" --project 3f2f-project-id
repo api-keys list
repo api-keys create "Flutter App" --description "For mobile app" --expires-in 365
repo api-keys revoke 2
Start the RIP API server for REST, Flutter, Gateway, WebSockets, remote Git indexing, and shared indexes.
docker compose up -d
repo serve --host 0.0.0.0 --port 8080
uv run repo serve --mode server --host 0.0.0.0 --port 8000Clear indexed data. Prefer `--project` for targeted cleanup.
repo delete --project d93fcec0-9811-538a-be5c-fc5be577ec5a --yes
repo delete --yes --no-storage
repo delete --mode local --yesInspect config and diagnose provider selection.
repo config --get llm.primary_provider
repo config --set llm.primary_provider=openai
repo doctor . --mode local
repo doctor . --mode serverThe Context Gateway has its own `gateway` CLI. It starts the Gateway HTTP server, reports source health, manages source toggles, and prints MCP configuration for agents.
cd gateway
uv run gateway start
uv run gateway status
uv run gateway sources list
uv run gateway sources enable github
uv run gateway sources disable jira
uv run gateway mcp config
uv run gateway mcp-server
RIP server routes are protected with bearer tokens. Create API keys from the CLI or API, then pass them in the `Authorization` header.
Authorization: Bearer rip_xxxxxxxxxxxxxxxxxxxxx
The RIP API mirrors the core CLI surfaces for apps and integrations. Responses are wrapped in the server envelope where applicable.
| Method | Endpoint | Purpose |
|---|---|---|
| POST | /index | Start indexing for a repository path. |
| GET | /index/status | Read index status. |
| GET | /search | Semantic code search. |
| GET | /trace/{symbol} | Trace call graph paths. |
| GET | /impact/{symbol} | Analyze downstream impact. |
| POST | /explain | Generate graph-backed explanations. |
| GET | /architecture | Return architecture diagram or structure. |
| GET | /metrics | Return complexity, coupling, and risk metrics. |
| GET | /dead-code | Find unused functions/classes. |
| POST | /git/index | Start remote Git indexing. |
| GET | /git/status/{job_id} | Read remote Git indexing job status. |
| GET | /runtime/status | Inspect runtime provider state. |
Project endpoints expose indexed repositories and metadata to server-mode clients such as Flutter, dashboards, and integrations.
| Method | Endpoint | Purpose |
|---|---|---|
| GET | /projects/ | List projects visible to the authenticated key. |
| GET | /projects/{project_id} | Read one project's metadata. |
| DELETE | /projects/{project_id} | Delete a project and associated indexed metadata. |
curl -H "Authorization: Bearer $RIP_API_KEY" http://127.0.0.1:8000/projects/
| Method | Endpoint | Purpose |
|---|---|---|
| POST | /api-keys | Create a new API key and return plaintext once. |
| GET | /api-keys | List key metadata: id, name, prefix, active state, expiry, last used, project id. |
| DELETE | /api-keys/{api_key_id} | Revoke an API key. |
curl -X POST http://127.0.0.1:8000/api-keys \
-H "Authorization: Bearer $RIP_ADMIN_KEY" \
-H "Content-Type: application/json" \
-d '{"name":"Flutter App","description":"Mobile access","expires_in":365}'
| Method | Endpoint | Purpose |
|---|---|---|
| GET | /, /health | Gateway health and source status. |
| POST | /api/context | Return a ranked context package for an agent task. |
| POST | /api/validate | Validate a proposed code change. |
| GET | /api/sessions, /api/sessions/{id} | List or fetch Gateway memory sessions. |
| GET | /api/sources | List sources such as RIP, GitHub, Jira, and Slack. |
| POST | /api/sources/{source}/enable | Enable a source for the Gateway process. |
| POST | /api/sources/{source}/disable | Disable a source for the Gateway process. |
| GET | /api/metrics | Return basic Gateway metrics. |
{
"task": "Add audit logging to login",
"token_budget": 6000,
"sources": ["rip", "github"]
}
CLI, FastAPI, VS Code, Flutter, MCP, and Gateway all sit above the same indexed knowledge layer.
Parser, indexer, graph, search, analysis, LLM narration, and service orchestration turn code into queryable facts.
Local mode uses files and SQLite. Server mode uses Neo4j, Qdrant, Postgres, and Redis.
| Store | Local mode | Server mode |
|---|---|---|
| Metadata | SQLite in `.repo-intel/local/` | Postgres |
| Graph | NetworkX graph JSON | Neo4j |
| Vectors | Local vector JSON payloads | Qdrant |
| Gateway/cache | Not available | Redis-backed services |
Every indexed repository has a project identity. Graph nodes and vector payloads carry project IDs so search, trace, impact, explain, and API clients can stay scoped to the intended codebase.
The Context Gateway is server-mode only. It classifies the agent task, plans source retrieval, executes sources in parallel, ranks and compresses results, checks permissions, manages sessions, and returns a context package.
cd gateway
uv pip install -e .
cp .env.example .env
uv run alembic upgrade head
uv run gateway start
uv run gateway mcp config
| Source | Default | Notes |
|---|---|---|
| rip | Always enabled | Core repository intelligence source. |
| github | Optional | Requires `GATEWAY_GITHUB_MCP_ENABLED` and token/config. |
| jira | Optional | Requires Jira URL/token and optional project key. |
| slack | Optional | Requires Slack token/config. |
docker compose up -d
.\.venv\Scripts\repo.exe serve --mode server
.\gateway\.venv\Scripts\gateway.exe start
curl http://127.0.0.1:8001/health
gateway status
The VS Code extension is the editor-first interface. It exposes RIP Chat, context menu actions, architecture visualization, metrics, and index status monitoring.
Index this project
Explain how authentication works
Show architecture diagram
Trace UserService
The Flutter app connects to a server-mode RIP backend. Use `repo serve --host 0.0.0.0` so the phone can reach the server over the local network, then provide the API key in the app setup flow.
The app mirrors server-backed workflows. Project surfaces use project metadata, and remote Git indexing can be triggered with the same `subdir` semantics as the CLI.
/index https://github.com/pratiksingh1702/flutter_music_app.git --folder flutter_music_app_lib --project-name flutter_music_app_lib --subdir lib --branch main
@ project-list
RIP supports MCP so coding agents can ask for context, search, trace, impact, explain, and validation without guessing from raw files alone.
RIP MCP mirrors the documented CLI surface, including init, index, trace, impact, explain, search, projects, use, dead-code, onboard, architecture, metrics, serve, status, delete, and config tools.
{
"mcpServers": {
"context-gateway": {
"command": "gateway",
"args": ["mcp-server"],
"env": {
"GATEWAY_RIP_MCP_CWD": "."
}
}
}
}