Skip to content

CLI Getting Started

This guide walks you through authenticating and using the Fluxbase CLI. Make sure you’ve installed the CLI first.

Before using the CLI, you need to authenticate with your Fluxbase server.

The simplest way to login:

Terminal window
fluxbase auth login

You’ll be prompted for:

  • Server URL: Your Fluxbase server (e.g., https://api.example.com)
  • Email: Your account email
  • Password: Your account password

If your account has 2FA enabled, you’ll be prompted for a verification code after entering your password:

Enter 2FA code: 123456

The CLI supports both TOTP (authenticator app) and email-based verification codes.

For scripts and CI/CD:

Terminal window
# With email/password
fluxbase auth login \
--server https://api.example.com \
--email user@example.com \
--password "your-password"
# With API token
fluxbase auth login \
--server https://api.example.com \
--token "your-api-token"

You can also use environment variables:

Terminal window
export FLUXBASE_SERVER="https://api.example.com"
export FLUXBASE_TOKEN="your-api-token"
# Now commands will use these credentials
fluxbase functions list
Terminal window
fluxbase auth status

This shows all configured profiles and their authentication status.

The CLI supports multiple profiles for different environments:

Terminal window
# Login to different environments with named profiles
fluxbase auth login --profile dev --server http://localhost:8080
fluxbase auth login --profile staging --server https://staging.example.com
fluxbase auth login --profile prod --server https://api.example.com
# Switch between profiles
fluxbase auth switch prod
# Use a specific profile for a command
fluxbase --profile staging functions list
Terminal window
fluxbase functions list
Terminal window
fluxbase functions create my-function --code ./function.ts
Terminal window
fluxbase jobs submit process-data --payload '{"file": "data.csv"}'
Terminal window
fluxbase storage objects upload my-bucket images/photo.jpg ./photo.jpg
Terminal window
fluxbase tables query users --where "role=eq.admin" --limit 10

The CLI supports multiple output formats:

Terminal window
# Table format (default)
fluxbase functions list
# JSON format
fluxbase functions list -o json
# YAML format
fluxbase functions list -o yaml
# Quiet mode (minimal output)
fluxbase functions list -q

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

Choose your path based on what you want to do:

Terminal window
# Create a function
echo 'export default (req) => new Response("Hello!")' > hello.ts
fluxbase functions create hello --code ./hello.ts
# Test it
fluxbase functions invoke hello

See Command Reference - Functions for more.

Terminal window
# List your tables
fluxbase tables list
# Query data
fluxbase tables query users --select "id,email" --limit 10
# Insert a record
fluxbase tables insert users --data '{"email": "new@example.com"}'

See Command Reference - Tables for more.

Configure automated deployments using environment variables and the sync command.

See Workflows for GitHub Actions and GitLab CI examples.

Set up profiles for dev, staging, and production servers.

See Configuration for profile management.