Skip to content

CLI Command Reference

This page documents all Fluxbase CLI commands, their subcommands, flags, and usage examples.

fluxbase [command] [subcommand] [flags]

These flags work with all commands:

FlagShortDescription
--configConfig file path (default: ~/.fluxbase/config.yaml)
--profile-pProfile to use
--output-oOutput format: table, json, yaml
--no-headersHide table headers
--quiet-qMinimal output
--debugEnable debug output

Authenticate with a Fluxbase server.

Terminal window
# Interactive login
fluxbase auth login
# Non-interactive with credentials
fluxbase auth login --server URL --email EMAIL --password PASSWORD
# With API token
fluxbase auth login --server URL --token TOKEN
# SSO login (opens browser)
fluxbase auth login --server URL --sso
# Save to named profile
fluxbase auth login --profile prod --server URL

Flags:

  • --server - Fluxbase server URL
  • --email - Email address
  • --password - Password
  • --token - API token (alternative to email/password)
  • --sso - Login via SSO (opens browser for OAuth/SAML authentication)
  • --profile - Profile name (default: “default”)
  • --use-keychain - Store credentials in system keychain

Note: When password login is disabled on the server, the CLI automatically detects this and initiates SSO login.

Clear stored credentials.

Terminal window
fluxbase auth logout
fluxbase auth logout --profile prod

Show authentication status for all profiles.

Terminal window
fluxbase auth status

Switch the active profile.

Terminal window
fluxbase auth switch prod

Display current user information.

Terminal window
fluxbase auth whoami

Manage edge functions.

Terminal window
fluxbase functions list
fluxbase functions list --namespace production
Terminal window
fluxbase functions get my-function
Terminal window
fluxbase functions create my-function --code ./function.ts
fluxbase functions create my-function --code ./function.ts --timeout 60 --memory 256

Flags:

  • --code - Path to function code file (required)
  • --description - Function description
  • --timeout - Execution timeout in seconds (default: 30)
  • --memory - Memory limit in MB (default: 128)
Terminal window
fluxbase functions update my-function --code ./function.ts
fluxbase functions update my-function --timeout 120
Terminal window
fluxbase functions delete my-function
Terminal window
fluxbase functions invoke my-function
fluxbase functions invoke my-function --data '{"key": "value"}'
fluxbase functions invoke my-function --file ./payload.json

View execution logs for a function.

Terminal window
fluxbase functions logs my-function
fluxbase functions logs my-function --tail 50
fluxbase functions logs my-function --follow

Flags:

  • --tail - Number of lines to show (default: 20)
  • --follow, -f - Stream new log entries in real-time

Sync all functions from a local directory to the server.

Terminal window
fluxbase functions sync --dir ./functions
fluxbase functions sync --dir ./functions --namespace production --dry-run

Flags:

  • --dir - Directory containing function files (default: ./functions)
  • --namespace - Target namespace (default: default)
  • --dry-run - Preview changes without applying

Shared Modules:

Place shared code in a _shared/ subdirectory:

functions/
├── _shared/
│ └── utils.ts
├── api-handler.ts
└── webhook.ts

Functions can import from shared modules:

import { helper } from "./_shared/utils.ts";

If Deno is installed locally, functions with imports are automatically bundled before upload.


Manage background jobs.

Terminal window
fluxbase jobs list
Terminal window
fluxbase jobs submit my-job
fluxbase jobs submit my-job --payload '{"data": "value"}'
fluxbase jobs submit my-job --priority 10
Terminal window
fluxbase jobs status abc123
Terminal window
fluxbase jobs cancel abc123
Terminal window
fluxbase jobs retry abc123
Terminal window
fluxbase jobs logs abc123

Show job queue statistics.

Terminal window
fluxbase jobs stats

Sync job functions from a local directory.

Terminal window
fluxbase jobs sync --dir ./jobs
fluxbase jobs sync --dir ./jobs --namespace production --dry-run

Flags:

  • --dir - Directory containing job files (default: ./jobs)
  • --namespace - Target namespace (default: default)
  • --dry-run - Preview changes without applying

Like functions, jobs support a _shared/ directory for shared modules and JSON/GeoJSON data files.


Manage file storage.

Terminal window
# List buckets
fluxbase storage buckets list
# Create bucket
fluxbase storage buckets create my-bucket
fluxbase storage buckets create my-bucket --public
# Delete bucket
fluxbase storage buckets delete my-bucket
Terminal window
# List objects
fluxbase storage objects list my-bucket
fluxbase storage objects list my-bucket --prefix images/
# Upload file
fluxbase storage objects upload my-bucket path/to/file.jpg ./local-file.jpg
# Download file
fluxbase storage objects download my-bucket path/to/file.jpg ./local-file.jpg
# Delete object
fluxbase storage objects delete my-bucket path/to/file.jpg
# Get signed URL
fluxbase storage objects url my-bucket path/to/file.jpg --expires 7200

Manage AI chatbots.

Terminal window
# List chatbots
fluxbase chatbots list
# Get chatbot details
fluxbase chatbots get abc123
# Create chatbot
fluxbase chatbots create support-bot --system-prompt "You are helpful"
# Update chatbot
fluxbase chatbots update abc123 --model gpt-4
# Delete chatbot
fluxbase chatbots delete abc123
# Interactive chat
fluxbase chatbots chat abc123

Manage knowledge bases for RAG.

Terminal window
# List knowledge bases
fluxbase kb list
# Create knowledge base
fluxbase kb create docs --description "Product documentation"
# Upload document
fluxbase kb upload abc123 ./manual.pdf
# List documents
fluxbase kb documents abc123
# Search knowledge base
fluxbase kb search abc123 "how to reset password"
# Delete knowledge base
fluxbase kb delete abc123

Query and manage database tables.

Terminal window
# List tables
fluxbase tables list
# Describe table
fluxbase tables describe users
# Query table
fluxbase tables query users
fluxbase tables query users --select "id,email" --where "role=eq.admin" --limit 10
# Insert record
fluxbase tables insert users --data '{"email": "user@example.com"}'
# Update records
fluxbase tables update users --where "id=eq.123" --data '{"name": "New Name"}'
# Delete records
fluxbase tables delete users --where "id=eq.123"

Execute GraphQL queries and mutations against the auto-generated GraphQL API.

Execute a GraphQL query.

Terminal window
# Simple query
fluxbase graphql query '{ users { id email created_at } }'
# Query with filtering
fluxbase graphql query '{ users(where: {role: {_eq: "admin"}}) { id email } }'
# Query with ordering and pagination
fluxbase graphql query '{ users(limit: 10, order_by: {created_at: desc}) { id email } }'
# Query from file
fluxbase graphql query --file ./get-users.graphql
# Query with variables
fluxbase graphql query 'query GetUser($id: ID!) { user(id: $id) { id email } }' --var 'id=abc-123'
# Multiple variables
fluxbase graphql query 'query($limit: Int, $offset: Int) { users(limit: $limit, offset: $offset) { id } }' \
--var 'limit=10' --var 'offset=20'
# Output as JSON
fluxbase graphql query '{ users { id } }' -o json

Flags:

  • --file, -f - File containing the GraphQL query
  • --var - Variables in format name=value (can be repeated)
  • --pretty - Pretty print JSON output (default: true)

Execute a GraphQL mutation.

Terminal window
# Insert a record
fluxbase graphql mutation 'mutation {
insert_users(objects: [{email: "new@example.com", name: "New User"}]) {
returning { id email }
}
}'
# Update records
fluxbase graphql mutation 'mutation {
update_users(where: {id: {_eq: "user-id"}}, _set: {name: "Updated Name"}) {
affected_rows
returning { id name }
}
}'
# Delete records
fluxbase graphql mutation 'mutation {
delete_users(where: {id: {_eq: "user-id"}}) {
affected_rows
}
}'
# Mutation with variables
fluxbase graphql mutation 'mutation CreateUser($email: String!, $name: String!) {
insert_users(objects: [{email: $email, name: $name}]) {
returning { id }
}
}' --var 'email=test@example.com' --var 'name=Test User'
# Mutation from file
fluxbase graphql mutation --file ./create-user.graphql --var 'email=user@example.com'

Flags:

  • --file, -f - File containing the GraphQL mutation
  • --var - Variables in format name=value (can be repeated)
  • --pretty - Pretty print JSON output (default: true)

Fetch and display the GraphQL schema via introspection.

Terminal window
# Full introspection query
fluxbase graphql introspect
# List only type names
fluxbase graphql introspect --types
# Output as JSON
fluxbase graphql introspect -o json

Flags:

  • --types - List only type names (simplified output)

Note: Introspection must be enabled on the server. It’s enabled by default in development but should be disabled in production for security.


Manage and invoke stored procedures.

List all RPC procedures.

Terminal window
fluxbase rpc list
fluxbase rpc list --namespace production

Get details of a specific procedure.

Terminal window
fluxbase rpc get default/calculate_totals

Invoke a stored procedure.

Terminal window
fluxbase rpc invoke default/calculate_totals
fluxbase rpc invoke default/process --params '{"id": 123}'
fluxbase rpc invoke default/batch_update --file ./params.json --async

Flags:

  • --params - JSON parameters to pass
  • --file - Load parameters from file
  • --async - Run asynchronously (returns immediately)

Sync RPC procedures from SQL files in a directory.

Terminal window
fluxbase rpc sync --dir ./rpc
fluxbase rpc sync --dir ./rpc --namespace production --dry-run

Flags:

  • --dir - Directory containing .sql files (default: ./rpc)
  • --namespace - Target namespace (default: default)
  • --dry-run - Preview changes without applying
  • --delete-missing - Delete procedures not in local directory

Manage webhooks.

Terminal window
# List webhooks
fluxbase webhooks list
# Create webhook
fluxbase webhooks create --url https://example.com/webhook --events "INSERT,UPDATE"
# Test webhook
fluxbase webhooks test abc123
# View deliveries
fluxbase webhooks deliveries abc123
# Delete webhook
fluxbase webhooks delete abc123

Manage client keys.

Terminal window
# List client keys
fluxbase clientkeys list
# Create client key
fluxbase clientkeys create --name "Production" --scopes "read:tables,write:tables"
# Revoke client key
fluxbase clientkeys revoke abc123
# Delete client key
fluxbase clientkeys delete abc123

Manage database migrations.

Terminal window
# List migrations
fluxbase migrations list
# Apply specific migration
fluxbase migrations apply 001_create_users
# Rollback migration
fluxbase migrations rollback 001_create_users
# Apply all pending
fluxbase migrations apply-pending
# Sync from directory
fluxbase migrations sync --dir ./migrations

Manage PostgreSQL extensions.

Terminal window
# List extensions
fluxbase extensions list
# Enable extension
fluxbase extensions enable pgvector
# Disable extension
fluxbase extensions disable pgvector

Manage realtime connections.

Terminal window
# Show stats
fluxbase realtime stats
# Broadcast message
fluxbase realtime broadcast my-channel --message '{"type": "notification"}'

Manage system settings.

Terminal window
# List settings
fluxbase settings list
# Get setting
fluxbase settings get auth.signup_enabled
# Set setting
fluxbase settings set auth.signup_enabled true

Manage encrypted application settings secrets. These are separate from the function secrets (fluxbase secrets) and are used for storing sensitive application configuration such as client keys and credentials.

Settings secrets support two scopes:

  • System secrets - Global application secrets (admin only)
  • User secrets - Per-user secrets encrypted with user-specific keys

List all secrets (values are never shown).

Terminal window
# List system secrets (admin)
fluxbase settings secrets list
# List user's own secrets
fluxbase settings secrets list --user

Flags:

  • --user - List user-specific secrets instead of system secrets

Create or update a secret.

Terminal window
# Set a system secret (admin only)
fluxbase settings secrets set stripe_api_key "sk-live-xxx"
fluxbase settings secrets set openai_key "sk-proj-xxx" --description "OpenAI API key"
# Set a user-specific secret
fluxbase settings secrets set my_api_key "user-key-xxx" --user
fluxbase settings secrets set my_api_key "user-key-xxx" --user --description "My personal API key"

Flags:

  • --user - Create/update a user-specific secret instead of a system secret
  • --description - Description of the secret

User secrets are encrypted with a user-derived key, ensuring that even admins cannot decrypt other users’ secrets.

Get metadata for a secret (the value is never returned).

Terminal window
# Get system secret metadata
fluxbase settings secrets get stripe_api_key
# Get user secret metadata
fluxbase settings secrets get my_api_key --user

Flags:

  • --user - Get a user-specific secret instead of a system secret

Delete a secret permanently.

Terminal window
# Delete system secret
fluxbase settings secrets delete stripe_api_key
# Delete user secret
fluxbase settings secrets delete my_api_key --user

Flags:

  • --user - Delete a user-specific secret instead of a system secret

Comparison: Settings Secrets vs Legacy Secrets

Section titled “Comparison: Settings Secrets vs Legacy Secrets”
Featurefluxbase settings secrets (Recommended)fluxbase secrets (Legacy)
Storageapp.settings tablefunctions.secrets table
ScopesSystem, userGlobal, namespace
User-specificYes (with HKDF encryption)No
Version historyNoYes
Access in functionssecrets.get(), secrets.getRequired()Deno.env.get("FLUXBASE_SECRET_*")
FallbackUser → System automatic fallbackNamespace → Global

Manage CLI configuration.

Terminal window
# Initialize config
fluxbase config init
# View config
fluxbase config view
# Set config value
fluxbase config set defaults.output json
# List profiles
fluxbase config profiles
# Add profile
fluxbase config profiles add staging
# Remove profile
fluxbase config profiles remove staging

The legacy fluxbase secrets commands manage namespace-scoped secrets stored in the functions.secrets table.

List all secrets (values are never shown).

Terminal window
fluxbase secrets list
fluxbase secrets list --scope global
fluxbase secrets list --namespace my-namespace

Flags:

  • --scope - Filter by scope (global or namespace)
  • --namespace - Filter by namespace

Create or update a secret.

Terminal window
fluxbase secrets set API_KEY "my-secret-key"
fluxbase secrets set DATABASE_URL "postgres://..." --scope namespace --namespace my-ns
fluxbase secrets set TEMP_KEY "value" --expires 30d

Flags:

  • --scope - Secret scope: global (default) or namespace
  • --namespace - Namespace for namespace-scoped secrets
  • --description - Description of the secret
  • --expires - Expiration duration (e.g., 30d, 1y, 24h)

Legacy secrets are available in functions as FLUXBASE_SECRET_<NAME> environment variables via Deno.env.get().

Get metadata for a secret (the value is never returned).

Terminal window
fluxbase secrets get API_KEY
fluxbase secrets get DATABASE_URL --namespace my-namespace

Delete a secret permanently.

Terminal window
fluxbase secrets delete API_KEY
fluxbase secrets delete DATABASE_URL --namespace my-namespace

Show version history for a secret.

Terminal window
fluxbase secrets history API_KEY
fluxbase secrets history DATABASE_URL --namespace my-namespace

Rollback a secret to a previous version.

Terminal window
fluxbase secrets rollback API_KEY 2
fluxbase secrets rollback DATABASE_URL 1 --namespace my-namespace

Query and stream logs from the central logging system.

List logs with filters.

Terminal window
fluxbase logs list
fluxbase logs list --category system --level error
fluxbase logs list --since 1h --search "database"
fluxbase logs list --category execution --limit 50
fluxbase logs list --user-id abc123 -o json

Flags:

  • --category - Filter by category: system, http, security, execution, ai, custom
  • --custom-category - Filter by custom category name (requires --category=custom)
  • --level - Filter by level: debug, info, warn, error
  • --component - Filter by component name
  • --request-id - Filter by request ID
  • --user-id - Filter by user ID
  • --search - Full-text search in message
  • --since - Show logs since time (e.g., 1h, 30m, 2024-01-15T10:00:00Z)
  • --until - Show logs until time
  • --limit - Maximum entries to return (default: 100)
  • --asc - Sort ascending (oldest first)

Tail logs in real-time.

Terminal window
fluxbase logs tail
fluxbase logs tail --category security
fluxbase logs tail --level error
fluxbase logs tail --category system --component auth

Flags:

  • --category - Filter by category
  • --level - Filter by level
  • --component - Filter by component
  • --lines - Number of initial lines to show (default: 20)

Show log statistics.

Terminal window
fluxbase logs stats
fluxbase logs stats -o json

View logs for a specific function, job, or RPC execution.

Terminal window
fluxbase logs execution abc123-def456
fluxbase logs execution abc123-def456 -o json
fluxbase logs execution abc123-def456 --follow
fluxbase logs execution abc123-def456 --tail 50

Flags:

  • --follow, -f - Stream new log entries in real-time
  • --tail - Show only last N lines

Unified sync for all resource types.

Sync all Fluxbase resources from a directory structure.

Terminal window
fluxbase sync # Auto-detect from ./fluxbase/ or current dir
fluxbase sync --dir ./src # Specify root directory
fluxbase sync --namespace production # Apply namespace to all
fluxbase sync --dry-run # Preview all changes

Flags:

  • --dir - Root directory (default: ./fluxbase or current directory)
  • --namespace - Target namespace for all resources (default: default)
  • --dry-run - Preview changes without applying

The sync command automatically detects and syncs these subdirectories:

fluxbase/
├── rpc/ # SQL files for stored procedures
├── migrations/ # Database migrations (.up.sql, .down.sql)
├── functions/ # Edge functions (.ts, .js)
├── jobs/ # Background jobs (.ts, .js)
└── chatbots/ # Chatbot configurations (.yaml)

Resources are synced in dependency order: RPC → Migrations → Functions → Jobs → Chatbots


Manage database branches for isolated development and testing environments. See the Database Branching Guide for full documentation.

List all database branches.

Terminal window
fluxbase branch list
fluxbase branch list --type preview
fluxbase branch list --mine
fluxbase branch list -o json

Flags:

  • --type - Filter by branch type (main, preview, persistent)
  • --mine, -m - Show only branches created by you

Get details of a specific branch.

Terminal window
fluxbase branch get my-feature
fluxbase branch get pr-123
fluxbase branch get 550e8400-e29b-41d4-a716-446655440000

Create a new database branch.

Terminal window
# Basic branch
fluxbase branch create my-feature
# With full data clone
fluxbase branch create staging --clone-data full_clone
# Persistent branch (not auto-deleted)
fluxbase branch create staging --type persistent
# Branch with expiration
fluxbase branch create temp-test --expires-in 24h
# Branch linked to GitHub PR
fluxbase branch create pr-123 --pr 123 --repo owner/repo
# Branch from another branch
fluxbase branch create feature-b --from feature-a

Flags:

  • --clone-data - Data clone mode: schema_only (default), full_clone, seed_data
  • --type - Branch type: preview (default), persistent
  • --expires-in - Auto-delete after duration (e.g., 24h, 7d)
  • --from - Parent branch to clone from (default: main)
  • --pr - GitHub PR number to associate
  • --repo - GitHub repository (e.g., owner/repo)

After creation, the command shows how to connect:

Branch 'my-feature' created successfully!
Slug: my-feature
Database: branch_my_feature
Status: ready
To use this branch:
Header: X-Fluxbase-Branch: my-feature
Query: ?branch=my-feature
SDK: { branch: 'my-feature' }

Delete a database branch and its associated database.

Terminal window
fluxbase branch delete my-feature
fluxbase branch delete pr-123 --force

Flags:

  • --force, -f - Skip confirmation prompt

Reset a branch to its parent state, recreating the database.

Terminal window
fluxbase branch reset my-feature
fluxbase branch reset pr-123 --force

Flags:

  • --force, -f - Skip confirmation prompt

This drops the branch database and recreates it from the parent branch. All changes are lost.

Show the current status of a branch.

Terminal window
fluxbase branch status my-feature

Output shows the branch name, slug, and current status (creating, ready, migrating, error, deleting).

Show the activity log for a branch.

Terminal window
fluxbase branch activity my-feature
fluxbase branch activity pr-123 --limit 20

Flags:

  • --limit, -n - Maximum number of entries to show (default: 50)

Show connection pool statistics for all branches.

Terminal window
fluxbase branch stats

Useful for debugging and monitoring database connections across branches.


Manage admin users, invitations, and sessions for the Fluxbase dashboard. Admin users have access to the admin dashboard for managing database, users, functions, and other platform features.

List all admin/dashboard users.

Terminal window
fluxbase admin users list
fluxbase admin users list -o json

Get details of a specific admin user.

Terminal window
fluxbase admin users get 550e8400-e29b-41d4-a716-446655440000

Invite a new admin user via email.

Terminal window
fluxbase admin users invite --email admin@example.com
fluxbase admin users invite --email admin@example.com --role dashboard_admin

Flags:

  • --email - Email address to invite (required)
  • --role - Role for the new user: dashboard_user (default) or dashboard_admin

Delete an admin user.

Terminal window
fluxbase admin users delete 550e8400-e29b-41d4-a716-446655440000
fluxbase admin users delete 550e8400-e29b-41d4-a716-446655440000 --force

Flags:

  • --force, -f - Skip confirmation prompt

List pending and accepted admin invitations.

Terminal window
fluxbase admin invitations list
fluxbase admin invitations list --include-accepted
fluxbase admin invitations list --include-expired

Flags:

  • --include-accepted - Include accepted invitations
  • --include-expired - Include expired invitations

Revoke a pending admin invitation.

Terminal window
fluxbase admin invitations revoke abc123def456
fluxbase admin invitations revoke abc123def456 --force

Flags:

  • --force, -f - Skip confirmation prompt

List all active admin sessions.

Terminal window
fluxbase admin sessions list
fluxbase admin sessions list -o json

Revoke a specific admin session.

Terminal window
fluxbase admin sessions revoke 550e8400-e29b-41d4-a716-446655440000

Flags:

  • --force, -f - Skip confirmation prompt

Revoke all sessions for a specific admin user.

Terminal window
fluxbase admin sessions revoke-all 550e8400-e29b-41d4-a716-446655440000
fluxbase admin sessions revoke-all 550e8400-e29b-41d4-a716-446655440000 --force

Flags:

  • --force, -f - Skip confirmation prompt

Send a password reset email to an admin user.

Terminal window
fluxbase admin password-reset --email admin@example.com

Flags:

  • --email - Email address of the admin user (required)

Manage application users (end users of your application). For admin/dashboard users, use fluxbase admin users instead.

List all application users.

Terminal window
fluxbase users list
fluxbase users list -o json
fluxbase users list --search john

Flags:

  • --search - Search users by email

Get details of a specific application user.

Terminal window
fluxbase users get 550e8400-e29b-41d4-a716-446655440000

Invite a new application user via email.

Terminal window
fluxbase users invite --email user@example.com

Flags:

  • --email - Email address to invite (required)

Delete an application user.

Terminal window
fluxbase users delete 550e8400-e29b-41d4-a716-446655440000
fluxbase users delete 550e8400-e29b-41d4-a716-446655440000 --force

Flags:

  • --force, -f - Skip confirmation prompt