Skip to content

CLI Reference

The fluxui command-line tool is installed automatically with the package.

Usage: fluxui [OPTIONS] COMMAND [ARGS]...

  FluxUI — reactive Python web UI framework

Options:
  --help  Show this message and exit.

Commands:
  export-docker  Generate Dockerfile + docker-compose.yml.
  new            Scaffold a new FluxUI project.
  run            Start the FluxUI development server.

fluxui run

Start the development server with hot-reload.

Usage: fluxui run [OPTIONS] [APP_FILE]

  Start the FluxUI development server.

Arguments:
  APP_FILE  Python file containing a FluxApp  [default: app.py]

Options:
  -p, --port INTEGER   Port to bind  [default: 8000]
  --host TEXT          Host to bind  [default: 127.0.0.1]
  --share              Open a public tunnel URL
  --prod               Disable debug mode and hot-reload
  --no-reload          Disable hot-reload
  --no-open            Do not open browser on startup
  --help               Show this message and exit.

Examples

# Start with defaults (app.py, port 8000, hot-reload enabled)
fluxui run

# Start a specific file on a custom port
fluxui run my_dashboard.py --port 5000

# Bind to all interfaces (useful inside Docker or a VM)
fluxui run app.py --host 0.0.0.0 --port 8000

# Production mode — disables debug overlay and hot-reload
fluxui run app.py --prod

# Open a public tunnel so you can share a link with someone
fluxui run app.py --share

# CI/headless environment — don't try to open a browser
fluxui run app.py --no-open

Hot-reload

By default, fluxui run watches the directory containing your app file using watchfiles. When any .py file changes, the server restarts automatically and the browser reconnects via WebSocket.

Hot-reload requires watchfiles:

pip install watchfiles
# or
pip install "fluxui[dev]"

If watchfiles is not installed, FluxUI runs without hot-reload and prints a warning.

--share

Creates a temporary public HTTPS tunnel URL powered by localtunnel. Anyone with the URL can access your app from the internet.

Requires the share extra:

pip install "fluxui[share]"

fluxui new

Scaffold a new FluxUI project in a new directory.

Usage: fluxui new [OPTIONS] NAME

  Scaffold a new FluxUI project.

Arguments:
  NAME  Project directory name  [required]

Options:
  --help  Show this message and exit.

Example

fluxui new my_dashboard
cd my_dashboard
pip install fluxui
fluxui run app.py

Generated files:

my_dashboard/
├── app.py          — working counter demo, ready to run
├── pyproject.toml  — project metadata with fluxui dependency
├── .gitignore      — standard Python gitignore
└── README.md       — basic readme

Generated app.py:

import fluxui as ui

app = ui.App("my_dashboard")

@app.page("/")
def home(session):
    count = ui.state(0)

    with ui.Column(gap="md"):
        ui.Heading("Hello from FluxUI", level=1)
        ui.Button("Click me", on_click=lambda: count.set(count.value + 1))
        ui.Text(lambda: f"Clicked {count.value} times")

if __name__ == "__main__":
    app.run(port=8000)

fluxui export-docker

Generate a Dockerfile and docker-compose.yml for containerising your app.

Usage: fluxui export-docker [OPTIONS] [APP_FILE]

  Generate Dockerfile + docker-compose.yml.

Arguments:
  APP_FILE  Python file to containerise  [default: app.py]

Options:
  -o, --output TEXT    Output directory  [default: .]
  -p, --port INTEGER   [default: 8000]
  --help               Show this message and exit.

Example

fluxui export-docker app.py --port 8000

# With custom output directory
fluxui export-docker app.py --output ./deploy

This generates:

./
├── Dockerfile
└── docker-compose.yml

See Deployment for the full Docker workflow.