Skip to content

yashdev9274/supercli

Repository files navigation

Supercode

AI-Powered SWE Agent

A monorepo containing the Supercode dashboard, documentation, terminal web client, CLI coding agent, and shared packages.

Website Built with Bun Turborepo TypeScript Next.js License

Supercode Platform

Star History

Star History Chart

Overview

Supercode is a full-stack AI-powered development platform built as a Bun + Turborepo monorepo. It includes a web dashboard, an MDX documentation site, an AI coding agent CLI, a terminal-style web client, and a parallel project for fine-tuning open-source LLMs.

  • Dashboard (apps/web) β€” Next.js dashboard for managing repositories, viewing analytics, and GitHub OAuth
  • Documentation (apps/docs) β€” MDX-based documentation site
  • Terminal Web Client (apps/supercode-cli/client) β€” Browser UI that mirrors the CLI experience
  • Supercode CLI (apps/supercode-cli/server) β€” AI-powered coding agent published to npm as supercode
  • API Server (apps/api) β€” Scaffolding for a shared backend
  • Open Model (supercode-openmodel/) β€” Fine-tuning open-source LLMs (Qwen3, GLM-4) for coding tasks

Architecture

This is a monorepo managed with Turborepo and Bun workspaces. Workspaces are defined in package.json as apps/*, apps/supercode-cli/*, and packages/*.

Applications

App Description Port
apps/web Next.js 16 dashboard (supercli.com) 3000
apps/docs Next.js MDX documentation site 3001
apps/supercode-cli/client Terminal web client UI (Next.js) 3002
apps/supercode-cli/server AI coding agent β€” also published as the supercode npm CLI β€”
apps/api Shared API server (scaffolded) TBD

Packages

Package Description
@super/db Prisma client + schema for the dashboard database
@super/auth Better-Auth configuration (server + client)
@super/ui Shared UI components
@super/sdk Internal SDK
@super/config Shared configuration (ESLint, TS, etc.)
@super/dashboard Dashboard-specific component library
@super/db-terminal Prisma client + schema for the terminal CLI's separate database
@super/claude-sdk Claude / Anthropic AI SDK wrapper
@super/embeddings-sdk Embeddings provider SDK (Gemini, etc.)
@super/skills Reusable AI agent skills shared across apps

Terminal Stack πŸ–₯️

The apps/supercode-cli workspace contains two sub-apps that together form the Supercode terminal product:

apps/supercode-cli/
β”œβ”€β”€ client/   # Next.js 16 web client β€” terminal.supercli.com
└── server/   # Bun-powered AI coding agent, exposed as the `supercode` CLI
  • Client is a Next.js app that mirrors the terminal experience in the browser, intended to be deployed to terminal.supercli.com.
  • Server is a real installable CLI (supercode on npm) built with Bun and the AI SDK. It supports multiple model providers (OpenRouter, Anthropic, Google) and ships with a tool system (file read/write, command execution, search, etc.).

Run the CLI locally with:

bun run supercode              # dev (from root)
bun run dev:terminal           # run the web client
bun run dev:terminal-server    # run the CLI dev loop

Supercode Open Model 🧠

We're building a coding-focused LLM by fine-tuning open-source models for the Supercode CLI. This project runs in parallel with the main platform.

Goal

Fine-tune open models to create an AI assistant specialized in:

  • Code generation and completion
  • Debugging and error fixing
  • Code explanation and documentation
  • Multi-language programming support

Training Strategy

We're using a dual-track approach to train two models simultaneously:

Track Infrastructure Model Method Estimated Cost
Track 1 Tinker (Managed) Qwen3-8B LoRA $150 free credits
Track 2 Modal + Axolotl GLM-4-9B LoRA/QLoRA ~$15-20

Project Structure

supercode-openmodel/
β”œβ”€β”€ training/
β”‚   β”œβ”€β”€ data/                    # Dataset preparation scripts
β”‚   β”œβ”€β”€ tinker_qwen3/            # Tinker + Qwen3 training code
β”‚   └── evaluation/              # Model evaluation scripts
β”œβ”€β”€ models/                      # Model checkpoints
β”œβ”€β”€ config/                      # Training configurations
└── pyrightconfig.json

Training Datasets

We use high-quality coding datasets:

Dataset Size Purpose
CodeAlpaca 20K Instruction tuning
OpenCodeReasoning 100K+ Reasoning + coding
CodeFeedback 156K Instruction-response

Quick Start

  1. Set up Tinker (Track 1)

    pip install tinker
    export TINKER_API_KEY="your-key"
    cd supercode-openmodel/training/tinker_qwen3
    python train.py
  2. Set up Modal (Track 2)

    pip install modal
    modal token new
    # Configure HuggingFace token in Modal secrets
    modal run --detach src.train --config=config/glm4.yml

Current Status

🚧 In Progress β€” Actively training and evaluating models. The best-performing model will be deployed to the Supercode CLI.


Tech Stack

Framework & Runtime

  • Next.js 16 β€” React framework with App Router
  • React 19 β€” UI library
  • TypeScript 5 β€” Type safety
  • Bun 1.2+ β€” JavaScript runtime & package manager

Monorepo

  • Turborepo 2 β€” Build system for monorepos

Database & ORM

  • PostgreSQL β€” Primary database
  • Prisma 7 β€” Database ORM (separate schemas for db and db-terminal)
  • Pinecone β€” Vector database

Authentication

  • Better Auth β€” Authentication system
  • GitHub OAuth β€” Social login

Background Jobs

  • Inngest β€” Event-driven background jobs in apps/web

UI & Styling

  • Tailwind CSS v4 β€” Utility-first CSS
  • Radix UI + Base UI β€” Component primitives
  • Framer Motion β€” Animations
  • Lucide Icons β€” Icon library
  • shadcn/ui β€” Component scaffolding for supercode-cli/client

State & Data

  • TanStack Query β€” Server state management
  • React Hook Form β€” Form handling
  • Zod β€” Schema validation

AI & ML

  • AI SDK v6 β€” Unified AI provider interface
  • OpenRouter β€” Multi-model routing
  • Anthropic Claude β€” Default model
  • Google Gemini β€” Embeddings
  • Vercel Minimax AI Provider β€” Additional model provider

CLI

  • Commander β€” CLI argument parsing
  • Clack + Boxen + Chalk β€” Terminal UI primitives
  • Marked + marked-terminal β€” Markdown rendering in terminal

Getting Started

Prerequisites

Installation

  1. Clone the repository

    git clone https://github.com/yashdev9274/supercli.git
    cd supercli
  2. Install dependencies (this also runs db:generate via postinstall)

    bun install
  3. Set up environment variables

    cp .env.example .env

    Edit .env with your configuration. At minimum, the dashboard requires:

    DATABASE_URL="postgresql://..."
    BETTER_AUTH_SECRET="your-secret-key"
    BETTER_AUTH_URL="http://localhost:3000"
    GITHUB_CLIENT_ID="your-github-oauth-id"
    GITHUB_CLIENT_SECRET="your-github-oauth-secret"
  4. Set up the database

    cd packages/db
    bun run db:generate
    bunx prisma migrate dev
    cd ../..
  5. Start development servers

    # Start everything
    bun run dev
    
    # Or start specific apps
    bun run dev:web              # Dashboard on http://localhost:3000
    bun run dev:docs             # Docs on http://localhost:3001
    bun run dev:terminal         # Terminal web client
    bun run dev:terminal-server  # CLI agent dev loop

bun run dev:api # API server


6. **Open your browser**
- Dashboard: [http://localhost:3000](http://localhost:3000)
- Documentation: [http://localhost:3001](http://localhost:3001)

### GitHub OAuth Setup

1. Go to [GitHub Developer Settings](https://github.com/settings/developers)
2. Create a new OAuth App
3. Set Authorization callback URL: `http://localhost:3000/api/auth/callback/github` (for local development). In production, use your deployed domain, e.g., `https://your-app.com/api/auth/callback/github`.
4. Copy Client ID and Client Secret to your `.env` file

## Project Structure

supercli/ β”œβ”€β”€ apps/ β”‚ β”œβ”€β”€ web/ # Dashboard β†’ supercli.com β”‚ β”‚ β”œβ”€β”€ app/ # Next.js App Router pages β”‚ β”‚ β”œβ”€β”€ components/ # React components β”‚ β”‚ β”œβ”€β”€ hooks/ # Custom React hooks β”‚ β”‚ β”œβ”€β”€ lib/ # Utility libraries β”‚ β”‚ β”œβ”€β”€ modules/ # Feature modules β”‚ β”‚ β”œβ”€β”€ inngest/ # Background job functions β”‚ β”‚ └── public/ # Static assets (og-image, etc.) β”‚ β”‚ β”‚ β”œβ”€β”€ docs/ # MDX documentation site β”‚ β”‚ β”œβ”€β”€ app/ # App router pages β”‚ β”‚ β”œβ”€β”€ components/ β”‚ β”‚ β”œβ”€β”€ content/ # MDX documentation files β”‚ β”‚ └── lib/ β”‚ β”‚ β”‚ β”œβ”€β”€ supercode-cli/ β”‚ β”‚ β”œβ”€β”€ client/ # Next.js terminal web UI β†’ terminal.supercli.com β”‚ β”‚ β”‚ β”œβ”€β”€ app/ β”‚ β”‚ β”‚ β”œβ”€β”€ components/ β”‚ β”‚ β”‚ └── lib/ β”‚ β”‚ └── server/ # Bun CLI agent (published as supercode on npm) β”‚ β”‚ β”œβ”€β”€ src/ β”‚ β”‚ β”‚ β”œβ”€β”€ cli/ # CLI commands + chat loop β”‚ β”‚ β”‚ β”œβ”€β”€ service/ # AI provider service layer β”‚ β”‚ β”‚ β”œβ”€β”€ tools/ # Tool implementations β”‚ β”‚ β”‚ β”œβ”€β”€ lib/ # Shared libraries β”‚ β”‚ β”‚ β”œβ”€β”€ config/ # Config + env handling β”‚ β”‚ β”‚ └── types/ β”‚ β”‚ └── prisma/ # Terminal DB schema (uses @super/db-terminal) β”‚ β”‚ β”‚ β”œβ”€β”€ api/ # Shared API server (scaffolded) β”‚ β”œβ”€β”€ packages/ β”‚ β”œβ”€β”€ db/ # Prisma client for dashboard DB β”‚ β”‚ └── prisma/schema.prisma β”‚ β”‚ β”‚ β”œβ”€β”€ db-terminal/ # Prisma client for terminal DB (separate schema) β”‚ β”‚ └── prisma/schema.prisma β”‚ β”‚ β”‚ β”œβ”€β”€ auth/ # Better-Auth config β”‚ β”‚ └── src/ β”‚ β”‚ β”œβ”€β”€ server.ts β”‚ β”‚ └── client.ts β”‚ β”‚ β”‚ β”œβ”€β”€ claude-sdk/ # Claude / Anthropic provider wrapper β”‚ β”œβ”€β”€ embeddings-sdk/ # Embeddings provider wrapper β”‚ β”œβ”€β”€ skills/ # Shared AI agent skills β”‚ β”œβ”€β”€ ui/ # Shared UI components β”‚ β”œβ”€β”€ sdk/ # Internal SDK β”‚ β”œβ”€β”€ config/ # Shared ESLint/TS config β”‚ └── dashboard/ # Dashboard-specific components β”‚ β”œβ”€β”€ supercode-openmodel/ # LLM fine-tuning project β”‚ β”œβ”€β”€ training/ β”‚ β”‚ β”œβ”€β”€ data/ β”‚ β”‚ β”œβ”€β”€ tinker_qwen3/ β”‚ β”‚ └── evaluation/ β”‚ β”œβ”€β”€ models/ # Checkpoints β”‚ └── config/ β”‚ β”œβ”€β”€ scripts/ # Repo-level scripts β”œβ”€β”€ turbo.json # Turborepo config β”œβ”€β”€ package.json # Root package (workspaces, scripts) β”œβ”€β”€ bun.lock # Bun lockfile β”œβ”€β”€ .env.example # Environment template β”œβ”€β”€ CONTRIBUTING.md # Contribution guide └── README.md # This file


## Available Scripts

Run from the **repo root** unless otherwise noted.

### Development

| Script | What it does |
|--------|--------------|
| `bun run dev` | Start all dev servers (Turborepo) |
| `bun run dev:web` | Dashboard only (port 3000) |
| `bun run dev:docs` | Docs only (port 3001) |
| `bun run dev:terminal` | Terminal web client only |
| `bun run dev:terminal-server` | CLI agent dev loop |
| `bun run dev:api` | API server only |
| `bun run dev:video` | Remotion studio |
| `bun run supercode` | Run the published CLI in dev mode |
| `bun run supercode:prod` | Run the built CLI from `dist/` |

### Build & Quality

| Script | What it does |
|--------|--------------|
| `bun run build` | Build all apps and packages |
| `bun run lint` | Run ESLint across all packages |
| `bun run typecheck` | Run TypeScript checks |

### Database

From `packages/db/`:

```bash
bun run db:generate      # Clean and regenerate Prisma client
bun run db:migrate       # Deploy migrations to the configured DB
bunx prisma studio       # Open Prisma Studio
bunx prisma migrate dev --name migration_name  # Create a new migration

The terminal CLI has its own database and Prisma schema under packages/db-terminal/:

cd packages/db-terminal
bun run db:generate
bunx prisma migrate dev --name migration_name

Environment Variables

See .env.example for the full template. The variables below are documented for convenience.

Required (Dashboard)

Variable Description
DATABASE_URL PostgreSQL connection string
BETTER_AUTH_SECRET Session encryption secret (generate with openssl rand -base64 32)
BETTER_AUTH_URL Base URL of the dashboard (e.g., http://localhost:3000 for dev)
GITHUB_CLIENT_ID GitHub OAuth app client ID
GITHUB_CLIENT_SECRET GitHub OAuth app secret
NEXT_PUBLIC_BETTER_AUTH_URL Public auth URL exposed to the client
NEXT_PUBLIC_APP_BASE_URL Public base URL of the app (used for OAuth callbacks, absolute links)

Optional

Variable Description
GOOGLE_GEMINI_API_KEY Google Gemini (embeddings + text)
PINECONE_DB_API_KEY Pinecone vector database
HUGGING_FACE_TOKEN Hugging Face API token
TINKER_API_KEY Tinker API key for LLM fine-tuning
VERCEL_OIDC_TOKEN Auto-generated by Vercel CLI for deployment

Contributing

We welcome contributions! Please see the Contributing Guide for details on:

  • Development setup
  • Code style guidelines
  • Commit conventions
  • Pull request process

License

This project is licensed under the MIT License β€” see apps/supercode-cli/server/LICENSE for the published CLI's terms. Internal application code is currently private and proprietary to the Supercode team.


Built with ❀️ by the Supercode team!

About

The open source SWE agent

Resources

Contributing

Stars

Watchers

Forks

Packages

 
 
 

Contributors