Repository navigation
reference cli
Active contributors: Zachary Bensalem
The fleet executable is defined by main() in src/fleet_rlm/cli.py. It has five modes: the interactive client, the API server, evaluation dataset and run management, GEPA optimization, and trace verification. The interactive client also accepts slash commands handled locally by the terminal client.
| Path | Responsibility |
|---|---|
src/fleet_rlm/cli.py |
Argument parser, command dispatch, --mlflow resolution, and validation errors. |
src/fleet_rlm/optimize/gepa.py |
fleet optimize arguments and execution. |
src/fleet_rlm/tui/commands.py |
Slash-command table, handlers, completion options, and /help text. |
src/fleet_rlm/launcher.py |
Service planning, health checks, and startup/shutdown for fleet cli. |
docs/reference/cli.md |
Maintained command reference. |
fleet cli [databricks] [--mlflow local|databricks] [--session SESSION_ID] [--url URL]
[--mlflow-port PORT] [--mlflow-experiment NAME] [--startup-timeout SECONDS]
fleet serve [--host HOST] [--port PORT] [--mlflow local|databricks]
fleet eval dataset [--name NAME] [--seed N] [--long-context] [--oolong N] [--longcot N]
fleet eval run [--url URL] [--seed N] [--limit N] [--oolong N] [--collect-only]
fleet eval label TRACE_ID [--status STATUS] [--group GROUP] [--answer TEXT]
[--expectations-file PATH] [--value V] [--route ROUTE]
[--critical|--no-critical] [--reviewer NAME]
fleet optimize --session SESSION_ID [--gepa-budget light|medium|heavy | --max-metric-calls N]
[--threads N] [--validation-ratio F] [--approve VERSION]
fleet trace verify TRACE_ID [--scope runtime|evaluation|optimization]
Every subcommand accepts --mlflow local|databricks; the default is local.
| Mode | Behavior |
|---|---|
cli |
Starts the API and, in local mode, a managed MLflow server; waits for readiness, verifies the API tracking destination, then runs the terminal client. Services it owns are stopped when the client exits. |
serve |
Starts only the FastAPI server with uvicorn and no reload. Refuses a non-loopback host unless FLEET_ALLOW_NON_LOOPBACK_BIND=true. |
eval dataset |
Builds the synthetic evaluation dataset in the selected evaluation experiment. |
eval run |
Runs synthetic cases against a live server and scores them with the configured judge. |
eval label |
Writes gold labels onto a saved trace. |
optimize |
Scores approved examples and compiles a GEPA candidate, or installs a previously validated candidate with --approve. |
trace verify |
Flushes pending exports and reads one trace back from the configured destination. |
-
databricksis a positional shorthand for--mlflow databricks. Onlydatabricksis accepted as a positional backend. -
--urlconnects to an existing server and starts nothing. The launcher still checks that its MLflow backend, tracking URI, experiments, and trace location match the local settings. -
--sessionsets the session ID; when omitted, a shortsess_<8 hex>identifier is generated. -
--mlflow-portoverrides the local MLflow port and is rejected unless the backend is local. -
--mlflow-experimentoverrides the runtime experiment of the selected backend. -
--startup-timeoutdefaults to 180 seconds per service. - A healthy API already on the port is reused only when its destination metadata matches. Unknown metadata, unready tracing, or a mismatch aborts the connection.
- Startup prints the selected backend, tracking URI, and experiment name.
--host and --port override host and port for this process. Binding a non-loopback address requires FLEET_ALLOW_NON_LOOPBACK_BIND=true; the API has no caller authentication.
eval run defaults --url to http://<settings.host>:<settings.port> and preflights the API destination with launcher.verify_api_destination before creating work. It requires the selected evaluation experiment; a missing name is an error. --collect-only runs and labels Turns without invoking the judge suite. --limit 0 means all cases. --oolong N replaces the synthetic case set with N Oolong-synth cases.
eval dataset names the dataset from --name, or derives <catalog>.<schema>.fleet_rlm_eval_cases in Databricks mode and fleet_rlm_eval_cases locally. --long-context adds long log cases; --oolong and --longcot fetch benchmark cases over HTTP.
eval label behavior:
-
--statusaccepts the review statuses fromsrc/fleet_rlm/replay.py; a new label defaults toapproved, and updates preserve existing status and source group unless supplied. -
--groupsets the source group used for train/dev/holdout splits; a new group defaults to the trace's session ID. -
--valueis repeatable and adds expected values that must appear in the answer. -
--routeacceptsdirect,flex, orrlm. -
--criticalpins the deterministic example to the GEPA holdout and requires a perfect candidate score;--no-criticalclears it. -
--expectations-filereplaces structured artifact and delegation gold with a JSON object. -
--reviewerdefaults tohumanand must be non-blank. - The command retries trace reads for up to 15 seconds, validates labels before writing, and requires a matching replay snapshot when the trace was selected for replay. MLflow labels are written first; a later Lakebase curation failure reports a retry instruction rather than claiming success.
TRACE_ID is the ID from a completed Turn or /trace; in Databricks mode use the fully qualified trace:/... reference. --scope selects the runtime, evaluation, or optimization experiment and its trace table prefix. In Databricks mode the command also confirms that the experiment is bound to the configured Unity Catalog location and that the stored trace carries the same location. A trace with zero spans is an error. This is an explicit operator read, not part of serving.
--session is required. --gepa-budget accepts light, medium, or heavy and defaults to light; it is mutually exclusive with --max-metric-calls N. --threads defaults to 4 and must be between 1 and 32. --validation-ratio defaults to 0.35. --approve VERSION installs a candidate that was evaluated against the current incumbent and configuration; search flags are not used for an approval. The search budget does not cover reflection calls or the three paired validation passes.
optimize is a live operation. It needs a curated dataset of at least 8 approved examples from 3 source groups, immutable replay snapshots, and the configured model, Daytona, database, and tracking services. Candidate creation and installation are separate: a normal run never installs a candidate.
All commands default to local MLflow. The backend is an explicit command choice, never an environment default.
-
fleet cli databricksand--mlflow databricksare equivalent. Combiningdatabrickswith--mlflow localis an argument error. -
--mlflow envis retired and is not an accepted choice. - Environment variables override values inside the selected backend but cannot select it.
-
--mlflow-portis valid only for local. -
[mlflow.local]and[mlflow.databricks]are independent; the resolver never borrows a value from the other profile. - Standalone
serve,eval,optimize, andtracecommands connect to an existing tracking server. In local modeeval,optimize, andtracerequire a healthy MLflow at the configured URI; the exception isoptimize --approve, which skips that health check.serveskips the CLI health check, but a tracking initialization failure still prevents API readiness. - Conflicting or invalid configuration is reported as
invalid configuration: <details>before dispatch.
Local MLflow can be started by fleet cli or separately:
mkdir -p .fleet/mlflow
uv run mlflow server --host 127.0.0.1 --port 5001 \
--backend-store-uri sqlite:///$PWD/.fleet/mlflow/mlflow.db \
--default-artifact-root "$PWD/.fleet/mlflow/artifacts"Slash commands are parsed by handle_command in src/fleet_rlm/tui/commands.py and executed against the HTTP API for the current Session. A line without a leading slash is submitted as a task. Unknown commands print a hint; /help lists every command by category; /exit and /quit end the client.
| Command | Purpose |
|---|---|
/attach <path> |
Upload a local file to the Session workspace. |
/files |
List workspace files. |
/artifacts |
List generated artifacts. |
/tree |
Show the workspace tree. |
/cat <path> |
Read a workspace file. |
/stat <path> |
Show size and SHA-256 for a workspace file. |
/put <local-path> [workspace-path] |
Upload a file to a chosen workspace path. |
/get <workspace-path> [local-path] |
Download a workspace file. |
/rm <path> |
Delete a workspace file. |
| Command | Purpose |
|---|---|
/context <workspace-path>|clear |
Select an input dataset file or clear the selection. |
/mode [rlm|flex|hybrid] |
Inspect or change the execution mode for this Session. |
| Command | Purpose |
|---|---|
/config [mode <mode>] |
Inspect non-secret Session settings, limits, digest, and active overrides. /config json prints the raw payload. |
/settings |
Alias for /config. |
/models [catalog.schema] |
Discover accessible chat-capable Unity Gateway services; defaults to system.ai. |
/model [root|sub] [model-id|catalog.schema] |
Choose a model interactively or set it explicitly. |
Root and sub model choices are validated by the server, isolated to the Session, applied at Turn boundaries, and persisted. A busy Session rejects model changes.
| Command | Purpose |
|---|---|
/sessions |
List saved Sessions with turn counts and update times. |
/memory [query] |
Show saved memories, optionally filtered by query. |
| Command | Purpose |
|---|---|
/skills [pull|push] |
Show the Session Skill catalog; pull exports to .fleet/skills/, push synchronizes local Skills. |
| Command | Purpose |
|---|---|
/history |
Show saved Turns. |
/trace |
Show the most recent persisted Turn trace ID, if one exists. |
/optimize [--max-metric-calls N | --approve VERSION] |
Score past Turns, compile a GEPA candidate, and gate it; --approve serves it from the next Turn. |
| Command | Purpose |
|---|---|
/replay [on|off] |
Enable or disable bounded replay snapshot capture for subsequent Turns in this client process. Off by default. |
/turn [turn-id] |
Inspect durable status and outcome for the latest or named Turn. |
/optimize runs a subprocess equivalent to:
python -m fleet_rlm.cli optimize --session <current-session-id> <extra arguments> --mlflow <session-backend>
It inherits the Session's MLflow backend and effective profile settings. Any --mlflow value in the extra arguments must equal the Session backend; a conflicting value is rejected before the subprocess starts. MLFLOW_TRACKING_URI, MLFLOW_EXPERIMENT_NAME, and MLFLOW_EXPERIMENT_ID are removed from the child environment, and the selected profile's FLEET_MLFLOW_* values are added.
In Textual fullscreen mode the command captures output into an "Optimization run" panel; in the Rich fallback it streams to the terminal.
/optimize --approve <version> installs one candidate. Approval rechecks the candidate artifact against the current incumbent, configuration, code, and dependency identities. Old manifests require reevaluation. A candidate installed this way is loaded by the engine at the start of the next Turn. Rollback is not an unchecked path. For the candidate lifecycle, evidence, and holdout gates, see Optimization.
The parser reports configuration problems before dispatch, including pydantic validation details with field paths. Runtime failures use SystemExit with a message rather than a traceback for known conditions:
- Local MLflow is unreachable for a standalone command.
- The API destination does not match the selected evaluation destination.
- A trace cannot be read back or has no spans.
- The Databricks experiment trace location does not match configuration.
- The selected evaluation experiment name is empty.
- A non-loopback bind is requested without the opt-in.
- Service startup times out or a service exits.
Ctrl-C during fleet cli startup or operation exits with status 130 after cleanup. A lost client connection is not proof that a Turn was rolled back; check /history before retrying.
- Configuration for the settings behind every flag and default.
- Getting started for the first local session.
- Deployment for server and service operation.
- Security for bind and credential boundaries.
- Optimization for GEPA internals and approval rules.
- Terminal client for rendering and interaction behavior.