CLI Reference

Invocation

lucihub [GLOBAL OPTIONS] <COMMAND> [ARGS] [OPTIONS]

Run lucihub --help to see the list of all commands. Authentication is read from the LUCIHUB_API_KEY environment variable; the CLI exits with an error if the variable is unset or empty. For details on the individual options, see below.

Global options

Option Type Default Description
-u, --base-url string https://redac.anabrid.com Base URL of the LuciHub API server.
--timeout float 30.0 Per-request HTTP timeout in seconds.

Top-level commands

Command Purpose
status Show deployment info and all registered devices.
info Show details for a single device, optionally save its entity blob.
compile Compile an analang ODE to a device-specific module.
run Execute a compiled module on a device.
task Subgroup for task lifecycle operations; [ARGS] must contain a subcommand identifying the actual functionality.

lucihub status

Synopsis: lucihub status

This command takes no arguments and no options beyond the globals. It prints the deployment domain, software version, uptime, and a table of devices showing Name, Type, Status, and Queue Length.


lucihub info

Synopsis: lucihub info DEVICE_NAME [--short] [--save-entity PATH]

Argument / option Type Default Description
DEVICE_NAME string Name of a registered device (positional, required).
--short flag off Suppress the entity tree; print only the summary table.
--save-entity path Write the raw protobuf entity blob to this path for later use as a MODULE_FILE.

By default the command prints the summary table followed by the pybrid entity tree. SIMULATOR devices never render an entity tree (their entity is null), so --short is a silent no-op on them.


lucihub compile

Synopsis: lucihub compile ODE_FILE [MODULE_FILE] [OPTIONS]

Argument / option Type Default Description
ODE_FILE path Analang source file (positional, required).
MODULE_FILE path Device entity blob from lucihub info … --save-entity. Mutually exclusive with --device.
--device string Pick a device by name; the CLI fetches its entity blob and infers the backend. Mutually exclusive with MODULE_FILE.
--backend LUCIDAC | REDAC LUCIDAC when MODULE_FILE is supplied Target device family. Not allowed together with --device. SIMULATOR is rejected.
--k0 int none Time-scale factor override; falls through to the compiler default when omitted.
-o, --output path stdout-summary Where to save the compiled APB bytes. Without it, only a byte-count summary is printed.
--follow / --no-follow flag --follow Wait for the task to finish. With --no-follow, only the task UUID is emitted on stdout.

Exactly one of MODULE_FILE or --device is required. With --follow (the default), the CLI prints the submission status, polls the task to completion, dumps the logs, and then writes (or summarises) the compiled module.


lucihub run

Synopsis: lucihub run MODULE_FILE [OPTIONS]

Argument / option Type Default Description
MODULE_FILE path Compiled APB blob (positional, required).
--sample-rate int 10000 ADC samples per second.
--op-time float 0.1 Wall-clock integration time in seconds (virtual seconds for SIMULATOR).
--device string first available LUCIDAC Target device name. If omitted, the first device whose name contains "lucidac" and is available is used.
-o, --output path Write the JSON result to this path.
--follow / --no-follow flag --follow Wait for the task; with --no-follow, only the UUID is emitted.

With --follow, the CLI prints the submission status, polls to completion, dumps the logs, and on success either prints the result or writes it to --output.


lucihub task subgroup

All task subcommands take a TASK_ID (UUID, positional) unless noted, and they honour the global -u/--timeout options.

Subcommand Purpose
task list List tasks visible to the current API key. Supports --state, --type, --limit, --offset, --ids-only, --format text\|json.
task info Detailed view of a single task (type, state, parameters, blob availability). --format text\|json.
task status Current state plus state-history table for a task. --format text\|json.
task logs Snapshot of the task log; --follow to stream until terminal. --format text\|json.
task result Download the result payload. Compile tasks emit raw binary; run tasks emit JSON. -o/--output FILE to redirect.
task wait Block until terminal. Exit code: 0 SUCCEEDED, 1 FAILED, 2 CANCELLED, 124 on --timeout. --poll-interval.
task revoke Request cancellation. Only valid while QUEUED; otherwise exit code 4.
task delete Permanently delete a task and its blobs. INPROGRESS tasks under the 2-minute grace window return exit code 4.

Exit codes

Code Meaning
0 Success.
1 Generic CLI / runtime failure (e.g. usage error after Click handling). For task wait: terminal state FAILED.
2 task wait: terminal state CANCELLED.
3 API or transport error (LuciHubAPIError).
4 State conflict (HTTP 409) — e.g. revoking a non-QUEUED task, deleting an INPROGRESS task within the grace window.
124 task wait --timeout expired before the task reached a terminal state.

Quick-start example

# 1. Check what's available.
uv run lucihub status

# 2. Inspect a device.
uv run lucihub info lucistack

# 3. Compile an analang ODE (.ana file, see redacc docs) for a specific device (single-step flow).
uv run lucihub compile harmonic.ana --device lucistack --output harmonic.apb

# 4. Run the compiled module.
uv run lucihub run harmonic.apb \
    --device lucistack \
    --sample-rate 100000 \
    --op-time 0.2 \
    --output result.json

# 5. Or, run the same module on the simulator.
uv run lucihub run harmonic.apb --device local-simulator --output sim-result.json

An alternative two-step flow saves the entity blob first, which is useful when running many compiles against the same hardware:

uv run lucihub info lucistack --save-entity lucistack.entity
uv run lucihub compile harmonic.ana lucistack.entity --backend LUCIDAC -o harmonic.apb