Skip to content

Latest commit

Β 

History

41 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Cabin β€” The workspace for code reviewers

Cabin Banner

Cabin is a local-first development workspace and workflow orchestration platform for open-source maintainers and code reviewers.

It is not "yet another AI PR reviewer." It is the operating system for code review.


πŸ’‘ The Philosophy: Workflow Orchestration > AI Reviewers

The market for AI code reviewers is heavily commoditized. Modern developers already have GitHub Copilot, Claude Code, Cursor, Antigravity, and Gemini CLI embedded directly into their editors.

The real bottleneck for code maintainers is not the review intelligence itselfβ€”it's the workflow orchestration and context gathering.

The Problem

Before a maintainer can even begin assessing code, they must manually coordinate a multi-step context collection ritual:

  1. Open GitHub and navigate notifications.
  2. Read the issue and the surrounding discussion.
  3. Understand previous review comments.
  4. Verify CI status, test results, and merge conflicts.
  5. Fetch the branch locally to run test suites or manually inspect suspicious code blocks.
  6. Run local scripts, linters, or AI tools.

Currently, 90% of a maintainer's time is spent gathering context, and only 10% is spent applying human judgment.

The Solution: Cabin

Cabin reverses this ratio. It treats GitHub as a database and provides a dedicated, high-performance local workspace where the entire pipeline is automated in the background.

[ GitHub Event ] ──> [ Cabin Local Engine ] ──> [ Gathers Context, Runs Git, Spawns AI ] ──> [ Decision Dashboard ] ──> [ One-Click Approve ]

When a notification arrives, Cabin has already prepared the context in 10 seconds:

  • CI & Checks: CI passed, DCO signed, no merge conflicts.
  • Aggregated History: "Contributor addressed accessibility requests and inline styles."
  • Local Run Results: AI analysis generated, code rules verified.
  • Pre-Drafted Comments: Smart suggestions ready to post.

You read, decide, and click.


πŸ—οΈ Architecture: Local-First Desktop App

Cabin is designed as a clean monorepo desktop application utilizing Electron to bridge the high-privilege operations of your machine (filesystem, git, process spawning) with a rich React UI dashboard.

                    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                    β”‚       React UI (packages/ui)     β”‚
                    β”‚   Tailwind + Zustand + Motion    β”‚
                    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                      β”‚ Electron IPC (preload)
                    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                    β”‚      Electron Main Process       β”‚
                    β”‚      (apps/desktop/src)          β”‚
                    β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”˜
                           β”‚          β”‚          β”‚
         β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β” β”Œβ”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β” β”Œβ”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
         β”‚ Local Filesystem   β”‚ β”‚ SQLite DB  β”‚ β”‚ CLI Spawner        β”‚
         β”‚ (Repo Clones)      β”‚ β”‚ (Settings, β”‚ β”‚ (Spawn git, ag,   β”‚
         β”‚ ~/Cabin/repos/     β”‚ β”‚ Cache, etc)β”‚ β”‚ other local tools)β”‚
         β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Why Electron + React?

  • Zero Browser Sandboxing Limits: The browser cannot execute terminal commands or clone repositories. Electron's main process handles all high-privilege tasks.
  • Private and Secure: Your source code, credentials, and API tokens never leave your machine.
  • No Server Costs or Complex Deployments: Database operations use SQLite locally inside your home directory.
  • Flexible CLI Integration: Spawning the Antigravity CLI, git, or other linters uses Node.js child_process.spawn().

πŸ“¦ Package Workspace Structure

The project is managed as an npm workspace monorepo:

Dev/
β”œβ”€β”€ package.json                    # Root workspace manager and script launcher
β”œβ”€β”€ tsconfig.json                   # Shared TypeScript compiler options
β”œβ”€β”€ apps/
β”‚   └── desktop/                    # Electron Shell (main and preload processes)
└── packages/
    β”œβ”€β”€ ui/                         # React UI Frontend (Vite + Tailwind + Zustand + Router)
    β”œβ”€β”€ database/                   # SQLite controller (sqlite3 + sqlite promise wrapper)
    β”œβ”€β”€ github/                     # Octokit adapter for GitHub API reviews & comments
    β”œβ”€β”€ git/                        # simple-git wrapper for repository checkouts
    β”œβ”€β”€ workers/                    # Pipeline workers (Git, CI, DCO, Merge, Discussion, Context)
    β”œβ”€β”€ review-engine/              # Orchestrator running pipeline workers in series
    β”œβ”€β”€ providers/                  # AI Providers (Antigravity CLI command spawner)
    └── shared/                     # Zod schemas, models, and TypeScript types

πŸš€ How It Works

1. Unified Review Inbox

Instead of the noisy GitHub notification feed, Cabin provides a focused queue representing the state of every pending PR:

  • Ready for Review: CI passed, mergeable, AI checks complete.
  • Blocked / Attention Needed: CI failing, merge conflicts detected.
  • Awaiting Contributor: Feedback requested, waiting on fixes.

2. Git & Workspace Manager

When you click a PR in the dashboard, the local Git Engine performs the heavy lifting:

  • Clones the repository to ~/Cabin/repositories/ if it doesn't exist.
  • Automatically fetches the branch and checks out the PR commits.
  • Prepares the workspace for inspection or local testing.

3. Worker System

Every worker has one responsibility, returning structured JSON reports back to the orchestrator:

  • CI Worker: Fetches GitHub combined statuses and check runs.
  • Merge Worker: Verifies branch mergeability and detects conflicts.
  • DCO Worker: Runs git log on the checkout and verifies DCO signatures.
  • Discussion Worker: Synthesizes issue and review comments into structured threads.
  • Repository Context Worker: Scans for README rules, contributing guides, and PR templates.

4. AI CLI Runner (The child_process Bridge)

Cabin connects directly to your local command-line tools. When a review is triggered, the Electron main process's aiService spawns the Antigravity CLI process:

// Spawns: ag review --pr 218
const process = spawn('ag', ['review', '--pr', prNumber], { cwd: repoPath });

Outputs are streamed to the React UI in real-time, giving you console progress updates.

5. Automated Chores & Comment Generator

Review findings are mapped to editable markdown templates. You can click a button, preview the generated comment (optionally humanized by an LLM), and post it directly to GitHub in a single action.


πŸ› οΈ Development Setup & How to Run

Prerequisites

  • Node.js: Version 18 or higher is required.
  • Git CLI: Installed and configured on your machine's path.
  • GitHub Personal Access Token (PAT): Set up with repo permissions to allow reading repositories, issues, PRs, and comments.

1. Initial Installation

Clone the repository, navigate to the directory, and install all workspace dependencies:

npm install

2. Compile All Workspace Packages

Before running the application, you must build all local packages in the correct dependency order. We provide a helper command that does this automatically:

npm run build:all

Note

Since this is a monorepo, if you modify any code inside packages/* (e.g., @cabin/shared, @cabin/database), you must re-run npm run build:all (or build that specific package using npm run build -w packages/<package-name>) for those changes to propagate to the Electron main process or UI.


πŸš€ Running in Development Mode

To run Cabin in local development with hot-reloading for the frontend:

  1. Start the Frontend UI Dev Server (Terminal 1) This starts the Vite development server for the React UI:

    npm run dev:ui

    The UI will now be serving and hot-reloading on http://localhost:5173.

  2. Launch the Electron App (Terminal 2) This compiles the Electron main process code and launches the Electron application shell:

    npm run dev:desktop
    • Electron automatically detects development mode and loads the UI from http://localhost:5173.
    • The Chromium developer tools will automatically open side-by-side with the dashboard for easy debugging.

πŸ”§ Troubleshooting Common Development Issues

1. Changes in packages/ are not appearing

  • Cause: You edited a file under packages/database, packages/shared, etc., but did not recompile the TypeScript output.
  • Fix: Run npm run build:all to compile all packages, or compile the specific package you edited:
    npm run build -w packages/<package-name>

2. Port 5173 is already in use

  • Cause: Another Vite process is running.
  • Fix: Find and kill the process using port 5173, or let Vite assign a different port. Note that if Vite uses a different port (e.g. 5174), you may need to update the load URL in apps/desktop/src/main.ts (around line 59) to match:
    mainWindow.loadURL('http://localhost:5174');

3. Database lock or migration issues

  • Cause: Schema changes mismatch with local database.
  • Fix: Delete or rename the local database file at ~/Cabin/settings/cabin.db to let the app recreate it on the next launch. Alternatively, ensure database schema additions implement try/catch ALTER TABLE wrappers in CabinDatabase.initialize.

4. GitHub API authentication issues

  • Cause: Missing or invalid Personal Access Token (PAT).
  • Fix: Ensure your GitHub PAT has the repo scope. Enter this token in the Settings screen of the Cabin dashboard.

About

Your workspace for managing code reviews. Cabin is a dashboard that brings all your review requests into one place, runs automated checks (DCO, CI, security scans, AI analysis), surfaces what needs your attention, and lets you approve or comment with a single click. GitHub stays your repository. Cabin is where you actually work.

Resources

Contributing

Stars

1 star

Watchers

0 watching

Forks

Releases

Sponsor this project

Contributors

Languages