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

CommandDescription
Auth & Projects
loginSign in with email and password
logoutClear stored credentials
versionPrint the CLI version
projects listList all projects
projects create <name>Create a new project
projects delete <id>Delete a project (requires --confirm)
switch <slug>Set active project
statusShow usage and plan info
Database
db tablesList 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 dumpExport schema as text
Schema Migrations
migrations new <name>Create the next numbered migration file in ./migrations
migrations upApply pending migrations to the active project (idempotent)
migrations statusLocal files vs applied versions
Keys & Config
keys showDisplay API keys
keys regenerateRotate API keys
initGenerate .env, CLAUDE.md, .cursorrules
Logs
logsShow recent request logs
logs --tailStream logs in real time
Vault
vault listList 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 listList 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 listList scheduled jobs
cron logs <id>Show run history
functions listList RPC functions (Postgres)
functions create <name>Create from file
functions delete <name>Drop function
Storage
storage lsList 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 reportGenerate the DPA / sub-processor report
compliance sub-processorsList 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.