Skip to content

CLI Reference

Install the Flect CLI:

Terminal window
npm install -g @flect/cli

Authenticate with your Flect account.

Terminal window
flect login

Opens a browser window. After sign-in, the token is saved to ~/.config/flect/config.json.

Remove saved credentials.

Terminal window
flect logout

The CLI remembers your active org, workspace, project, and environment. Most commands use these automatically — you can override any of them with --org, --ws, --proj, --env flags.

Terminal window
flect org use my-org
flect ws use default
flect proj use myproject
flect env use production

Terminal window
flect org create --name <name>
Terminal window
flect org list

Set the active organization.

Terminal window
flect org use <name-or-id>

Workspaces live inside an org. Use them to group projects (e.g. by team or product line).

Terminal window
flect ws create --name <name>
Terminal window
flect ws list
Terminal window
flect ws use <name-or-id>

Terminal window
flect proj create --name <name>
Terminal window
flect proj list
Terminal window
flect proj use <name-or-id>

Environments live inside a project. Typical names: production, staging, preview.

Terminal window
flect env create --name <name>
Terminal window
flect env list
Terminal window
flect env use <name-or-id>

Flect databases are isolated SQLite instances powered by sqld. Each database gets its own namespace — no data leaks between apps.

Terminal window
flect db create --name <name>
Terminal window
flect db list

Run SQL migration files against a database. Migration names are tracked — already-applied files are skipped.

Terminal window
flect db migrate <name-or-id> --dir ./migrations

Migration files must be .sql files. They are applied in alphabetical order.

migrations/
0001_create_users.sql
0002_add_posts.sql
Terminal window
flect db delete <name-or-id>

Flect KV stores are isolated namespaces on a shared Valkey (Redis-compatible) cluster. Each store has a unique key prefix — keys from one app are invisible to others.

Terminal window
flect kv create --name <name>
Terminal window
flect kv list
Terminal window
flect kv delete <name-or-id>

Terminal window
flect app create --name <name>

Creates the app record and reserves a hostname: <name>-<shortid>.up.flect.run.

Options:

Flag Default Description
--cpu <mhz> 256 CPU allocation in MHz
--mem <mb> 256 Memory allocation in MB
--replicas <n> 1 Number of instances
Terminal window
flect app list
Terminal window
flect app get <name-or-id>

Deploy a container image. Run this from the directory containing flect.toml — the CLI reads binding names from it and maps them to the correct env vars.

Terminal window
flect app deploy <name-or-id> --image <image:tag>

What happens:

  1. CLI reads flect.toml for [[databases]] and [[kv]] binding names
  2. API generates a FLECT_TOKEN for the app (or reuses the existing one)
  3. A Nomad job is submitted with all env vars injected
  4. Traefik picks up the new service from Consul, issues a TLS cert if needed
  5. Your app is live at https://<name>-<shortid>.up.flect.run
Terminal window
flect app delete <name-or-id>

flect deployment list / flect app deployment list

Section titled “flect deployment list / flect app deployment list”

Show deployment history for an app.

Terminal window
flect deployment --app <name-or-id>
# or
flect app deployment --app <name-or-id>

Show details of a specific deployment.

Terminal window
flect app deployment get <deployment-id> --app <name-or-id>

Most commands accept:

Flag Description
--org <slug> Override active org
--ws <slug> Override active workspace
--proj <slug> Override active project
--env <slug> Override active environment
--output json Output as JSON (default: table)
--wide Show extra columns in table output