Getting Started
This guide will walk you through installing the Kopi CLI and creating your first local database replica.
- ✅ Windows: Tested & Fully Supported (Windows 10/11)
- ✅ Linux: Tested & Fully Supported (Fedora)
- ⏳ macOS: Untested (Use at own risk)
Overview
Kopi is a .NET global tool that ends the pain of managing local databases. It reads the schema from a source database, spins up a new SQL Server Docker container, and replicates the full schema (tables, keys, indexes) in seconds.
It is designed to be a transparent, drop-in replacement for your production database:
- Exact Schema Match: It copies every table, view, stored procedure, and constraint.
- EF Core Friendly: Crucially, it copies the
__EFMigrationsHistorytable. Your local environment will know exactly which migrations have been applied. - Heuristic Data: It populates your tables with clean, anonymous, and referentially-intact data using smart pattern matching.
Enterprise Overview
Kopi Enterprise builds on the core engine to solve the complex data challenges faced by teams and organizations. While the Community Edition focuses on speed and structure, the Enterprise Edition focuses on content fidelity and compliance.
It transforms your local environment from a "random sandbox" into a "safe production mirror":
- High-Fidelity Anonymization ("Decaf Mode"): Safely mirror real production data. Kopi reads your source, automatically detects PII, and deterministically scrambles it.
- Deterministic Stability: Eliminate flaky tests. By setting a global seed, Kopi generates the exact same data byte-for-byte every time.
- Precision Control: Use Regex rules for strict formats and Passthrough tables for reference data.
Supported Databases
Kopi currently supports Microsoft SQL Server, PostgreSQL. Support for other major database engines is actively being developed.
| Feature | SQL Server | PostgreSQL | SQLite | MySQL |
|---|---|---|---|---|
| Schema Replication | ||||
| Tables & Keys | ✅ | ✅ | ⏳ | ️⏳ |
| Views & Procs | ✅ | ✅ | ⏳ | ⏳ |
| User-Defined Types | ✅ | ✅ | ⏳ | ⏳ |
| Data Generation | ||||
| Heuristic Data | ✅ | ✅ | ⏳ | ⏳ |
| Relational FKs | ✅ | ✅ | ⏳ | ⏳ |
| Pro/Enterprise Features | ||||
| Anonymization (Decaf) | ✅ | ✅️ | ⏳ | ⏳ |
| Regex Generation | ✅ | ⏳ | ⏳ | ⏳ |
| Passthrough Tables | ✅ | ⏳ | ⏳ | ⏳ |
| Deterministic Seeding | ✅ | ⏳ | ⏳ | ⏳ |
- ✅ Supported: Available now.
- ⏳ Planned: Available in the future.
Community Edition Installation
These instructions are for the free, open-source Community Edition of Kopi. Kopi is distributed as a .NET Global Tool.
You'll need the .NET SDK (8.0 or later) and Docker Desktop installed.
Install the Kopi CLI from NuGet:
To update to the latest version:
If running kopi gives an error, your .NET tools folder isn't in your PATH.
Pro/Enterprise Edition Installation
Kopi Pro/Enterprise is distributed via a secure, authenticated installer script. You do not need the .NET SDK installed.
In your dashboard, click to copy the script path.
Installs to: %LOCALAPPDATA%\Kopi
Installs to: $HOME/.kopi
Updating
To update, simply run the installation command again. It handles backing up your configuration and replacing the binary.
Licensing & Updates
Activation
On first run (kopi up), you will be prompted for your license key:
Quick Start
Follow these steps to spin up your first replica.
Step 1: Create kopi.json
Create a file named kopi.json in your project root. List your "seed" tables here.
The adminPassword is optional. Remove the line entirely to use the default.
Step 2: Spin Up
Or specify a config path:
__EFMigrationsHistory so EF won't re-apply old migrations.
Step 3: Connect
TrustServerCertificate=True is required for local Docker SQL Server.
Step 4: Tear Down
Commands Reference
Next Steps
You've successfully created your first replica!
Join the Community
Report bugs or request features on GitHub.
Pro/Enterprise Configuration
Extensions for Anonymization and Strict Pattern Generation.
1. Decaf Mode (Anonymization)
Run kopi up -decaf to switch to "High Fidelity" mode.
If Kopi does not recognize a column name (e.g. User_Bio_Text), it copies raw data. Use overrides to be safe.
Configuration (PII Shortcuts)
Supported Transformation Types
| Category | Type Keywords | Example Output |
|---|---|---|
| Person | name, firstname, lastname |
"John Doe" |
| Contact | email, phone |
"alice@example.com" |
| Financial | cc, iban |
"1234-5678-..." |
2. Passthrough Tables
Add tables to passthroughTables to skip scrambling entirely.
Do not use Passthrough for tables containing PII. This copies raw data.
3. Regex Generation
Full Configuration Reference
Below is a complete kopi.json file showing every available option.
Deterministic Seeding
Kopi Enterprise allows you to initialize the random number generator with a fixed seed.