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
fluxbase functions invoke my-function --async

Flags:

  • --data - JSON payload to send
  • --file - Load payload from file
  • --async - Run asynchronously (returns immediately)

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
  • --keep - Keep functions not present in directory

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 --file ./payload.json
fluxbase jobs submit my-job --priority 10
fluxbase jobs submit my-job --schedule "0 * * * *"

Flags:

  • --payload - JSON payload to send
  • --file - Load payload from file
  • --priority - Job priority (higher = more important)
  • --schedule - Cron schedule for recurring jobs
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
  • --keep - Keep jobs not present in directory

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
fluxbase storage buckets create my-bucket --max-size 10737418240 # 10GB limit
# Delete bucket
fluxbase storage buckets delete my-bucket

Flags:

  • --public - Make bucket publicly accessible
  • --max-size - Maximum bucket size in bytes
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
fluxbase storage objects upload my-bucket path/to/file.jpg ./local-file.jpg --content-type image/jpeg
# 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

Flags:

  • --content-type - MIME type for the uploaded file

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
# Sync chatbots from directory
fluxbase chatbots sync --dir ./chatbots

Flags:

  • --system-prompt - System prompt for the chatbot
  • --model - AI model to use (e.g., gpt-4, gpt-3.5-turbo)
  • --temperature - Response randomness (0.0-2.0)
  • --max-tokens - Maximum response length
  • --knowledge-base - Knowledge base ID to attach

Flags:

  • --system-prompt - System prompt for the chatbot
  • --model - AI model to use
  • --temperature - Response randomness (0.0-2.0)
  • --max-tokens - Maximum response length

Sync chatbots from a local directory.

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

Flags:

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

Manage knowledge bases for RAG (Retrieval-Augmented Generation). Knowledge bases store documents that are chunked, embedded, and indexed for semantic search.

List all knowledge bases.

Terminal window
fluxbase kb list
fluxbase kb list --namespace production
fluxbase kb list -o json

Flags:

  • --namespace - Filter by namespace

Get details of a specific knowledge base.

Terminal window
fluxbase kb get abc123

Create a new knowledge base.

Terminal window
fluxbase kb create docs --description "Product documentation"
fluxbase kb create docs --embedding-model text-embedding-ada-002 --chunk-size 512

Flags:

  • --description - Knowledge base description
  • --embedding-model - Embedding model to use
  • --chunk-size - Document chunk size (default: 512)
  • --namespace - Target namespace (default: default)

Update an existing knowledge base.

Terminal window
fluxbase kb update abc123 --description "Updated description"

Flags:

  • --description - New description

Delete a knowledge base and all its documents.

Terminal window
fluxbase kb delete abc123

Show knowledge base status and statistics.

Terminal window
fluxbase kb status abc123
fluxbase kb status abc123 --output json

Flags:

  • --output - Output format (json, table)

Upload a document to a knowledge base. Supported formats: PDF, DOCX, TXT, MD, images (with OCR).

Terminal window
fluxbase kb upload abc123 ./manual.pdf
fluxbase kb upload abc123 ./guide.md --title "User Guide"
fluxbase kb upload abc123 ./scan.png --ocr-languages eng,deu

Flags:

  • --title - Document title
  • --metadata - Document metadata (JSON)
  • --tags - Comma-separated tags
  • --ocr-languages - OCR languages for images (e.g., eng,deu)

Add a document from text, stdin, or file (alternative to upload for text content).

Terminal window
# Add from inline content
fluxbase kb add abc123 --content "Hello world" --title "Greeting"
# Add from stdin
echo "Content" | fluxbase kb add abc123 --title "My Doc"
# Add from file
fluxbase kb add abc123 --from-file ./doc.txt --title "Document"
# Add with metadata
fluxbase kb add abc123 --content "..." --title "Doc" --metadata '{"user_id":"uuid"}' --tags "important,reference"

Flags:

  • --content - Inline document content
  • --from-file - Read content from file
  • --title - Document title
  • --metadata - Document metadata (JSON)
  • --tags - Comma-separated tags

List documents in a knowledge base.

Terminal window
fluxbase kb documents abc123

Get document details.

Terminal window
fluxbase kb documents get abc123 doc456

Update document metadata.

Terminal window
fluxbase kb documents update abc123 doc456 --title "New Title"
fluxbase kb documents update abc123 doc456 --tags "tag1,tag2"
fluxbase kb documents update abc123 doc456 --metadata '{"key":"value"}'

Flags:

  • --title - New document title
  • --tags - New tags (comma-separated)
  • --metadata - New metadata (JSON)

Delete a document from a knowledge base.

Terminal window
fluxbase kb documents delete abc123 doc456

Bulk delete documents by tags or metadata.

Terminal window
fluxbase kb documents delete-by-filter abc123 --tags "archived"
fluxbase kb documents delete-by-filter abc123 --metadata-filter "user_id=uuid-here"

Flags:

  • --tags - Filter by tags (comma-separated)
  • --metadata-filter - Filter by metadata (e.g., key=value)

Search a knowledge base using semantic similarity.

Terminal window
fluxbase kb search abc123 "how to reset password"
fluxbase kb search abc123 "pricing plans" --limit 5 --threshold 0.8

Flags:

  • --limit - Maximum results (default: 10)
  • --threshold - Similarity threshold 0.0-1.0 (default: 0.7)

Export a database table as a document to the knowledge base. Includes schema, columns, relationships, and optional sample data.

Terminal window
# Export all columns
fluxbase kb export-table abc123 --table users --schema public
# Export specific columns (recommended for sensitive data)
fluxbase kb export-table abc123 --table users --columns id,name,email
# Include foreign keys and indexes
fluxbase kb export-table abc123 --table products --include-fks --include-indexes --sample-rows 10

Flags:

  • --table - Table name (required)
  • --schema - Schema name (default: public)
  • --columns - Comma-separated column names (default: all)
  • --include-fks - Include foreign keys
  • --include-indexes - Include indexes
  • --sample-rows - Number of sample rows to include

List exportable database tables.

Terminal window
fluxbase kb tables
fluxbase kb tables public

Show system capabilities including supported OCR languages, file types, and features.

Terminal window
fluxbase kb capabilities

Show the knowledge graph for a knowledge base, including entities and their relationships.

Terminal window
fluxbase kb graph abc123

List entities extracted from the knowledge base.

Terminal window
fluxbase kb entities abc123
fluxbase kb entities abc123 --type person
fluxbase kb entities abc123 --search "John"

Flags:

  • --type - Filter by entity type
  • --search - Search entities by name

List all chatbots using a knowledge base.

Terminal window
fluxbase kb chatbots 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
fluxbase tables query users --order-by "created_at.desc" --offset 20 --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"

Flags:

  • --select - Comma-separated columns to return (default: all)
  • --where - Filter conditions (PostgREST syntax)
  • --order-by - Order by column (e.g., created_at.desc, name.asc)
  • --limit - Maximum rows to return (default: 100)
  • --offset - Number of rows to skip (for pagination)

Generate TypeScript type definitions from your database schema. The generated types can be used with the Fluxbase TypeScript SDK for type-safe database queries.

Generate TypeScript type definitions from your database schema.

Terminal window
# Generate types for the public schema and write to types.ts
fluxbase types generate --output types.ts
# Generate types for multiple schemas
fluxbase types generate --schemas public,auth --output types.ts
# Generate types including RPC function signatures
fluxbase types generate --include-functions --output types.ts
# Generate types without views
fluxbase types generate --include-views=false --output types.ts
# Output to stdout (for piping)
fluxbase types generate
# Generate with helper functions
fluxbase types generate --format full --output types.ts

Flags:

  • --schemas - Schemas to include (default: public, comma-separated)
  • --include-functions - Include RPC function types (default: true)
  • --include-views - Include view types (default: true)
  • --output, -o - Output file path (default: stdout)
  • --format - Output format: types (interfaces only) or full (with helpers)

List all available database schemas that can be used for type generation.

Terminal window
fluxbase types list

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
fluxbase rpc get default/calculate_totals --namespace production

Flags:

  • --namespace - Namespace (default: default)

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
fluxbase rpc invoke default/process --namespace production

Flags:

  • --namespace - Namespace (default: default)
  • --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
  • --keep - Keep procedures not in local directory
  • --delete-missing - Delete procedures not in local directory

Manage webhooks for database events.

Terminal window
# List webhooks
fluxbase webhooks list
# Get webhook details
fluxbase webhooks get abc123
# Create webhook
fluxbase webhooks create --url https://example.com/webhook --events "INSERT,UPDATE"
# Update webhook
fluxbase webhooks update abc123 --url https://new-url.com/webhook
fluxbase webhooks update abc123 --events "INSERT,UPDATE,DELETE"
fluxbase webhooks update abc123 --enabled=false
# Test webhook
fluxbase webhooks test abc123
# View deliveries
fluxbase webhooks deliveries abc123
# Delete webhook
fluxbase webhooks delete abc123

Create a new webhook.

Terminal window
fluxbase webhooks create --url https://example.com/webhook --events "INSERT,UPDATE"
fluxbase webhooks create --url https://example.com/webhook --events "*" --secret "my-secret"

Flags:

  • --url - Webhook URL (required)
  • --events - Comma-separated events (e.g., INSERT,UPDATE,DELETE or * for all)
  • --secret - Secret for webhook signature verification

Update a webhook.

Terminal window
fluxbase webhooks update abc123 --url https://new-url.com/webhook
fluxbase webhooks update abc123 --events "INSERT,UPDATE,DELETE"
fluxbase webhooks update abc123 --enabled=false

Flags:

  • --url - New webhook URL
  • --events - New comma-separated events
  • --enabled - Enable or disable the webhook

Manage client keys for API authentication.

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

Flags:

  • --name - Client key name (required)
  • --scopes - Comma-separated scopes (e.g., read:tables,write:tables)
  • --rate-limit - Rate limit per minute (e.g., 100)
  • --expires - Expiration duration (e.g., 30d, 1y)

Manage database migrations.

Terminal window
# List migrations
fluxbase migrations list
# Get migration details
fluxbase migrations get 001_create_users
# Create migration
fluxbase migrations create add_users_table --up-sql "CREATE TABLE users..." --down-sql "DROP TABLE users"
# 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

List all migrations.

Terminal window
fluxbase migrations list
fluxbase migrations list --namespace production

Flags:

  • --namespace - Filter by namespace

Get migration details.

Terminal window
fluxbase migrations get 001_create_users

Create a new migration.

Terminal window
fluxbase migrations create add_users_table --up-sql "CREATE TABLE users (id SERIAL PRIMARY KEY);"
fluxbase migrations create add_users_table --up-sql "CREATE TABLE..." --down-sql "DROP TABLE..."

Flags:

  • --up-sql - SQL for up migration
  • --down-sql - SQL for down migration
  • --namespace - Target namespace (default: default)

Sync migrations from a directory.

Terminal window
fluxbase migrations sync --dir ./migrations
fluxbase migrations sync --dir ./migrations --namespace production --no-apply

Flags:

  • --dir - Directory containing migration files (default: ./migrations)
  • --namespace - Target namespace (default: default)
  • --no-apply - Sync without auto-applying pending migrations
  • --dry-run - Preview changes without applying

Manage PostgreSQL extensions.

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

Get the status of a specific extension.

Terminal window
fluxbase extensions status pgvector

Enable a PostgreSQL extension.

Terminal window
fluxbase extensions enable pgvector
fluxbase extensions enable pgvector --schema vector_schema

Flags:

  • --schema - Schema to install the extension in (default: extension default)

Manage realtime connections.

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

Flags:

  • --message - JSON message to broadcast (required)
  • --event - Custom event name (default: broadcast)

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 service keys for server-to-server authentication with elevated permissions. Service keys are used for automated workflows, CI/CD pipelines, and backend services that need to access the Fluxbase API.

List all service keys.

Terminal window
fluxbase servicekeys list
fluxbase servicekeys list -o json

Create a new service key.

Terminal window
fluxbase servicekeys create --name "Migrations Key" --scopes "migrations:*"
fluxbase servicekeys create --name "Production" --rate-limit-per-hour 100
fluxbase servicekeys create --name "CI/CD" --scopes "*" --expires 2025-12-31T23:59:59Z

Flags:

  • --name - Service key name (required)
  • --description - Service key description
  • --scopes - Comma-separated scopes (default: * for all)
  • --rate-limit-per-minute - Requests per minute (0 = no limit)
  • --rate-limit-per-hour - Requests per hour (0 = no limit)
  • --expires - Expiration time (e.g., 2025-12-31T23:59:59Z)

Get details of a specific service key.

Terminal window
fluxbase servicekeys get abc123

Update a service key’s properties.

Terminal window
fluxbase servicekeys update abc123 --name "New Name"
fluxbase servicekeys update abc123 --rate-limit-per-hour 200
fluxbase servicekeys update abc123 --enabled=false

Flags:

  • --name - New service key name
  • --description - New service key description
  • --scopes - New comma-separated scopes
  • --rate-limit-per-minute - Requests per minute (0 = no limit)
  • --rate-limit-per-hour - Requests per hour (0 = no limit)
  • --enabled - Enable or disable the key (default: true)

Disable a service key (keeps the record but prevents use).

Terminal window
fluxbase servicekeys disable abc123

Enable a previously disabled service key.

Terminal window
fluxbase servicekeys enable abc123

Delete a service key permanently.

Terminal window
fluxbase servicekeys delete abc123

Emergency revoke a service key immediately. This action is irreversible.

Terminal window
fluxbase servicekeys revoke abc123 --reason "Key compromised"
fluxbase servicekeys revoke abc123 --reason "Employee departure"

Flags:

  • --reason - Reason for revocation (required)

The key will be permanently disabled and marked as revoked with an audit trail.

Mark a service key as deprecated with a grace period. The key continues working during the grace period, allowing time for migration to a new key.

Terminal window
fluxbase servicekeys deprecate abc123 --grace-period 24h
fluxbase servicekeys deprecate abc123 --grace-period 7d --reason "Scheduled rotation"

Flags:

  • --grace-period - Grace period before key stops working (default: 24h, e.g., 24h, 7d)
  • --reason - Reason for deprecation

Create a new service key as a replacement for an existing one. This deprecates the old key with a grace period and creates a new key with the same configuration.

Terminal window
fluxbase servicekeys rotate abc123 --grace-period 24h
fluxbase servicekeys rotate abc123 --grace-period 7d

Flags:

  • --grace-period - Grace period for old key (default: 24h, e.g., 24h, 7d)

The output shows the new key (save it immediately!) and when the old key will stop working.

View the revocation audit log for a service key.

Terminal window
fluxbase servicekeys revocations abc123

Shows all revocation events including emergency revocations, rotations, and expirations.


Manage CLI configuration.

Terminal window
# Initialize config
fluxbase config init
# View config
fluxbase config view
# Get config value
fluxbase config get defaults.output
# 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

Get a specific config value.

Terminal window
fluxbase config get defaults.output
fluxbase config get current_profile

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

Manage custom MCP (Model Context Protocol) tools for AI assistant integration. Custom MCP tools allow you to extend the Fluxbase MCP server with your own tools that can be used by AI assistants.

List all custom MCP tools.

Terminal window
fluxbase mcp tools list
fluxbase mcp tools list --namespace production
fluxbase mcp tools list -o json

Flags:

  • --namespace - Filter by namespace

Get details of a specific custom MCP tool.

Terminal window
fluxbase mcp tools get weather_forecast
fluxbase mcp tools get weather_forecast -o json

Create a new custom MCP tool.

Terminal window
fluxbase mcp tools create weather_forecast --code ./weather.ts
fluxbase mcp tools create weather_forecast --code ./weather.ts --description "Get weather forecast"
fluxbase mcp tools create weather_forecast --code ./weather.ts --timeout 60 --memory 256

Flags:

  • --code - Path to TypeScript code file (required)
  • --namespace - Namespace (default: default)
  • --description - Tool description
  • --timeout - Execution timeout in seconds (default: 30)
  • --memory - Memory limit in MB (default: 128)
  • --allow-net - Allow network access (default: true)
  • --allow-env - Allow environment variable access
  • --allow-read - Allow file read access
  • --allow-write - Allow file write access

Update an existing custom MCP tool.

Terminal window
fluxbase mcp tools update weather_forecast --code ./weather.ts
fluxbase mcp tools update weather_forecast --timeout 60

Flags:

  • --code - Path to TypeScript code file
  • --namespace - Namespace (default: default)
  • --description - Tool description
  • --timeout - Execution timeout in seconds
  • --memory - Memory limit in MB

Delete a custom MCP tool.

Terminal window
fluxbase mcp tools delete weather_forecast

Sync custom MCP tools from a directory to the server.

Terminal window
fluxbase mcp tools sync # Auto-detect directory
fluxbase mcp tools sync --dir ./mcp-tools
fluxbase mcp tools sync --dir ./mcp-tools --namespace production
fluxbase mcp tools sync --dry-run

Flags:

  • --dir - Directory containing tool files (auto-detects ./fluxbase/mcp-tools/ or ./mcp-tools/)
  • --namespace - Target namespace (default: default)
  • --dry-run - Preview changes without applying

Each .ts file in the directory will be synced as a custom tool. Tool name defaults to filename. You can use annotations in your code:

// @fluxbase:name my_tool
// @fluxbase:namespace production
// @fluxbase:description Get weather forecast
// @fluxbase:timeout 30
// @fluxbase:memory 128
// @fluxbase:allow-net

Test a custom MCP tool by invoking it with sample arguments.

Terminal window
fluxbase mcp tools test weather_forecast --args '{"location": "New York"}'

Flags:

  • --args - JSON arguments to pass to the tool (default: {})
  • --namespace - Namespace (default: default)

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
fluxbase sync --keep # Keep resources not in directory
fluxbase sync --analyze # Analyze bundle sizes
fluxbase sync --analyze --verbose # Detailed analysis

Flags:

  • --dir - Root directory (default: ./fluxbase or current directory)
  • --namespace - Target namespace for all resources (default: default)
  • --dry-run - Preview changes without applying
  • --keep - Keep items not present in directory
  • --analyze - Analyze bundle sizes (shows breakdown of what’s in each bundle)
  • --verbose - Show detailed analysis (with --analyze)

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)
  • --seeds-dir - Custom directory containing seed SQL files (only with --clone-data seed_data)

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.

Set the default branch for all subsequent CLI commands. This saves the branch to your profile config.

Terminal window
fluxbase branch use my-feature
fluxbase branch use pr-123
fluxbase branch use main # Reset to main branch

After setting a default branch, all CLI commands will automatically use that branch without needing to specify it each time.

Show the current default branch set for CLI commands.

Terminal window
fluxbase branch current

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

Show CLI version information.

Terminal window
fluxbase version

Generate shell completion scripts for bash, zsh, fish, and powershell.

Terminal window
# Bash
fluxbase completion bash > /etc/bash_completion.d/fluxbase
# Zsh
fluxbase completion zsh > "${fpath[1]}/_fluxbase"
# Fish
fluxbase completion fish > ~/.config/fish/completions/fluxbase.fish
# PowerShell
fluxbase completion powershell > ~/.config/powershell/completions/fluxbase.ps1

After installation, restart your shell or source the completion file to enable autocompletion.


Many commands have shorter aliases for convenience:

CommandAliases
adminadm
branchbranches, br
chatbotschatbot, cb
clientkeysclientkey, keys
extensionsextension, ext
functionsfn, function
graphqlgql
jobsjob
kbknowledge-bases, knowledge-base
logslog
migrationsmigration, migrate
realtimert
secretssecret
servicekeysservicekey, sk
tablestable, db
usersuser
webhookswebhook, wh

Examples:

Terminal window
fluxbase fn list # Same as fluxbase functions list
fluxbase br create test # Same as fluxbase branch create test
fluxbase rt stats # Same as fluxbase realtime stats