CLI Command Reference
This page documents all Fluxbase CLI commands, their subcommands, flags, and usage examples.
Command Overview
Section titled “Command Overview”fluxbase [command] [subcommand] [flags]Global Flags
Section titled “Global Flags”These flags work with all commands:
| Flag | Short | Description |
|---|---|---|
--config | Config file path (default: ~/.fluxbase/config.yaml) | |
--profile | -p | Profile to use |
--output | -o | Output format: table, json, yaml |
--no-headers | Hide table headers | |
--quiet | -q | Minimal output |
--debug | Enable debug output |
Authentication Commands
Section titled “Authentication Commands”fluxbase auth login
Section titled “fluxbase auth login”Authenticate with a Fluxbase server.
# Interactive loginfluxbase auth login
# Non-interactive with credentialsfluxbase auth login --server URL --email EMAIL --password PASSWORD
# With API tokenfluxbase auth login --server URL --token TOKEN
# SSO login (opens browser)fluxbase auth login --server URL --sso
# Save to named profilefluxbase auth login --profile prod --server URLFlags:
--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.
fluxbase auth logout
Section titled “fluxbase auth logout”Clear stored credentials.
fluxbase auth logoutfluxbase auth logout --profile prodfluxbase auth status
Section titled “fluxbase auth status”Show authentication status for all profiles.
fluxbase auth statusfluxbase auth switch
Section titled “fluxbase auth switch”Switch the active profile.
fluxbase auth switch prodfluxbase auth whoami
Section titled “fluxbase auth whoami”Display current user information.
fluxbase auth whoamiFunctions Commands
Section titled “Functions Commands”Manage edge functions.
fluxbase functions list
Section titled “fluxbase functions list”fluxbase functions listfluxbase functions list --namespace productionfluxbase functions get
Section titled “fluxbase functions get”fluxbase functions get my-functionfluxbase functions create
Section titled “fluxbase functions create”fluxbase functions create my-function --code ./function.tsfluxbase functions create my-function --code ./function.ts --timeout 60 --memory 256Flags:
--code- Path to function code file (required)--description- Function description--timeout- Execution timeout in seconds (default: 30)--memory- Memory limit in MB (default: 128)
fluxbase functions update
Section titled “fluxbase functions update”fluxbase functions update my-function --code ./function.tsfluxbase functions update my-function --timeout 120fluxbase functions delete
Section titled “fluxbase functions delete”fluxbase functions delete my-functionfluxbase functions invoke
Section titled “fluxbase functions invoke”fluxbase functions invoke my-functionfluxbase functions invoke my-function --data '{"key": "value"}'fluxbase functions invoke my-function --file ./payload.jsonfluxbase functions invoke my-function --asyncFlags:
--data- JSON payload to send--file- Load payload from file--async- Run asynchronously (returns immediately)
fluxbase functions logs
Section titled “fluxbase functions logs”View execution logs for a function.
fluxbase functions logs my-functionfluxbase functions logs my-function --tail 50fluxbase functions logs my-function --followFlags:
--tail- Number of lines to show (default: 20)--follow,-f- Stream new log entries in real-time
fluxbase functions sync
Section titled “fluxbase functions sync”Sync all functions from a local directory to the server.
fluxbase functions sync --dir ./functionsfluxbase functions sync --dir ./functions --namespace production --dry-runFlags:
--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.tsFunctions can import from shared modules:
import { helper } from "./_shared/utils.ts";If Deno is installed locally, functions with imports are automatically bundled before upload.
Jobs Commands
Section titled “Jobs Commands”Manage background jobs.
fluxbase jobs list
Section titled “fluxbase jobs list”fluxbase jobs listfluxbase jobs submit
Section titled “fluxbase jobs submit”fluxbase jobs submit my-jobfluxbase jobs submit my-job --payload '{"data": "value"}'fluxbase jobs submit my-job --file ./payload.jsonfluxbase jobs submit my-job --priority 10fluxbase 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
fluxbase jobs status
Section titled “fluxbase jobs status”fluxbase jobs status abc123fluxbase jobs cancel
Section titled “fluxbase jobs cancel”fluxbase jobs cancel abc123fluxbase jobs retry
Section titled “fluxbase jobs retry”fluxbase jobs retry abc123fluxbase jobs logs
Section titled “fluxbase jobs logs”fluxbase jobs logs abc123fluxbase jobs stats
Section titled “fluxbase jobs stats”Show job queue statistics.
fluxbase jobs statsfluxbase jobs sync
Section titled “fluxbase jobs sync”Sync job functions from a local directory.
fluxbase jobs sync --dir ./jobsfluxbase jobs sync --dir ./jobs --namespace production --dry-runFlags:
--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.
Storage Commands
Section titled “Storage Commands”Manage file storage.
Bucket Commands
Section titled “Bucket Commands”# List bucketsfluxbase storage buckets list
# Create bucketfluxbase storage buckets create my-bucketfluxbase storage buckets create my-bucket --publicfluxbase storage buckets create my-bucket --max-size 10737418240 # 10GB limit
# Delete bucketfluxbase storage buckets delete my-bucketfluxbase storage buckets create
Section titled “fluxbase storage buckets create”Flags:
--public- Make bucket publicly accessible--max-size- Maximum bucket size in bytes
Object Commands
Section titled “Object Commands”# List objectsfluxbase storage objects list my-bucketfluxbase storage objects list my-bucket --prefix images/
# Upload filefluxbase storage objects upload my-bucket path/to/file.jpg ./local-file.jpgfluxbase storage objects upload my-bucket path/to/file.jpg ./local-file.jpg --content-type image/jpeg
# Download filefluxbase storage objects download my-bucket path/to/file.jpg ./local-file.jpg
# Delete objectfluxbase storage objects delete my-bucket path/to/file.jpg
# Get signed URLfluxbase storage objects url my-bucket path/to/file.jpg --expires 7200fluxbase storage objects upload
Section titled “fluxbase storage objects upload”Flags:
--content-type- MIME type for the uploaded file
Chatbot Commands
Section titled “Chatbot Commands”Manage AI chatbots.
# List chatbotsfluxbase chatbots list
# Get chatbot detailsfluxbase chatbots get abc123
# Create chatbotfluxbase chatbots create support-bot --system-prompt "You are helpful"
# Update chatbotfluxbase chatbots update abc123 --model gpt-4
# Delete chatbotfluxbase chatbots delete abc123
# Interactive chatfluxbase chatbots chat abc123
# Sync chatbots from directoryfluxbase chatbots sync --dir ./chatbotsfluxbase chatbots create
Section titled “fluxbase chatbots create”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
fluxbase chatbots update
Section titled “fluxbase chatbots update”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
fluxbase chatbots sync
Section titled “fluxbase chatbots sync”Sync chatbots from a local directory.
fluxbase chatbots sync --dir ./chatbotsfluxbase chatbots sync --dir ./chatbots --namespace production --dry-runFlags:
--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
Knowledge Base Commands
Section titled “Knowledge Base Commands”Manage knowledge bases for RAG (Retrieval-Augmented Generation). Knowledge bases store documents that are chunked, embedded, and indexed for semantic search.
fluxbase kb list
Section titled “fluxbase kb list”List all knowledge bases.
fluxbase kb listfluxbase kb list --namespace productionfluxbase kb list -o jsonFlags:
--namespace- Filter by namespace
fluxbase kb get
Section titled “fluxbase kb get”Get details of a specific knowledge base.
fluxbase kb get abc123fluxbase kb create
Section titled “fluxbase kb create”Create a new knowledge base.
fluxbase kb create docs --description "Product documentation"fluxbase kb create docs --embedding-model text-embedding-ada-002 --chunk-size 512Flags:
--description- Knowledge base description--embedding-model- Embedding model to use--chunk-size- Document chunk size (default: 512)--namespace- Target namespace (default:default)
fluxbase kb update
Section titled “fluxbase kb update”Update an existing knowledge base.
fluxbase kb update abc123 --description "Updated description"Flags:
--description- New description
fluxbase kb delete
Section titled “fluxbase kb delete”Delete a knowledge base and all its documents.
fluxbase kb delete abc123fluxbase kb status
Section titled “fluxbase kb status”Show knowledge base status and statistics.
fluxbase kb status abc123fluxbase kb status abc123 --output jsonFlags:
--output- Output format (json,table)
fluxbase kb upload
Section titled “fluxbase kb upload”Upload a document to a knowledge base. Supported formats: PDF, DOCX, TXT, MD, images (with OCR).
fluxbase kb upload abc123 ./manual.pdffluxbase kb upload abc123 ./guide.md --title "User Guide"fluxbase kb upload abc123 ./scan.png --ocr-languages eng,deuFlags:
--title- Document title--metadata- Document metadata (JSON)--tags- Comma-separated tags--ocr-languages- OCR languages for images (e.g.,eng,deu)
fluxbase kb add
Section titled “fluxbase kb add”Add a document from text, stdin, or file (alternative to upload for text content).
# Add from inline contentfluxbase kb add abc123 --content "Hello world" --title "Greeting"
# Add from stdinecho "Content" | fluxbase kb add abc123 --title "My Doc"
# Add from filefluxbase kb add abc123 --from-file ./doc.txt --title "Document"
# Add with metadatafluxbase 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
fluxbase kb documents
Section titled “fluxbase kb documents”List documents in a knowledge base.
fluxbase kb documents abc123fluxbase kb documents get
Section titled “fluxbase kb documents get”Get document details.
fluxbase kb documents get abc123 doc456fluxbase kb documents update
Section titled “fluxbase kb documents update”Update document metadata.
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)
fluxbase kb documents delete
Section titled “fluxbase kb documents delete”Delete a document from a knowledge base.
fluxbase kb documents delete abc123 doc456fluxbase kb documents delete-by-filter
Section titled “fluxbase kb documents delete-by-filter”Bulk delete documents by tags or metadata.
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)
fluxbase kb search
Section titled “fluxbase kb search”Search a knowledge base using semantic similarity.
fluxbase kb search abc123 "how to reset password"fluxbase kb search abc123 "pricing plans" --limit 5 --threshold 0.8Flags:
--limit- Maximum results (default: 10)--threshold- Similarity threshold 0.0-1.0 (default: 0.7)
fluxbase kb export-table
Section titled “fluxbase kb export-table”Export a database table as a document to the knowledge base. Includes schema, columns, relationships, and optional sample data.
# Export all columnsfluxbase 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 indexesfluxbase kb export-table abc123 --table products --include-fks --include-indexes --sample-rows 10Flags:
--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
fluxbase kb tables
Section titled “fluxbase kb tables”List exportable database tables.
fluxbase kb tablesfluxbase kb tables publicfluxbase kb capabilities
Section titled “fluxbase kb capabilities”Show system capabilities including supported OCR languages, file types, and features.
fluxbase kb capabilitiesfluxbase kb graph
Section titled “fluxbase kb graph”Show the knowledge graph for a knowledge base, including entities and their relationships.
fluxbase kb graph abc123fluxbase kb entities
Section titled “fluxbase kb entities”List entities extracted from the knowledge base.
fluxbase kb entities abc123fluxbase kb entities abc123 --type personfluxbase kb entities abc123 --search "John"Flags:
--type- Filter by entity type--search- Search entities by name
fluxbase kb chatbots
Section titled “fluxbase kb chatbots”List all chatbots using a knowledge base.
fluxbase kb chatbots abc123Table Commands
Section titled “Table Commands”Query and manage database tables.
# List tablesfluxbase tables list
# Describe tablefluxbase tables describe users
# Query tablefluxbase tables query usersfluxbase tables query users --select "id,email" --where "role=eq.admin" --limit 10fluxbase tables query users --order-by "created_at.desc" --offset 20 --limit 10
# Insert recordfluxbase tables insert users --data '{"email": "user@example.com"}'
# Update recordsfluxbase tables update users --where "id=eq.123" --data '{"name": "New Name"}'
# Delete recordsfluxbase tables delete users --where "id=eq.123"fluxbase tables query
Section titled “fluxbase tables query”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)
Type Generation Commands
Section titled “Type Generation Commands”Generate TypeScript type definitions from your database schema. The generated types can be used with the Fluxbase TypeScript SDK for type-safe database queries.
fluxbase types generate
Section titled “fluxbase types generate”Generate TypeScript type definitions from your database schema.
# Generate types for the public schema and write to types.tsfluxbase types generate --output types.ts
# Generate types for multiple schemasfluxbase types generate --schemas public,auth --output types.ts
# Generate types including RPC function signaturesfluxbase types generate --include-functions --output types.ts
# Generate types without viewsfluxbase types generate --include-views=false --output types.ts
# Output to stdout (for piping)fluxbase types generate
# Generate with helper functionsfluxbase types generate --format full --output types.tsFlags:
--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) orfull(with helpers)
fluxbase types list
Section titled “fluxbase types list”List all available database schemas that can be used for type generation.
fluxbase types listGraphQL Commands
Section titled “GraphQL Commands”Execute GraphQL queries and mutations against the auto-generated GraphQL API.
fluxbase graphql query
Section titled “fluxbase graphql query”Execute a GraphQL query.
# Simple queryfluxbase graphql query '{ users { id email created_at } }'
# Query with filteringfluxbase graphql query '{ users(where: {role: {_eq: "admin"}}) { id email } }'
# Query with ordering and paginationfluxbase graphql query '{ users(limit: 10, order_by: {created_at: desc}) { id email } }'
# Query from filefluxbase graphql query --file ./get-users.graphql
# Query with variablesfluxbase graphql query 'query GetUser($id: ID!) { user(id: $id) { id email } }' --var 'id=abc-123'
# Multiple variablesfluxbase graphql query 'query($limit: Int, $offset: Int) { users(limit: $limit, offset: $offset) { id } }' \ --var 'limit=10' --var 'offset=20'
# Output as JSONfluxbase graphql query '{ users { id } }' -o jsonFlags:
--file,-f- File containing the GraphQL query--var- Variables in formatname=value(can be repeated)--pretty- Pretty print JSON output (default: true)
fluxbase graphql mutation
Section titled “fluxbase graphql mutation”Execute a GraphQL mutation.
# Insert a recordfluxbase graphql mutation 'mutation { insert_users(objects: [{email: "new@example.com", name: "New User"}]) { returning { id email } }}'
# Update recordsfluxbase graphql mutation 'mutation { update_users(where: {id: {_eq: "user-id"}}, _set: {name: "Updated Name"}) { affected_rows returning { id name } }}'
# Delete recordsfluxbase graphql mutation 'mutation { delete_users(where: {id: {_eq: "user-id"}}) { affected_rows }}'
# Mutation with variablesfluxbase 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 filefluxbase graphql mutation --file ./create-user.graphql --var 'email=user@example.com'Flags:
--file,-f- File containing the GraphQL mutation--var- Variables in formatname=value(can be repeated)--pretty- Pretty print JSON output (default: true)
fluxbase graphql introspect
Section titled “fluxbase graphql introspect”Fetch and display the GraphQL schema via introspection.
# Full introspection queryfluxbase graphql introspect
# List only type namesfluxbase graphql introspect --types
# Output as JSONfluxbase graphql introspect -o jsonFlags:
--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.
RPC Commands
Section titled “RPC Commands”Manage and invoke stored procedures.
fluxbase rpc list
Section titled “fluxbase rpc list”List all RPC procedures.
fluxbase rpc listfluxbase rpc list --namespace productionfluxbase rpc get
Section titled “fluxbase rpc get”Get details of a specific procedure.
fluxbase rpc get default/calculate_totalsfluxbase rpc get default/calculate_totals --namespace productionFlags:
--namespace- Namespace (default:default)
fluxbase rpc invoke
Section titled “fluxbase rpc invoke”Invoke a stored procedure.
fluxbase rpc invoke default/calculate_totalsfluxbase rpc invoke default/process --params '{"id": 123}'fluxbase rpc invoke default/batch_update --file ./params.json --asyncfluxbase rpc invoke default/process --namespace productionFlags:
--namespace- Namespace (default:default)--params- JSON parameters to pass--file- Load parameters from file--async- Run asynchronously (returns immediately)
fluxbase rpc sync
Section titled “fluxbase rpc sync”Sync RPC procedures from SQL files in a directory.
fluxbase rpc sync --dir ./rpcfluxbase rpc sync --dir ./rpc --namespace production --dry-runFlags:
--dir- Directory containing.sqlfiles (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
Webhook Commands
Section titled “Webhook Commands”Manage webhooks for database events.
# List webhooksfluxbase webhooks list
# Get webhook detailsfluxbase webhooks get abc123
# Create webhookfluxbase webhooks create --url https://example.com/webhook --events "INSERT,UPDATE"
# Update webhookfluxbase webhooks update abc123 --url https://new-url.com/webhookfluxbase webhooks update abc123 --events "INSERT,UPDATE,DELETE"fluxbase webhooks update abc123 --enabled=false
# Test webhookfluxbase webhooks test abc123
# View deliveriesfluxbase webhooks deliveries abc123
# Delete webhookfluxbase webhooks delete abc123fluxbase webhooks create
Section titled “fluxbase webhooks create”Create a new webhook.
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,DELETEor*for all)--secret- Secret for webhook signature verification
fluxbase webhooks update
Section titled “fluxbase webhooks update”Update a webhook.
fluxbase webhooks update abc123 --url https://new-url.com/webhookfluxbase webhooks update abc123 --events "INSERT,UPDATE,DELETE"fluxbase webhooks update abc123 --enabled=falseFlags:
--url- New webhook URL--events- New comma-separated events--enabled- Enable or disable the webhook
Client Key Commands
Section titled “Client Key Commands”Manage client keys for API authentication.
# List client keysfluxbase clientkeys list
# Create client keyfluxbase clientkeys create --name "Production" --scopes "read:tables,write:tables"
# Get client key detailsfluxbase clientkeys get abc123
# Revoke client keyfluxbase clientkeys revoke abc123
# Delete client keyfluxbase clientkeys delete abc123fluxbase clientkeys create
Section titled “fluxbase clientkeys create”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)
Migration Commands
Section titled “Migration Commands”Manage database migrations.
# List migrationsfluxbase migrations list
# Get migration detailsfluxbase migrations get 001_create_users
# Create migrationfluxbase migrations create add_users_table --up-sql "CREATE TABLE users..." --down-sql "DROP TABLE users"
# Apply specific migrationfluxbase migrations apply 001_create_users
# Rollback migrationfluxbase migrations rollback 001_create_users
# Apply all pendingfluxbase migrations apply-pending
# Sync from directoryfluxbase migrations sync --dir ./migrationsfluxbase migrations list
Section titled “fluxbase migrations list”List all migrations.
fluxbase migrations listfluxbase migrations list --namespace productionFlags:
--namespace- Filter by namespace
fluxbase migrations get
Section titled “fluxbase migrations get”Get migration details.
fluxbase migrations get 001_create_usersfluxbase migrations create
Section titled “fluxbase migrations create”Create a new migration.
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)
fluxbase migrations sync
Section titled “fluxbase migrations sync”Sync migrations from a directory.
fluxbase migrations sync --dir ./migrationsfluxbase migrations sync --dir ./migrations --namespace production --no-applyFlags:
--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
Extension Commands
Section titled “Extension Commands”Manage PostgreSQL extensions.
# List extensionsfluxbase extensions list
# Get extension statusfluxbase extensions status pgvector
# Enable extensionfluxbase extensions enable pgvector
# Disable extensionfluxbase extensions disable pgvectorfluxbase extensions status
Section titled “fluxbase extensions status”Get the status of a specific extension.
fluxbase extensions status pgvectorfluxbase extensions enable
Section titled “fluxbase extensions enable”Enable a PostgreSQL extension.
fluxbase extensions enable pgvectorfluxbase extensions enable pgvector --schema vector_schemaFlags:
--schema- Schema to install the extension in (default: extension default)
Realtime Commands
Section titled “Realtime Commands”Manage realtime connections.
# Show statsfluxbase realtime stats
# Broadcast messagefluxbase realtime broadcast my-channel --message '{"type": "notification"}'fluxbase realtime broadcast my-channel --message '{"data": "value"}' --event custom-eventfluxbase realtime broadcast
Section titled “fluxbase realtime broadcast”Flags:
--message- JSON message to broadcast (required)--event- Custom event name (default:broadcast)
Settings Commands
Section titled “Settings Commands”Manage system settings.
# List settingsfluxbase settings list
# Get settingfluxbase settings get auth.signup_enabled
# Set settingfluxbase settings set auth.signup_enabled trueSettings Secrets Commands
Section titled “Settings Secrets Commands”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
fluxbase settings secrets list
Section titled “fluxbase settings secrets list”List all secrets (values are never shown).
# List system secrets (admin)fluxbase settings secrets list
# List user's own secretsfluxbase settings secrets list --userFlags:
--user- List user-specific secrets instead of system secrets
fluxbase settings secrets set
Section titled “fluxbase settings secrets set”Create or update a secret.
# 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 secretfluxbase settings secrets set my_api_key "user-key-xxx" --userfluxbase 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.
fluxbase settings secrets get
Section titled “fluxbase settings secrets get”Get metadata for a secret (the value is never returned).
# Get system secret metadatafluxbase settings secrets get stripe_api_key
# Get user secret metadatafluxbase settings secrets get my_api_key --userFlags:
--user- Get a user-specific secret instead of a system secret
fluxbase settings secrets delete
Section titled “fluxbase settings secrets delete”Delete a secret permanently.
# Delete system secretfluxbase settings secrets delete stripe_api_key
# Delete user secretfluxbase settings secrets delete my_api_key --userFlags:
--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”| Feature | fluxbase settings secrets (Recommended) | fluxbase secrets (Legacy) |
|---|---|---|
| Storage | app.settings table | functions.secrets table |
| Scopes | System, user | Global, namespace |
| User-specific | Yes (with HKDF encryption) | No |
| Version history | No | Yes |
| Access in functions | secrets.get(), secrets.getRequired() | Deno.env.get("FLUXBASE_SECRET_*") |
| Fallback | User → System automatic fallback | Namespace → Global |
Service Key Commands
Section titled “Service Key Commands”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.
fluxbase servicekeys list
Section titled “fluxbase servicekeys list”List all service keys.
fluxbase servicekeys listfluxbase servicekeys list -o jsonfluxbase servicekeys create
Section titled “fluxbase servicekeys create”Create a new service key.
fluxbase servicekeys create --name "Migrations Key" --scopes "migrations:*"fluxbase servicekeys create --name "Production" --rate-limit-per-hour 100fluxbase servicekeys create --name "CI/CD" --scopes "*" --expires 2025-12-31T23:59:59ZFlags:
--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)
fluxbase servicekeys get
Section titled “fluxbase servicekeys get”Get details of a specific service key.
fluxbase servicekeys get abc123fluxbase servicekeys update
Section titled “fluxbase servicekeys update”Update a service key’s properties.
fluxbase servicekeys update abc123 --name "New Name"fluxbase servicekeys update abc123 --rate-limit-per-hour 200fluxbase servicekeys update abc123 --enabled=falseFlags:
--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)
fluxbase servicekeys disable
Section titled “fluxbase servicekeys disable”Disable a service key (keeps the record but prevents use).
fluxbase servicekeys disable abc123fluxbase servicekeys enable
Section titled “fluxbase servicekeys enable”Enable a previously disabled service key.
fluxbase servicekeys enable abc123fluxbase servicekeys delete
Section titled “fluxbase servicekeys delete”Delete a service key permanently.
fluxbase servicekeys delete abc123fluxbase servicekeys revoke
Section titled “fluxbase servicekeys revoke”Emergency revoke a service key immediately. This action is irreversible.
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.
fluxbase servicekeys deprecate
Section titled “fluxbase servicekeys deprecate”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.
fluxbase servicekeys deprecate abc123 --grace-period 24hfluxbase 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
fluxbase servicekeys rotate
Section titled “fluxbase servicekeys rotate”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.
fluxbase servicekeys rotate abc123 --grace-period 24hfluxbase servicekeys rotate abc123 --grace-period 7dFlags:
--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.
fluxbase servicekeys revocations
Section titled “fluxbase servicekeys revocations”View the revocation audit log for a service key.
fluxbase servicekeys revocations abc123Shows all revocation events including emergency revocations, rotations, and expirations.
Config Commands
Section titled “Config Commands”Manage CLI configuration.
# Initialize configfluxbase config init
# View configfluxbase config view
# Get config valuefluxbase config get defaults.output
# Set config valuefluxbase config set defaults.output json
# List profilesfluxbase config profiles
# Add profilefluxbase config profiles add staging
# Remove profilefluxbase config profiles remove stagingfluxbase config get
Section titled “fluxbase config get”Get a specific config value.
fluxbase config get defaults.outputfluxbase config get current_profileSecrets Commands (Legacy)
Section titled “Secrets Commands (Legacy)”The legacy fluxbase secrets commands manage namespace-scoped secrets stored in the functions.secrets table.
fluxbase secrets list
Section titled “fluxbase secrets list”List all secrets (values are never shown).
fluxbase secrets listfluxbase secrets list --scope globalfluxbase secrets list --namespace my-namespaceFlags:
--scope- Filter by scope (globalornamespace)--namespace- Filter by namespace
fluxbase secrets set
Section titled “fluxbase secrets set”Create or update a secret.
fluxbase secrets set API_KEY "my-secret-key"fluxbase secrets set DATABASE_URL "postgres://..." --scope namespace --namespace my-nsfluxbase secrets set TEMP_KEY "value" --expires 30dFlags:
--scope- Secret scope:global(default) ornamespace--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().
fluxbase secrets get
Section titled “fluxbase secrets get”Get metadata for a secret (the value is never returned).
fluxbase secrets get API_KEYfluxbase secrets get DATABASE_URL --namespace my-namespacefluxbase secrets delete
Section titled “fluxbase secrets delete”Delete a secret permanently.
fluxbase secrets delete API_KEYfluxbase secrets delete DATABASE_URL --namespace my-namespacefluxbase secrets history
Section titled “fluxbase secrets history”Show version history for a secret.
fluxbase secrets history API_KEYfluxbase secrets history DATABASE_URL --namespace my-namespacefluxbase secrets rollback
Section titled “fluxbase secrets rollback”Rollback a secret to a previous version.
fluxbase secrets rollback API_KEY 2fluxbase secrets rollback DATABASE_URL 1 --namespace my-namespaceLogs Commands
Section titled “Logs Commands”Query and stream logs from the central logging system.
fluxbase logs list
Section titled “fluxbase logs list”List logs with filters.
fluxbase logs listfluxbase logs list --category system --level errorfluxbase logs list --since 1h --search "database"fluxbase logs list --category execution --limit 50fluxbase logs list --user-id abc123 -o jsonFlags:
--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)
fluxbase logs tail
Section titled “fluxbase logs tail”Tail logs in real-time.
fluxbase logs tailfluxbase logs tail --category securityfluxbase logs tail --level errorfluxbase logs tail --category system --component authFlags:
--category- Filter by category--level- Filter by level--component- Filter by component--lines- Number of initial lines to show (default: 20)
fluxbase logs stats
Section titled “fluxbase logs stats”Show log statistics.
fluxbase logs statsfluxbase logs stats -o jsonfluxbase logs execution
Section titled “fluxbase logs execution”View logs for a specific function, job, or RPC execution.
fluxbase logs execution abc123-def456fluxbase logs execution abc123-def456 -o jsonfluxbase logs execution abc123-def456 --followfluxbase logs execution abc123-def456 --tail 50Flags:
--follow,-f- Stream new log entries in real-time--tail- Show only last N lines
MCP Commands
Section titled “MCP Commands”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.
fluxbase mcp tools list
Section titled “fluxbase mcp tools list”List all custom MCP tools.
fluxbase mcp tools listfluxbase mcp tools list --namespace productionfluxbase mcp tools list -o jsonFlags:
--namespace- Filter by namespace
fluxbase mcp tools get
Section titled “fluxbase mcp tools get”Get details of a specific custom MCP tool.
fluxbase mcp tools get weather_forecastfluxbase mcp tools get weather_forecast -o jsonfluxbase mcp tools create
Section titled “fluxbase mcp tools create”Create a new custom MCP tool.
fluxbase mcp tools create weather_forecast --code ./weather.tsfluxbase mcp tools create weather_forecast --code ./weather.ts --description "Get weather forecast"fluxbase mcp tools create weather_forecast --code ./weather.ts --timeout 60 --memory 256Flags:
--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
fluxbase mcp tools update
Section titled “fluxbase mcp tools update”Update an existing custom MCP tool.
fluxbase mcp tools update weather_forecast --code ./weather.tsfluxbase mcp tools update weather_forecast --timeout 60Flags:
--code- Path to TypeScript code file--namespace- Namespace (default:default)--description- Tool description--timeout- Execution timeout in seconds--memory- Memory limit in MB
fluxbase mcp tools delete
Section titled “fluxbase mcp tools delete”Delete a custom MCP tool.
fluxbase mcp tools delete weather_forecastfluxbase mcp tools sync
Section titled “fluxbase mcp tools sync”Sync custom MCP tools from a directory to the server.
fluxbase mcp tools sync # Auto-detect directoryfluxbase mcp tools sync --dir ./mcp-toolsfluxbase mcp tools sync --dir ./mcp-tools --namespace productionfluxbase mcp tools sync --dry-runFlags:
--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-netfluxbase mcp tools test
Section titled “fluxbase mcp tools test”Test a custom MCP tool by invoking it with sample arguments.
fluxbase mcp tools test weather_forecast --args '{"location": "New York"}'Flags:
--args- JSON arguments to pass to the tool (default:{})--namespace- Namespace (default:default)
Sync Command
Section titled “Sync Command”Unified sync for all resource types.
fluxbase sync
Section titled “fluxbase sync”Sync all Fluxbase resources from a directory structure.
fluxbase sync # Auto-detect from ./fluxbase/ or current dirfluxbase sync --dir ./src # Specify root directoryfluxbase sync --namespace production # Apply namespace to allfluxbase sync --dry-run # Preview all changesfluxbase sync --keep # Keep resources not in directoryfluxbase sync --analyze # Analyze bundle sizesfluxbase sync --analyze --verbose # Detailed analysisFlags:
--dir- Root directory (default:./fluxbaseor 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
Branch Commands
Section titled “Branch Commands”Manage database branches for isolated development and testing environments. See the Database Branching Guide for full documentation.
fluxbase branch list
Section titled “fluxbase branch list”List all database branches.
fluxbase branch listfluxbase branch list --type previewfluxbase branch list --minefluxbase branch list -o jsonFlags:
--type- Filter by branch type (main,preview,persistent)--mine,-m- Show only branches created by you
fluxbase branch get
Section titled “fluxbase branch get”Get details of a specific branch.
fluxbase branch get my-featurefluxbase branch get pr-123fluxbase branch get 550e8400-e29b-41d4-a716-446655440000fluxbase branch create
Section titled “fluxbase branch create”Create a new database branch.
# Basic branchfluxbase branch create my-feature
# With full data clonefluxbase branch create staging --clone-data full_clone
# Persistent branch (not auto-deleted)fluxbase branch create staging --type persistent
# Branch with expirationfluxbase branch create temp-test --expires-in 24h
# Branch linked to GitHub PRfluxbase branch create pr-123 --pr 123 --repo owner/repo
# Branch from another branchfluxbase branch create feature-b --from feature-aFlags:
--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-featureDatabase: branch_my_featureStatus: ready
To use this branch: Header: X-Fluxbase-Branch: my-feature Query: ?branch=my-feature SDK: { branch: 'my-feature' }fluxbase branch delete
Section titled “fluxbase branch delete”Delete a database branch and its associated database.
fluxbase branch delete my-featurefluxbase branch delete pr-123 --forceFlags:
--force,-f- Skip confirmation prompt
fluxbase branch reset
Section titled “fluxbase branch reset”Reset a branch to its parent state, recreating the database.
fluxbase branch reset my-featurefluxbase branch reset pr-123 --forceFlags:
--force,-f- Skip confirmation prompt
This drops the branch database and recreates it from the parent branch. All changes are lost.
fluxbase branch status
Section titled “fluxbase branch status”Show the current status of a branch.
fluxbase branch status my-featureOutput shows the branch name, slug, and current status (creating, ready, migrating, error, deleting).
fluxbase branch activity
Section titled “fluxbase branch activity”Show the activity log for a branch.
fluxbase branch activity my-featurefluxbase branch activity pr-123 --limit 20Flags:
--limit,-n- Maximum number of entries to show (default: 50)
fluxbase branch stats
Section titled “fluxbase branch stats”Show connection pool statistics for all branches.
fluxbase branch statsUseful for debugging and monitoring database connections across branches.
fluxbase branch use
Section titled “fluxbase branch use”Set the default branch for all subsequent CLI commands. This saves the branch to your profile config.
fluxbase branch use my-featurefluxbase branch use pr-123fluxbase branch use main # Reset to main branchAfter setting a default branch, all CLI commands will automatically use that branch without needing to specify it each time.
fluxbase branch current
Section titled “fluxbase branch current”Show the current default branch set for CLI commands.
fluxbase branch currentAdmin Commands
Section titled “Admin Commands”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.
Admin User Commands
Section titled “Admin User Commands”fluxbase admin users list
Section titled “fluxbase admin users list”List all admin/dashboard users.
fluxbase admin users listfluxbase admin users list -o jsonfluxbase admin users get
Section titled “fluxbase admin users get”Get details of a specific admin user.
fluxbase admin users get 550e8400-e29b-41d4-a716-446655440000fluxbase admin users invite
Section titled “fluxbase admin users invite”Invite a new admin user via email.
fluxbase admin users invite --email admin@example.comfluxbase admin users invite --email admin@example.com --role dashboard_adminFlags:
--email- Email address to invite (required)--role- Role for the new user:dashboard_user(default) ordashboard_admin
fluxbase admin users delete
Section titled “fluxbase admin users delete”Delete an admin user.
fluxbase admin users delete 550e8400-e29b-41d4-a716-446655440000fluxbase admin users delete 550e8400-e29b-41d4-a716-446655440000 --forceFlags:
--force,-f- Skip confirmation prompt
Admin Invitation Commands
Section titled “Admin Invitation Commands”fluxbase admin invitations list
Section titled “fluxbase admin invitations list”List pending and accepted admin invitations.
fluxbase admin invitations listfluxbase admin invitations list --include-acceptedfluxbase admin invitations list --include-expiredFlags:
--include-accepted- Include accepted invitations--include-expired- Include expired invitations
fluxbase admin invitations revoke
Section titled “fluxbase admin invitations revoke”Revoke a pending admin invitation.
fluxbase admin invitations revoke abc123def456fluxbase admin invitations revoke abc123def456 --forceFlags:
--force,-f- Skip confirmation prompt
Admin Session Commands
Section titled “Admin Session Commands”fluxbase admin sessions list
Section titled “fluxbase admin sessions list”List all active admin sessions.
fluxbase admin sessions listfluxbase admin sessions list -o jsonfluxbase admin sessions revoke
Section titled “fluxbase admin sessions revoke”Revoke a specific admin session.
fluxbase admin sessions revoke 550e8400-e29b-41d4-a716-446655440000Flags:
--force,-f- Skip confirmation prompt
fluxbase admin sessions revoke-all
Section titled “fluxbase admin sessions revoke-all”Revoke all sessions for a specific admin user.
fluxbase admin sessions revoke-all 550e8400-e29b-41d4-a716-446655440000fluxbase admin sessions revoke-all 550e8400-e29b-41d4-a716-446655440000 --forceFlags:
--force,-f- Skip confirmation prompt
Admin Password Reset
Section titled “Admin Password Reset”fluxbase admin password-reset
Section titled “fluxbase admin password-reset”Send a password reset email to an admin user.
fluxbase admin password-reset --email admin@example.comFlags:
--email- Email address of the admin user (required)
User Commands
Section titled “User Commands”Manage application users (end users of your application). For admin/dashboard users, use fluxbase admin users instead.
fluxbase users list
Section titled “fluxbase users list”List all application users.
fluxbase users listfluxbase users list -o jsonfluxbase users list --search johnFlags:
--search- Search users by email
fluxbase users get
Section titled “fluxbase users get”Get details of a specific application user.
fluxbase users get 550e8400-e29b-41d4-a716-446655440000fluxbase users invite
Section titled “fluxbase users invite”Invite a new application user via email.
fluxbase users invite --email user@example.comFlags:
--email- Email address to invite (required)
fluxbase users delete
Section titled “fluxbase users delete”Delete an application user.
fluxbase users delete 550e8400-e29b-41d4-a716-446655440000fluxbase users delete 550e8400-e29b-41d4-a716-446655440000 --forceFlags:
--force,-f- Skip confirmation prompt
Version Command
Section titled “Version Command”fluxbase version
Section titled “fluxbase version”Show CLI version information.
fluxbase versionCompletion Command
Section titled “Completion Command”fluxbase completion
Section titled “fluxbase completion”Generate shell completion scripts for bash, zsh, fish, and powershell.
# Bashfluxbase completion bash > /etc/bash_completion.d/fluxbase
# Zshfluxbase completion zsh > "${fpath[1]}/_fluxbase"
# Fishfluxbase completion fish > ~/.config/fish/completions/fluxbase.fish
# PowerShellfluxbase completion powershell > ~/.config/powershell/completions/fluxbase.ps1After installation, restart your shell or source the completion file to enable autocompletion.
Command Aliases
Section titled “Command Aliases”Many commands have shorter aliases for convenience:
| Command | Aliases |
|---|---|
admin | adm |
branch | branches, br |
chatbots | chatbot, cb |
clientkeys | clientkey, keys |
extensions | extension, ext |
functions | fn, function |
graphql | gql |
jobs | job |
kb | knowledge-bases, knowledge-base |
logs | log |
migrations | migration, migrate |
realtime | rt |
secrets | secret |
servicekeys | servicekey, sk |
tables | table, db |
users | user |
webhooks | webhook, wh |
Examples:
fluxbase fn list # Same as fluxbase functions listfluxbase br create test # Same as fluxbase branch create testfluxbase rt stats # Same as fluxbase realtime stats