20. CLI Tool
Alex wants to manage projects, run queries, and test RLS policies from the terminal.
The Eurobase CLI lets you manage your projects, database, storage, vault, and more from the command line. Install it via Homebrew or download the Go binary.
Installation
brew install stgime/tap/eurobase
# or download a binary: github.com/STGime/homebrew-tap/releases
# macOS manual download only: xattr -d com.apple.quarantine ./eurobase (not notarized; brew installs unaffected)
Getting started
# Log in to your account
eurobase login
# List your projects
eurobase projects list
# Set the active project
eurobase switch my-project
# See project status and usage
eurobase status
Command reference
| Command | Description |
|---|---|
| Auth & Projects | |
| login | Sign in with email and password |
| logout | Clear stored credentials |
| version | Print the CLI version |
| projects list | List all projects |
| projects create <name> | Create a new project |
| projects delete <id> | Delete a project (requires --confirm) |
| switch <slug> | Set active project |
| status | Show usage and plan info |
| Database | |
| db tables | List tables (excludes system tables) |
| db schema [table] | Show columns and types |
| db query "SQL" | Execute SQL and print results |
| db create-table <name> <col:type>... | Create a table with RLS preset |
| db add-column <table> <col:type> | Add a column |
| db drop-column <table> <column> | Drop a column |
| db drop-table <name> | Drop a table |
| db dump | Export schema as text |
| Schema Migrations | |
| migrations new <name> | Create the next numbered migration file in ./migrations |
| migrations up | Apply pending migrations to the active project (idempotent) |
| migrations status | Local files vs applied versions |
| Keys & Config | |
| keys show | Display API keys |
| keys regenerate | Rotate API keys |
| init | Generate .env, CLAUDE.md, .cursorrules |
| Logs | |
| logs | Show recent request logs |
| logs --tail | Stream logs in real time |
| Vault | |
| vault list | List secret names |
| vault get <name> | Get decrypted value |
| vault set <name> <value> | Store a secret |
| vault delete <name> | Delete a secret |
| Edge Functions (serverless TypeScript/JavaScript) | |
| edge-functions list | List deployed edge functions |
| edge-functions deploy <name> | Deploy from functions/<name>.ts (or --file); --no-verify-jwt for public functions |
| edge-functions get <name> | Show details and source code |
| edge-functions invoke <name> | Invoke with optional --data JSON body |
| edge-functions logs <name> | View invocation logs |
| edge-functions delete <name> | Delete an edge function |
| Cron & RPC Functions | |
| cron list | List scheduled jobs |
| cron logs <id> | Show run history |
| functions list | List RPC functions (Postgres) |
| functions create <name> | Create from file |
| functions delete <name> | Drop function |
| Storage | |
| storage ls | List files |
| storage upload <local> <key> | Upload a file |
| storage download <key> <local> | Download a file |
| storage delete <key> | Delete a file |
| storage url <key> | Generate signed URL |
| Testing & Compliance | |
| test [file-or-dir] | Run pgTAP database tests |
| compliance report | Generate the DPA / sub-processor report |
| compliance sub-processors | List active sub-processors |
Testing RLS policies with pgTAP
Create SQL test files in a tests/ directory. Each file uses pgTAP assertions to verify your RLS policies work correctly.
-- tests/rls_tasks.sql
BEGIN;
SELECT plan(3);
-- Test as Alice
SET LOCAL app.end_user_id = 'alice-uuid';
SELECT ok(
(SELECT count(*) FROM tasks WHERE user_id = 'alice-uuid') > 0,
'Alice can see her own tasks'
);
SELECT ok(
(SELECT count(*) FROM tasks WHERE user_id = 'bob-uuid') = 0,
'Alice cannot see Bob tasks'
);
-- Test as anonymous
SET LOCAL app.end_user_id = '';
SELECT ok(
(SELECT count(*) FROM tasks) = 0,
'Anonymous cannot see any tasks'
);
SELECT * FROM finish();
ROLLBACK;# Run all tests
eurobase test
# Run a specific test file
eurobase test tests/rls_tasks.sql
Tip: Tests run inside a transaction that is rolled back — no data is modified. Use SET LOCAL app.end_user_id to simulate different users and verify RLS policies enforce correct access.