Development Guide
Learn how to set up a development environment and contribute to Keyflare.Prerequisites
Install pnpm:
Getting Started
pnpm run setup runs pnpm install twice with a CLI build in between. This is necessary because pnpm links workspace bins during install — before any build scripts run — so dist/index.js must exist for the kfl bin to be linked correctly.
Running the CLI During Development
Project Structure
Local Development
The fastest way to get a local Keyflare instance running:Manual Local Setup
Alternative topnpm run dev:init:
Database Migrations
The schema is defined inpackages/server/src/db/schema.ts. Never edit migration SQL files by hand — always use drizzle-kit.
Drizzle Studio
Browser-based GUI to inspect and edit the database.Local
Remote (Production)
Building
Type Checking
wrangler.jsonc:
Linting
typescript/no-floating-promises rule enabled.
Debugging
label, scopes, key_encrypted, and value_encrypted columns contain AES-256-GCM ciphertext — unreadable without MASTER_KEY.Next Steps
Testing
Learn about the test suite and how to write tests.
Architecture
Understand how Keyflare works.
