# Repoburg

Repoburg is a local-first AI assistant that gives you full control over your development workflow. Keep your code private, customize your workflow, and supercharge your development, all running on your own machine.

## Features

-   **🔒 Private by Default:** Your code and project context never leave your machine. Only LLM prompts are sent out.
-   **⚙️ You're in Control:** Review every AI-generated change. Choose between a "Review First" workflow or an "Apply & Revert" workflow for rapid iteration.
-   **🔧 Fully Customizable:** Tailor system prompts and context templates to perfectly match your project's coding style and standards. Use custom snippets to streamline template creation.
-   **🚀 Local Platform:** Runs as a local daemon, managing separate backend instances for each of your projects, ensuring clean separation and easy management via a dedicated CLI.
-   **⚡️ Integrated LLM Flow:** Connect directly to LLM providers (OpenRouter, Z.AI, Alibaba Cloud, Ollama, or OpenAI-compatible APIs), removing the need to manually copy and paste prompts.

## The Repoburg Platform

Repoburg consists of a few key components that work together:

-   **`repoburg` CLI:** The main tool you'll use to manage the platform. Start backends for your projects, check their status, view logs, and manage your authentication.
-   **Platform Daemon (`repoburg-daemon`):** A background service that manages and runs `repoburg-backend` instances for each of your projects.
-   **`repoburg-backend`:** The NestJS server that contains the core logic for AI interaction, file system operations, and more. One instance runs per project.
-   **Frontend Application:** The web-based UI where you interact with your sessions, review AI-generated plans, and manage templates. Hosted at [app.repoburg.com](https://app.repoburg.com).
-   **Website:** The main website for documentation and account authentication, hosted at [repoburg.com](https://repoburg.com).

## Getting Started

### Prerequisites

-   Node.js (v23.0.0 or higher)
-   npm

### Installation

Install the `repoburg` CLI tool globally using npm:
```bash
npm install -g repoburg
```

### Usage

1.  **Start the Daemon:**
    The daemon is the background service that manages everything. You need to start it once in a separate terminal.
    ```bash
    repoburg-daemon
    ```
    (For production, you'd set this up to run as a system service, e.g., with `launchd` or `systemd`).

2.  **Start a Repoburg Backend for your project:**
    Navigate to the project directory you want to work on and run:
    ```bash
    repoburg start .
    ```
    This command will:
    -   Authenticate you via the website (`repoburg.com`) if it's your first time.
    -   Start a dedicated `repoburg-backend` instance for your project.
    -   Open the frontend application in your browser, connected to the correct backend.

3.  **Configure an LLM Provider (Optional):**
    By default, Repoburg uses a "Manual LLM" flow. To enable direct LLM integration:
    -   Go to **Settings** in the frontend UI.
    -   Turn **off** the "Manual LLM" toggle.
    -   Configure your preferred provider (OpenRouter, Z.AI, Alibaba Cloud, Ollama, or OpenAI-compatible) with an API key in Settings.

4.  **Manage Services:**
    You can list, stop, and view logs for all running backends using the CLI.
    ```bash
    repoburg list   # List all managed project backends
    repoburg logs <project-name>
    repoburg stop <project-name>
    repoburg remove <project-name>
    ```

## Development

To run the full stack in development mode from a cloned repository:

1.  **Clone and Install:**
    ```bash
    git clone https://github.com/celalertug/repoburg.git
    cd repoburg
    npm install
    ```
2.  **Build all projects:**
    ```bash
    npm run build
    ```
3.  **Link the CLI:**
    This step makes the `repoburg` command available globally on your system, pointing to your local source code.
    ```bash
    npm link
    ```
4.  **Run Development Servers:**
    -   **Terminal 1: Start the Daemon**
        ```bash
        npm run dev:daemon
        ```
    -   **Terminal 2: Start the Website (for auth)**
        ```bash
        npm run dev:website
        ```
    -   **Terminal 3: Start the Frontend UI**
        ```bash
        npm run dev:frontend
        ```
    -   **Terminal 4: Start a project backend**
        From the directory of the project you want to work on:
        ```bash
        repoburg start .
        ```
        *Note: When running in development, `repoburg start` will use the development build of the backend and automatically connect to your dev frontend.*