CLI Reference

The basefyio CLI lets you manage projects, push schemas, run migrations, generate types, and more — all from your terminal.

Installation

npm install -g basefyio-cli

Authentication

basefyio login

Log in to your basefyio account. The CLI opens your default browser, where you authenticate via auth service. After signing in you are shown a confirmation page — click Allow access to connect the CLI to your account, or Cancel to abort. The browser tab can be closed once the terminal confirms you are logged in.

basefyio login

# Custom API URL
basefyio login --api-url https://api.your-domain.com

Credentials are stored in ~/.basefyio/config.json. Run basefyio login again at any time to switch accounts.

basefyio logout

Sign out and clear saved credentials.

basefyio logout

Project Setup

basefyio init

Create a new project and link the current directory.

basefyio init
# Interactive — prompts for name, team, etc.

basefyio init --name my-app

basefyio link

Link current directory to an existing project.

basefyio link --project-id <uuid>

basefyio unlink

Remove project link from current directory.

basefyio unlink

basefyio status

Show project info, credentials, and connection strings.

basefyio status

# Show API keys (masked by default)
basefyio status --show-keys

Project Management

basefyio projects

List all projects in your active team.

basefyio projects
# or
basefyio list

basefyio projects:create

basefyio projects:create --name "My App" --description "Production app"

basefyio projects:delete

basefyio projects:delete <projectId>

Database

basefyio db push

Push a local schema to the remote database. Supports Prisma schema files and raw SQL. Shortcut: basefyio push.

# Push Prisma schema
basefyio db push

# Push SQL file
basefyio db push --file schema.sql

# Shortcut
basefyio push

basefyio db pull

Introspect the remote database and save schema locally.

basefyio db pull

basefyio db reset

Drop all tables in the project database.

basefyio db reset
# Skips confirmation
basefyio db reset --force

basefyio db seed

Run a seed file against the database.

basefyio db seed

basefyio db dump

Export database schema as SQL.

basefyio db dump
basefyio db dump --output schema.sql

basefyio db diff

Show differences between local Prisma schema and remote database.

basefyio db diff

basefyio db execute

Run arbitrary SQL.

# From file
basefyio db execute --file query.sql

# Inline
basefyio db execute --query "SELECT * FROM users LIMIT 5"

Inspect

basefyio inspect

Show tables with row counts and sizes.

# All tables
basefyio inspect

# Specific table
basefyio inspect --table users

Migrations

basefyio migration new

Create a new migration file.

basefyio migration new add_orders_table

basefyio migration up

Apply pending migrations.

# Apply all pending
basefyio migration up

# Apply one step
basefyio migration up --step 1

# Dry run (show SQL without executing)
basefyio migration up --dry-run

basefyio migration down

Rollback migrations.

basefyio migration down
basefyio migration down --step 2
basefyio migration down --dry-run

basefyio migration status

Show applied and pending migrations.

basefyio migration status

Code Generation

basefyio gen types

Generate TypeScript type definitions from your database schema.

basefyio gen types
basefyio gen types --output src/types/database.ts

basefyio gen client

Generate a typed API client.

basefyio gen client
basefyio gen client --lang typescript --output src/lib/client.ts

Utilities

basefyio logs

View SQL audit logs.

basefyio logs
basefyio logs --tail 50

basefyio secrets

Manage project environment variables.

# List (values are masked)
basefyio secrets list

# Set
basefyio secrets set DATABASE_URL "database://..."

# Remove
basefyio secrets unset DATABASE_URL

Configuration

The CLI stores configuration in .basefyio in your project directory and credentials in ~/.basefyio/config.json.

# .basefyio (project config)
{
  "projectId": "uuid",
  "apiUrl": "https://api.basefyio.com"
}