CLI Reference
Install the Flect CLI:
npm install -g @flect/cliAuthentication
Section titled “Authentication”flect login
Section titled “flect login”Authenticate with your Flect account.
flect loginOpens a browser window. After sign-in, the token is saved to ~/.config/flect/config.json.
flect logout
Section titled “flect logout”Remove saved credentials.
flect logoutContext
Section titled “Context”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.
flect org use my-orgflect ws use defaultflect proj use myprojectflect env use productionOrganizations
Section titled “Organizations”flect org create
Section titled “flect org create”flect org create --name <name>flect org list
Section titled “flect org list”flect org listflect org use
Section titled “flect org use”Set the active organization.
flect org use <name-or-id>Workspaces
Section titled “Workspaces”Workspaces live inside an org. Use them to group projects (e.g. by team or product line).
flect ws create
Section titled “flect ws create”flect ws create --name <name>flect ws list
Section titled “flect ws list”flect ws listflect ws use
Section titled “flect ws use”flect ws use <name-or-id>Projects
Section titled “Projects”flect proj create
Section titled “flect proj create”flect proj create --name <name>flect proj list
Section titled “flect proj list”flect proj listflect proj use
Section titled “flect proj use”flect proj use <name-or-id>Environments
Section titled “Environments”Environments live inside a project. Typical names: production, staging, preview.
flect env create
Section titled “flect env create”flect env create --name <name>flect env list
Section titled “flect env list”flect env listflect env use
Section titled “flect env use”flect env use <name-or-id>Databases
Section titled “Databases”Flect databases are isolated SQLite instances powered by sqld. Each database gets its own namespace — no data leaks between apps.
flect db create
Section titled “flect db create”flect db create --name <name>flect db list
Section titled “flect db list”flect db listflect db migrate
Section titled “flect db migrate”Run SQL migration files against a database. Migration names are tracked — already-applied files are skipped.
flect db migrate <name-or-id> --dir ./migrationsMigration files must be .sql files. They are applied in alphabetical order.
migrations/ 0001_create_users.sql 0002_add_posts.sqlflect db delete
Section titled “flect db delete”flect db delete <name-or-id>KV Stores
Section titled “KV Stores”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.
flect kv create
Section titled “flect kv create”flect kv create --name <name>flect kv list
Section titled “flect kv list”flect kv listflect kv delete
Section titled “flect kv delete”flect kv delete <name-or-id>flect app create
Section titled “flect app create”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 |
flect app list
Section titled “flect app list”flect app listflect app get
Section titled “flect app get”flect app get <name-or-id>flect app deploy
Section titled “flect app deploy”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.
flect app deploy <name-or-id> --image <image:tag>What happens:
- CLI reads
flect.tomlfor[[databases]]and[[kv]]binding names - API generates a
FLECT_TOKENfor the app (or reuses the existing one) - A Nomad job is submitted with all env vars injected
- Traefik picks up the new service from Consul, issues a TLS cert if needed
- Your app is live at
https://<name>-<shortid>.up.flect.run
flect app delete
Section titled “flect app delete”flect app delete <name-or-id>Deployments
Section titled “Deployments”flect deployment list / flect app deployment list
Section titled “flect deployment list / flect app deployment list”Show deployment history for an app.
flect deployment --app <name-or-id># orflect app deployment --app <name-or-id>flect deployment get
Section titled “flect deployment get”Show details of a specific deployment.
flect app deployment get <deployment-id> --app <name-or-id>Global flags
Section titled “Global flags”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 |