CLI
Use lux for Lux Cloud projects, migrations, remote commands, and
interactive connections to Lux instances.
What the CLI is for
The CLI is the operational interface to Lux Cloud, but it also works with direct Lux connections. Use it when you want one tool for project management, migrations, command execution, and shell access.
Install
Quick install
Detects your OS and architecture automatically, downloads the latest release, and installs to /usr/local/bin.
curl -fsSL https://luxdb.dev/install.sh | shGitHub releases
Or download pre-built binaries directly from the GitHub releases page. Binaries are available for macOS (ARM, x86) and Linux (ARM, x86).
Authentication
Log in with an API token from your tokens page.
lux loginThis prompts for your token and stores it locally. To log out:
lux logoutCommands
| Command | Description |
|---|---|
init | Create local Lux project files: migrations, seed file, and env example. |
login | Authenticate with your API token |
logout | Clear stored credentials |
link <project> | Set the default project for commands in the current directory. |
projects | List all your projects |
create <name> | Create a new project. Use --accept-charges to skip confirmation. |
status <name> | Show project status, connection info, and resource usage |
exec <name> <cmd> | Execute a Lux command remotely. Quote wildcards to prevent shell expansion. |
logs <name> | Tail project logs. Use -l to set line count. |
restart <name> | Restart a project |
destroy <name> | Permanently delete a project and all its data. Requires --accept-consequences. |
connect <target> | Open an interactive Lux shell. Accepts a project name, lux:// URL,
or --host / --port flags. |
env pull [project] | Write app environment variables for the linked or specified project. |
keys list/create/revoke | Manage Cloud gateway publishable and secret project keys. |
migrate new <name> | Create a new migration file in lux/migrations/. |
migrate status [target] | Show which migrations are applied vs pending. Target is a project name, lux:// URL, or --host / --port.
Defaults to localhost. |
migrate run [target] | Run all pending migrations. Same target options as status. |
seed run [target] | Run commands from lux/seed.lux or a custom seed file. |
Configuration
Credentials and settings are stored at:
~/.lux/config.jsonEnvironment variables
| Variable | Description |
|---|---|
LUX_API_URL | Override the default API endpoint |
LUX_PROJECT_ID | Project selected by lux env pull for app code. |
Examples
Initialize a Lux project
lux init
# creates:
# lux/migrations/
# lux/seed.lux
# .env.exampleCreate and connect to a project
lux login
lux create my-app --accept-charges
lux link my-app
lux env pull
lux connectPull app environment
lux env pull writes the project URL, auth URL, publishable key,
secret key, and direct Lux URL into an env file for app development.
lux link my-app
lux env pull
# or write to a custom path
lux env pull --output .env.developmentRun commands remotely
lux exec my-app SET greeting "hello world"
lux exec my-app GET greeting
lux exec my-app "KEYS *"Monitor and manage
lux status my-app
lux logs my-app -l 100
lux restart my-appMigrations
Manage schema changes with versioned migration files. Migrations are .lux files stored in lux/migrations/ and executed line-by-line against your
project.
# create and edit a migration
lux migrate new create_users
# edit lux/migrations/20260403_create_users.lux
# run against local instance (default localhost:6379)
lux migrate run
lux migrate status
# run against a cloud project
lux migrate run my-app
# run with a connection string
lux migrate run lux://:password@myhost:6379
# run against a specific host
lux migrate run --host 10.0.0.5 --port 6379The migration tracker uses Lux tables under the hood, so lux migrate stays aligned with the table engine rather than a separate schema tool.
Seeds
Seeds are regular Lux command files, useful for local fixtures and demo data.
# default file: lux/seed.lux
lux seed run
# cloud project or direct URL
lux seed run my-app
lux seed run lux://:password@localhost:6379
# custom seed file
lux seed run --file lux/dev.seed.luxProject keys
Publishable keys are for browser/client gateway requests. Secret keys are for trusted server code only.
lux keys list
lux keys create --kind publishable --name "Browser client"
lux keys create --kind secret --name "Backend worker"
lux keys revoke key_...Connect to a local instance
lux connect lux://localhost:6379
lux connect --host 192.168.1.50 --port 6379