writbase
v0.3.0
Published
WritBase CLI — self-hosted operator toolkit for agent-first task management
Readme
WritBase CLI
Self-hosted operator toolkit for WritBase — agent-first task management.
Quick Start
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 worksPrerequisites
- Node.js 18+
- Supabase CLI — Install guide
- A Supabase project (hosted or local)
Commands
writbase init
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
writbase migrate
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.
writbase key create
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>writbase key list
List all agent keys in the workspace.
writbase key listwritbase key rotate <name-or-id>
Generate a new secret for an existing key. The old secret stops working immediately.
writbase key rotate my-agentwritbase key deactivate <name-or-id>
Deactivate a key. Supports lookup by name or ID prefix.
writbase key deactivate my-agentwritbase status
Health check — validates connection and shows resource counts.
writbase status
# ✓ Connected to Supabase
# ℹ Workspace: <uuid>
#
# Resource │ Count
# ────────────┼───────
# Agent Keys │ 3
# Tasks │ 42
# Projects │ 2Environment Variables
WritBase 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 |
Troubleshooting
pg_cron notice on local dev
Some migrations reference pg_cron which isn't available locally. These are conditional and will be skipped — the notice is expected.
Finding DATABASE_URL
In the Supabase dashboard: Settings → Database → Connection string → URI. If the password contains special characters, it must be percent-encoded.
Migration errors
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
