Skip to content

AlameerAshraf/RepoBridge

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

3 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

  β•¦β•β•—β”Œβ”€β”β”Œβ”€β”β”Œβ”€β”β•”β•— β”¬β”€β”β”¬β”Œβ”¬β”β”Œβ”€β”β”Œβ”€β”
  β• β•¦β•β”œβ”€ β”œβ”€β”˜β”‚ β”‚β• β•©β•—β”œβ”¬β”˜β”‚ β”‚β”‚β”‚ β”¬β”œβ”€
  β•©β•šβ•β””β”€β”˜β”΄  β””β”€β”˜β•šβ•β•β”΄β””β”€β”΄β”€β”΄β”˜β””β”€β”˜β””β”€β”˜
  
Cross-repo intelligence CLI
Research, plan, and ship features that span multiple repositories.

npm CI License: MIT GitHub stars GitHub forks Node TypeScript Multi-Provider AI


The Problem

You're building a feature that touches 3 repos β€” a backend API, a frontend app, and a shared library. You need to:

  • Understand how auth works across all of them
  • Plan which files to create/modify in each repo
  • Catch that the backend returns snake_case but the frontend expects camelCase
  • Find out the event names don't match between producer and consumer

You'd normally spend hours reading code across repos, mentally mapping dependencies, and discovering conflicts mid-implementation.

RepoBridge does this in seconds.


What It Does

Feature Description
Ask Ask questions about your codebase with full cross-repo context. Concise answers with repo/file citations.
Plan Generate detailed implementation plans with per-file tasks, dependency ordering, and cross-cutting concerns. Auto-exports a structured markdown report.
Discuss Multi-phase cross-repo analysis β€” each repo is analyzed individually, then cross-referenced for conflicts with severity ratings and resolution suggestions.
Index Scans repos for file trees, API routes, exports, events, auth patterns, and env vars. Feeds this as context to AI.

Install

# From npm (recommended)
npm install -g repobridge

# Or try without installing
npx repobridge

# Or from source
git clone https://github.com/AlameerAshraf/RepoBridge.git
cd RepoBridge
npm install && npm run build && npm link

Quick Start

# Launch interactive mode
repobridge

Inside the session:

repobridge > init my-platform
repobridge:my-platform > add
  repo 1 > /path/to/backend
  repo 2 > /path/to/frontend
  choice (1/2) > 2

repobridge:my-platform > ask "How does authentication flow from frontend to backend?"
repobridge:my-platform > plan "Add Stripe billing with usage-based pricing"
repobridge:my-platform > discuss "API contract for billing endpoints"

AI Providers

RepoBridge is model-agnostic. Switch providers with one command:

config --provider anthropic                  # Claude (default)
config --provider openai --model gpt-4o      # OpenAI
config --provider deepseek --model deepseek-chat --base-url https://api.deepseek.com/v1
config --provider gemini --model gemini-2.0-flash
config --provider ollama --model llama3.1     # Local, no API key needed
Provider Default Model Auth
anthropic claude-sonnet-4-20250514 ANTHROPIC_API_KEY
openai gpt-4o OPENAI_API_KEY
gemini gemini-2.0-flash GEMINI_API_KEY
ollama llama3.1 None (local)

Any OpenAI-compatible API works via --provider openai --base-url <url> (DeepSeek, Groq, Together, Azure, etc.)


Commands

Project Management

Command Description
init <name> Create a new project
projects List all projects
use <name> Switch active project
leave Deactivate current project
delete [name] Delete a project (with confirmation)
status Project dashboard β€” repos, file/route counts, plans, discussions, AI provider

Repository Management

Command Description
add [path-or-url] Guided flow to add repos (minimum 2 required). Supports local paths and GitHub URLs. Auto-indexes on add.
index Re-index all repos in the active project

AI-Powered Features

Command Description
ask "<question>" Ask anything about your repos. Concise, direct answers with key file citations. Session auto-saved with model info.
plan "<feature>" Generate a cross-repo implementation plan. Per-file tasks with details, dependencies, and concerns. Exports markdown report.
discuss [feature] Three-phase cross-repo analysis: per-repo deep analysis β†’ cross-reference for conflicts β†’ validation pass. Each conflict includes severity reasoning and a resolution suggestion.

Session Management

Command Description
sessions List saved sessions with date, model, and question
sessions load <id> Replay a past session (supports partial ID match)
sessions delete <id> Delete a saved session
config View/change AI provider and model

Discuss Mode

Discuss mode is RepoBridge's core feature. It finds integration conflicts before you write code.

repobridge:my-app > discuss "Add real-time notifications"

How it works:

  1. Analysis phase β€” Each repo is analyzed individually by the AI, grounded in actual code. The AI examines API contracts, data models, auth patterns, events, and naming conventions.
  2. Cross-reference phase β€” All repo analyses are compared in a single pass to identify concrete conflicts with code evidence from both sides.
  3. Validation phase β€” If conflicts are found, a final pass validates them, removes false positives, and catches anything missed.

Each conflict includes:

  • What's wrong β€” detailed description citing specific files/endpoints in both repos
  • Severity β€” high/medium/low with reasoning (based on actual impact, not just type)
  • Resolution β€” specific suggested fix

Conflict types detected:

Type Example
endpoint_mismatch Backend serves /api/users, frontend calls /users
field_naming Backend returns created_at, frontend expects createdAt
auth_contract Backend expects Bearer token, frontend sends session cookie
event_mismatch Producer emits user.created, consumer listens for user_created
response_shape Backend returns { data: [...] }, frontend expects { results: [...] }
schema_mismatch Backend has email as required, frontend form treats it as optional

A full markdown report is saved to ~/.repobridge/projects/<name>/discussions/<id>-discussion.md.


Plan Output

Every plan command generates a structured markdown report at ~/.repobridge/projects/<name>/plans/<id>-plan.md:

# Implementation Plan

> **Add Stripe billing with usage-based pricing**

| | |
|---|---|
| **Project** | my-platform |
| **Repos** | 2 |
| **Tasks** | 14 |
| **Blockers** | 3 (1 high) |

## backend

### 1. + CREATE `src/models/Subscription.ts`
Subscription model with Stripe integration

- Fields: id, userId, stripeCustomerId, plan, status, currentPeriodEnd
- Stripe webhook handler for subscription.updated events

> **Depends on:** `src/models/User.ts`

### 2. ~ MODIFY `src/routes/index.ts`
Register billing routes

- Add /api/billing/* route group
- Apply auth middleware to all billing endpoints
...

Interactive Mode

Run repobridge with no arguments to enter a persistent interactive session:

$ repobridge

  β•¦β•β•—β”Œβ”€β”β”Œβ”€β”β”Œβ”€β”β•”β•— β”¬β”€β”β”¬β”Œβ”¬β”β”Œβ”€β”β”Œβ”€β”
  β• β•¦β•β”œβ”€ β”œβ”€β”˜β”‚ β”‚β• β•©β•—β”œβ”¬β”˜β”‚ β”‚β”‚β”‚ β”¬β”œβ”€
  β•©β•šβ•β””β”€β”˜β”΄  β””β”€β”˜β•šβ•β•β”΄β””β”€β”΄β”€β”΄β”˜β””β”€β”˜β””β”€β”˜

  Interactive mode. Type 'help' for commands, 'exit' to quit.

repobridge > init my-app
repobridge:my-app > add
repobridge:my-app > ask "How does the API handle auth?"
repobridge:my-app > plan "Add user notifications"
repobridge:my-app > discuss
repobridge:my-app > status
repobridge:my-app > exit

All commands work the same as one-off CLI calls. The prompt shows your active project.


Data Storage

Everything is stored locally. No cloud, no telemetry.

~/.repobridge/
β”œβ”€β”€ config.json                 ← active project + AI provider config
β”œβ”€β”€ repos/                      ← cloned GitHub repos
└── projects/
    └── <project-name>/
        β”œβ”€β”€ config.json         ← repos list + metadata
        β”œβ”€β”€ index/
        β”‚   └── <repo>.json     ← indexed repo context
        β”œβ”€β”€ sessions/
        β”‚   └── <id>.json       ← saved Q&A sessions (with model info)
        β”œβ”€β”€ plans/
        β”‚   β”œβ”€β”€ <id>.json       ← plan data
        β”‚   └── <id>-plan.md    ← generated markdown report
        └── discussions/
            β”œβ”€β”€ <id>.json       ← discussion results + conflicts
            └── <id>-discussion.md  ← generated markdown report

Architecture

src/
β”œβ”€β”€ index.ts                    ← CLI entry point (commander + REPL)
β”œβ”€β”€ commands/
β”‚   β”œβ”€β”€ init.ts                 ← Project creation
β”‚   β”œβ”€β”€ projects.ts             ← List projects
β”‚   β”œβ”€β”€ use.ts / leave.ts       ← Switch/deactivate project
β”‚   β”œβ”€β”€ add.ts                  ← Guided repo adding flow
β”‚   β”œβ”€β”€ index.ts                ← Repo indexing
β”‚   β”œβ”€β”€ ask.ts                  ← AI Q&A with streaming
β”‚   β”œβ”€β”€ plan.ts                 ← Plan generation + markdown export
β”‚   β”œβ”€β”€ discuss.ts              ← Three-phase cross-repo discussion
β”‚   β”œβ”€β”€ delete.ts               ← Project deletion
β”‚   β”œβ”€β”€ sessions.ts             ← Session management (list, load, delete)
β”‚   β”œβ”€β”€ status.ts               ← Project dashboard
β”‚   β”œβ”€β”€ config.ts               ← AI provider configuration
β”‚   └── repl.ts                 ← Interactive session loop
β”œβ”€β”€ lib/
β”‚   β”œβ”€β”€ ai.ts                   ← AI orchestration (ask, plan, discuss prompts)
β”‚   β”œβ”€β”€ discuss.ts              ← Discussion engine (analyze, cross-reference, validate)
β”‚   β”œβ”€β”€ indexer.ts              ← Repo scanning (files, routes, exports, events)
β”‚   β”œβ”€β”€ storage.ts              ← Data types + file I/O
β”‚   β”œβ”€β”€ prompt.ts               ← Shared readline with EOF handling
β”‚   └── providers/
β”‚       β”œβ”€β”€ base.ts             ← LLMProvider interface
β”‚       β”œβ”€β”€ index.ts            ← Provider factory
β”‚       β”œβ”€β”€ anthropic.ts        ← Claude (via SDK)
β”‚       β”œβ”€β”€ openai.ts           ← OpenAI-compatible (native fetch)
β”‚       β”œβ”€β”€ gemini.ts           ← Google Gemini (native fetch)
β”‚       └── ollama.ts           ← Ollama local (native fetch)
└── ui/
    β”œβ”€β”€ theme.ts                ← Layout system, boxes, tables, icons
    └── markdown.ts             ← Terminal markdown renderer

Environment Variables

Variable Required Description
ANTHROPIC_API_KEY If using Anthropic Claude API key
OPENAI_API_KEY If using OpenAI OpenAI API key
GEMINI_API_KEY If using Gemini Google AI API key

Ollama requires no API key. Keys can also be set via config --api-key.


Requirements

  • Node.js >= 18
  • npm

Tests

npm test

CI runs build + tests on every push and PR to main.


License

MIT


Stop reading code across 5 repos. Let them talk to each other.

About

πŸŒ‰ Cross-repo intelligence CLI Research, plan, and ship features that span multiple repositories.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors