Skip to main content
wit isn’t just a Git client—it’s a complete, self-hosted code collaboration platform that can replace GitHub for teams who want full control over their infrastructure.

What’s Included

Architecture

┌─────────────────────────────────────────────────────────────────┐
│                         wit Platform                             │
├─────────────────────────────────────────────────────────────────┤
│  Web App (React)          │  API Server (Hono)                  │
│  - Repository browser     │  - tRPC API                         │
│  - Pull requests UI       │  - Git Smart HTTP                   │
│  - Issues UI              │  - WebSocket (realtime)             │
├───────────────────────────┼─────────────────────────────────────┤
│  CLI (wit)                │  Core Libraries                     │
│  - Local git ops          │  - @wit/core (git impl)             │
│  - Remote sync            │  - @wit/ai (mastra)                 │
│  - PR/Issue commands      │  - @wit/protocol (smart http)       │
├───────────────────────────┴─────────────────────────────────────┤
│                         Storage Layer                            │
│  - Object Store (filesystem)  - Database (PostgreSQL)           │
└─────────────────────────────────────────────────────────────────┘

Quick Start

1. Start the Server

# Start wit server on port 3000
wit serve --port 3000 --repos ./my-repos

2. Push a Repository

# In your project directory
wit init
wit add .
wit commit -m "Initial commit"
wit remote add origin http://localhost:3000/myuser/myproject.git
wit push -u origin main

3. Collaborate

# Create a pull request
wit pr create -t "Add new feature" -b main

# List pull requests
wit pr list

# Create an issue
wit issue create "Bug: Login button not working"

Database Setup

For full functionality (users, PRs, issues), wit uses PostgreSQL:
# Set database URL
export DATABASE_URL="postgresql://user:pass@localhost:5432/wit"

# Start server with database
wit serve --port 3000 --repos ./repos
Without a database, wit still works for basic push/pull operations.

Tech Stack

ComponentTechnology
ServerNode.js, Hono
DatabasePostgreSQL, Drizzle ORM
APItRPC (type-safe)
AuthOAuth, JWT sessions
StorageFilesystem (Git objects)

Self-Hosting Options

Docker

# Clone the repo
git clone https://github.com/abhiaiyer91/wit.git
cd wit

# Start with Docker Compose
docker-compose up -d

Manual Installation

# Clone and build
git clone https://github.com/abhiaiyer91/wit.git
cd wit
npm install
npm run build

# Set up database
export DATABASE_URL="postgresql://..."
npm run db:push

# Start server
wit serve --port 3000 --repos ./repos

Environment Variables

VariableDescriptionDefault
DATABASE_URLPostgreSQL connection string-
PORTServer port3000
REPOS_DIRRepository storage directory./repos
JWT_SECRETSecret for JWT tokens(generated)

API Access

The platform exposes a tRPC API for building integrations:
import { createTRPCClient } from '@trpc/client';
import type { AppRouter } from 'wit/api';

const client = createTRPCClient<AppRouter>({
  url: 'http://localhost:3000/trpc',
});

// List repositories
const repos = await client.repos.list.query({ owner: 'myuser' });

// Create a pull request
const pr = await client.pulls.create.mutate({
  owner: 'myuser',
  repo: 'myproject',
  title: 'Add feature',
  sourceBranch: 'feature',
  targetBranch: 'main',
});

Next Steps