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-cliAuthentication
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.comCredentials 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 logoutProject Setup
basefyio init
Create a new project and link the current directory.
basefyio init
# Interactive — prompts for name, team, etc.
basefyio init --name my-appbasefyio link
Link current directory to an existing project.
basefyio link --project-id <uuid>basefyio unlink
Remove project link from current directory.
basefyio unlinkbasefyio status
Show project info, credentials, and connection strings.
basefyio status
# Show API keys (masked by default)
basefyio status --show-keysProject Management
basefyio projects
List all projects in your active team.
basefyio projects
# or
basefyio listbasefyio 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 pushbasefyio db pull
Introspect the remote database and save schema locally.
basefyio db pullbasefyio db reset
Drop all tables in the project database.
basefyio db reset
# Skips confirmation
basefyio db reset --forcebasefyio db seed
Run a seed file against the database.
basefyio db seedbasefyio db dump
Export database schema as SQL.
basefyio db dump
basefyio db dump --output schema.sqlbasefyio db diff
Show differences between local Prisma schema and remote database.
basefyio db diffbasefyio 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 usersMigrations
basefyio migration new
Create a new migration file.
basefyio migration new add_orders_tablebasefyio 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-runbasefyio migration down
Rollback migrations.
basefyio migration down
basefyio migration down --step 2
basefyio migration down --dry-runbasefyio migration status
Show applied and pending migrations.
basefyio migration statusCode Generation
basefyio gen types
Generate TypeScript type definitions from your database schema.
basefyio gen types
basefyio gen types --output src/types/database.tsbasefyio gen client
Generate a typed API client.
basefyio gen client
basefyio gen client --lang typescript --output src/lib/client.tsUtilities
basefyio logs
View SQL audit logs.
basefyio logs
basefyio logs --tail 50basefyio secrets
Manage project environment variables.
# List (values are masked)
basefyio secrets list
# Set
basefyio secrets set DATABASE_URL "database://..."
# Remove
basefyio secrets unset DATABASE_URLConfiguration
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"
}