Skip to content

CLI & Command Registry

The autosre CLI is built on the Click framework, with the main entrypoint defined in autosre/cli.py 1. The cli group serves as the root command, supporting an interactive dashboard mode when invoked without subcommands. Command registration is handled primarily through Click decorators within this file, with additional command groups imported from the autosre/commands/ subpackage to keep the main module size manageable 2.

The cli function is the primary entrypoint, decorated with @click.group 1. It includes a version option and uses @click.pass_context to manage state. If no subcommand is provided (ctx.invoked_subcommand is None), the CLI automatically launches the interactive TUI dashboard by importing and calling main() from autosre.tui.

Several subcommands are defined directly in autosre/cli.py to manage the vLLM backend and system status:

  • setup: Checks and installs requirements for the vLLM stack. It uses get_backend(BackendType.VLLM) to verify the environment and exits with an error if requirements are missing.
  • stop: Scales the autosre-vllm-local deployment to 0 to free the GPU, while leaving proxy and browser pods running. It uses k3s_lifecycle to manage the pod termination.
  • status: Displays pod health, pinned endpoint status, and vLLM model/URL information using kubectl and backend status methods.
  • test: Sends a test prompt to the vLLM server to verify connectivity and response correctness, displaying token usage and latency 3.
  • watch: Provides live introspection of the vLLM instance and host metrics (GPU, CPU, RAM) using a Rich live view, combining /metrics, docker logs, and nv-monitor data 4.
  • backends: Lists available backends, currently showing only vllm as the detected platform.
  • bench: Benchmarks vLLM models for throughput, concurrency, and GPU memory usage, with options to list models, view history, or specify models by name or index.
  • precommit: Scans the working tree for sensitive data using the vendored precommit_scanner module 3.
  • ui: An alias for the interactive TUI dashboard, calling main() from autosre.tui.

The models group manages models for the current backend:

  • models list: Lists configured model recipes and the currently deployed model 5.
  • models pull: Informs the user that model pulling is handled by the k3s chart, not the CLI.

The swarm group manages agent swarms:

  • swarm launch: Launches an agent swarm with optional task templates, supporting both local vLLM and Anthropic providers 6.
  • swarm templates: Lists available task templates with agent counts and roles.

The dedicated group flips the GB10 between SHARED, DEDICATED-coding, and IMAGEGEN modes:

  • dedicated status: Shows the current dedicated-mode latch 2.
  • dedicated down: Restores shared mode.
  • dedicated reconcile: Applies the durable latch’s desired mode, used by the boot service.

Additional command groups are imported from autosre/commands/ and registered with cli.add_command():

  • perf from autosre.commands.perf
  • cluster from autosre.commands.cluster
  • configure from autosre.commands.configure
  • demo from autosre.commands.demo
  • dropbox from autosre.commands.dropbox
  • images from autosre.commands.images
  • k3s from autosre.commands.k3s
  • keys from autosre.commands.keys
  • mcp from autosre.commands.mcp
  • provision from autosre.commands.provision
  • ssh_group from autosre.commands.ssh_cmds
  • swarm_demo from autosre.commands.swarm_demo
  • workflow from autosre.commands.workflow
  • claude from autosre.commands.claude
  • codex from autosre.commands.codex_cmd
  • eval_group from autosre.commands.eval_cmds
  • metrics from autosre.commands.metrics
  • start from autosre.commands.start
diagram