Self-hosted operator toolkit for WritBase — agent-first task management.
npx writbase init # Interactive setup
npx writbase migrate # Apply database schema
npx writbase key create # Create your first agent key
npx writbase status # Verify everything works- Node.js 18+
- Supabase CLI — Install guide
- A Supabase project (hosted or local)
Interactive setup wizard. Detects local Supabase instances, validates credentials, and writes a .env file.
Handles three scenarios:
- Hosted Supabase — prompts for URL, service role key, and database URL
- Local Supabase — auto-detects credentials via
supabase status - No project yet — offers to run
supabase init+supabase start
Applies all WritBase database migrations using supabase migration up.
writbase migrate # Apply migrations
writbase migrate --dry-run # Preview without applyingBundles migrations from the WritBase repo and runs them against your database via a temporary project structure. No files are created in your working directory.
Interactive agent key creation. Prompts for name, role (worker/manager), and optional project/department scoping.
writbase key create
# Key name: my-agent
# Role: worker
# ✓ Agent key created
# ⚠ Save this key now — it cannot be retrieved later:
# wb_<uuid>_<secret>List all agent keys in the workspace.
writbase key listGenerate a new secret for an existing key. The old secret stops working immediately.
writbase key rotate my-agentDeactivate a key. Supports lookup by name or ID prefix.
writbase key deactivate my-agentHealth check — validates connection and shows resource counts.
writbase status
# ✓ Connected to Supabase
# ℹ Workspace: <uuid>
#
# Resource │ Count
# ────────────┼───────
# Agent Keys │ 3
# Tasks │ 42
# Projects │ 2WritBase CLI reads from .env in the current directory:
| Variable | Description |
|---|---|
SUPABASE_URL |
Your Supabase project URL |
SUPABASE_SERVICE_ROLE_KEY |
Service role key (full admin access) |
DATABASE_URL |
Direct Postgres connection string |
WRITBASE_WORKSPACE_ID |
UUID of the workspace to operate on |
Some migrations reference pg_cron which isn't available locally. These are conditional and will be skipped — the notice is expected.
In the Supabase dashboard: Settings → Database → Connection string → URI. If the password contains special characters, it must be percent-encoded.
If writbase migrate fails, ensure:
- The Supabase CLI is installed and up to date
DATABASE_URLis correct and the database is accessible- Run with
--dry-runfirst to preview changes