Skip to content

lightlayer-dev/lightlayer

Repository files navigation

LightLayer

AI-powered code review for Github PRs.

Features

  • 🧩 Split large PRs into AI‑generated sub‑PRs

    • Automatically split with AI—no manual stacking required
    • CLI can be used in place of git push; control the number of sub‑PRs and give guidance for how to split
    • Just‑in‑time split/merge when you want to adjust items lower in the stack
  • 🧭 Unified, IDE‑like review UI

    • All context (discussion, diffs, file tree) consolidated into one view
    • Asking the AI pulls up all relevant code sections side‑by‑side for context while you read
    • Press and highlight comments/code to include them in the chat context, just like Cursor
  • 💬 Cursor‑like AI review partner

    • Ask questions freely (voice mode supported); use it like a live review with a colleague
    • Auto‑drafts review comments based on your discussion
    • One‑click suggestion bubbles for common prompts (e.g., counter‑arguments, potential concerns, explanations)
  • Additional capabilities

    • 🤖 AI‑powered PR analysis and summaries

    • 🔍 Smart diff analysis of changes

    • 🎯 Code location detection to surface relevant sections

    • 📊 PR analytics for insights into changes

    • 📱 Responsive design for desktop and mobile

    • 🚀 Simple to get started

    • Dashboard shows all PRs you’re involved in

    • Paste any public GitHub PR URL to try it out

    • Or use the CLI to create a draft PR with split sub‑PRs and open it in LightLayer

Prerequisites

  • Docker and Docker Compose
  • GitHub account and GitHub App setup
  • Anthropic API key for Claude AI
  • PostgreSQL database (included in Docker setup)
  • SuperTokens for authentication and user management

Quick Start

See our Getting Started Guide for detailed instructions.

CLI

The LightLayer CLI helps you create draft PRs and generate AI-powered sub-PRs from your current Git branch.

Build locally (from this repo)

cd cli
npm install
npm run build
npm link   # registers the `lightlayer` command locally

Usage

  • Initialize for a repository (must be run inside a Git repo):
lightlayer init

This prompts for backend/frontend hosts and takes you to http://localhost:3000/verify to copy your token. Paste the token back into the CLI when prompted. Auth is stored per-repo at ~/.lightlayer/config.json.

  • Create or find a draft PR, then generate sub PRs:
lightlayer split
  • Control the number of sub PRs and how they should be split:
lightlayer split -n 3 -m "Group by feature modules" -b main

Flags:

  • -n, --num <count>: target number of sub PRs
  • -m, --message <guidance>: guidance to influence how the split is performed
  • -b, --base <branch>: base branch for the draft PR (default: repo default branch)
  • -t, --title <title>: optional PR title override
  • --body <body>: optional PR body override

Other commands:

  • lightlayer logout – clears auth for the current repo only

Notes:

  • Commands must be run in a Git repository.
  • If the current branch isn’t on origin, the CLI will push it before creating a PR.
  • After split, the CLI prints a link like http://localhost:3000/pr/<owner>/<repo>/<pr_number> to view in LightLayer.

Architecture


                 ┌─────────────┐     ┌──────────────┐     ┌───────────────┐
                 │   GitHub    │     │   Anthropic   │     │    Deepgram    │
                 │     API     │     │      API      │     │       API      │
                 └──────▲──────┘     └──────▲────────┘     └───────▲────────┘
                        │                   │                        │
                        │                   │                        │
                ┌───────┴───────────────────┴────────────────────────┴───────┐
                │                     Backend (FastAPI)                       │
                └───▲───────────────▲───────────────▲───────────────▲───────┘
                    │               │               │               │
             ┌──────┴──────┐  ┌─────┴─────┐   ┌─────┴─────┐   ┌────┴───────┐
             │     CLI     │  │  Frontend │   │   Redis   │   │ PostgreSQL  │
             │  (Node CLI) │  │   (React) │   │  (Cache)  │   │ (Database)  │
             └─────────────┘  └───────────┘   └───────────┘   └─────▲───────┘
                                ▲                    ▲              │
                                │                    │              │
                                │                    │      ┌───────┴───────┐
                                │                    └──────►│  SuperTokens │
                                │                            │    (Auth)    │
                                └────────────────────────────└───────────--─┘

Notes:
- SuperTokens stores auth data in PostgreSQL and is also used for auth/session management.
- The only external requests made are to GitHub API, Anthropic API, and Deepgram API

Service Dependencies

  1. PostgreSQL starts first (database)
  2. Redis starts in parallel (caching)
  3. SuperTokens waits for PostgreSQL to be healthy
  4. Backend waits for PostgreSQL, Redis, and SuperTokens to be healthy
  5. Frontend waits for Backend to be healthy

Incomplete Features

  • Approving sub-PRs
  • Splitting & merging sub-PRs separately
  • Adding reviewers and assignees to the PR
  • Viewing checks and CI/CD
  • Attaching images and media to comments

If you would benefit from any of these features, feel free to open an issue and/or contribute

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Add tests if applicable
  5. Submit a pull request

License

This project is licensed under the MIT License. See the LICENSE file for details.

Support

Acknowledgments

  • Anthropic for Claude AI capabilities
  • SuperTokens for authentication infrastructure
  • GitHub for API and integration support
  • Open Source Community for various libraries and tools

About

AI Code Review Workspace

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •