Lux Docs

Build on Lux without guessing.

Lux Cloud + OSS core

Product docs for the Lux runtime: tables, cache, vectors, realtime, time series, auth, HTTP, SDK, CLI, and self-hosting.

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.

Install
curl -fsSL https://luxdb.dev/install.sh | sh

GitHub 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.

Login
lux login

This prompts for your token and stores it locally. To log out:

Logout
lux logout

Commands

CommandDescription
initCreate local Lux project files: migrations, seed file, and env example.
loginAuthenticate with your API token
logoutClear stored credentials
link <project>Set the default project for commands in the current directory.
projectsList 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/revokeManage 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:

Config path
~/.lux/config.json

Environment variables

VariableDescription
LUX_API_URLOverride the default API endpoint
LUX_PROJECT_IDProject selected by lux env pull for app code.

Examples

Initialize a Lux project

Init
lux init

# creates:
# lux/migrations/
# lux/seed.lux
# .env.example

Create and connect to a project

Create + connect
lux login
lux create my-app --accept-charges
lux link my-app
lux env pull
lux connect

Pull 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.

Environment
lux link my-app
lux env pull

# or write to a custom path
lux env pull --output .env.development

Run commands remotely

Exec
lux exec my-app SET greeting "hello world"
lux exec my-app GET greeting
lux exec my-app "KEYS *"

Monitor and manage

Operations
lux status my-app
lux logs my-app -l 100
lux restart my-app

Migrations

Manage schema changes with versioned migration files. Migrations are .lux files stored in lux/migrations/ and executed line-by-line against your project.

Migrations
# 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 6379

The 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.

Seeds
# 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.lux

Project keys

Publishable keys are for browser/client gateway requests. Secret keys are for trusted server code only.

Keys
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

Local connect
lux connect lux://localhost:6379
lux connect --host 192.168.1.50 --port 6379