Skip to content

Cli

cli

axm-doctor command-line interface (cyclopts).

The CLI is a thin shell: it owns argument parsing and human-facing output but delegates every operation to the central detect/install/orchestrate functions, so no business logic is duplicated across the CLI / MCP boundary.

Two commands, two postures:

  • check — the read-only report. It prints tool presence, third-party auth state and missing (value-free) secrets, then exits 0. It NEVER installs and NEVER prompts.
  • bootstrap — the interactive path. For each absent tool it shows the official install command and installs only on an explicit y (default No, honouring the no-system-install rule); for missing secrets it offers to run vault setup. Nothing happens without a yes.

bootstrap()

Interactively install absent tools and provision secrets on confirmation.

Source code in packages/axm-doctor/src/axm_doctor/cli.py
Python
@app.command
def bootstrap() -> None:
    """Interactively install absent tools and provision secrets on confirmation."""
    try:
        _bootstrap_tools()
        _bootstrap_secrets()
    except Exception as exc:  # noqa: BLE001 # CLI boundary: any error -> exit 1
        _die(exc)

check(strict=False)

Print the read-only env report; never installs or prompts.

By default the command always exits 0 — it is a pure report. With --strict it becomes a CI gate: it exits 1 when any probed tool is absent, a third-party auth is logged_out, or a secret is missing, and exits 0 only when every probed component is healthy. The strict verdict is derived from the printed report, with no extra probing.

Source code in packages/axm-doctor/src/axm_doctor/cli.py
Python
@app.command
def check(
    strict: Annotated[
        bool,
        cyclopts.Parameter(
            help=(
                "Exit 1 when any probed tool is absent, an auth is logged_out, "
                "or a secret is missing (CI gate). Default: always exit 0."
            ),
        ),
    ] = False,
) -> None:
    """Print the read-only env report; never installs or prompts.

    By default the command always exits 0 — it is a pure report. With
    ``--strict`` it becomes a CI gate: it exits 1 when any probed tool is
    absent, a third-party auth is ``logged_out``, or a secret is missing, and
    exits 0 only when every probed component is healthy. The strict verdict is
    derived from the printed report, with no extra probing.
    """
    try:
        unhealthy = _print_check()
    except Exception as exc:  # noqa: BLE001 # CLI boundary: any error -> exit 1
        _die(exc)
        return
    if strict and unhealthy:
        raise SystemExit(1)

main()

Console-script entry point for axm-doctor.

Source code in packages/axm-doctor/src/axm_doctor/cli.py
Python
def main() -> None:
    """Console-script entry point for ``axm-doctor``."""
    app()