Files
nvke/cli/docs/reference/README.md
Jonathan Meier bc75b98193 docs(cli): generate the nvkectl command reference from the command tree (#1773)
The repository has a hand-maintained quick reference and workflow guides, but
no complete reference. An operator cannot browse the whole public CLI without
a built binary, and nothing ties the prose to the commands, so the two drift
apart silently.

Add cli/docs/reference: an index and one page per public command, generated
from the cobra tree nvkectl itself runs. Each page carries the command's
purpose, invocation and positional arguments, aliases, examples, local and
inherited options with types and defaults, the required and mutually exclusive
option groups, and a deprecation notice when it has one.

cobra's doc package writes the body of each page. It does not emit aliases,
deprecation notices, flag-group constraints or an index, and it never removes
the page of a deleted command, so internal/clidocs adds those around it. All
of it is read from the command, so there is no second catalogue to maintain.

Deterministic, so repeated generation from unchanged source produces identical
files:

  - cobra's generated-on timestamp is switched off on every command.
  - The NVKECTL_ and NKECTL_ variables are cleared before the tree is built.
    Two of `bootstrap site`'s flag defaults -- --diagnostics-dir and --timeout
    -- are read from the environment by the command constructor, through
    internal/envalias, which still honours the old prefix. Without this the
    pages would record whatever the generating shell happened to have set.
  - HOME and the XDG config directory are pinned, and the build metadata is a
    fixed placeholder.

Generation runs no command and contacts nothing: it builds the tree and reads
its metadata, so it needs no credential, kubeconfig, configured site or
cluster. newRootCmd is exported for it, which is what the move to an
importable package was for.

`make -C cli docs` regenerates and `make -C cli docs-check` verifies, failing
on output that is stale, missing, obsolete, or newly generated and never
committed. The check joins the generated-artefact gate, which already covers
the provisioned-provider manifest and the generated API code, and joins
`make gate` and `make preflight` locally.

Two commands lazily added by cobra needed initialising before the traversal,
or the root page would link to pages that were never written: `help` and
`completion`. cobra's doc package also calls InitDefaultHelpCmd on every
command it renders, not just the root, which invented a `help` subcommand
under each group command -- `nvkectl bootstrap help` is not a command -- so
each one is given a hidden help command first to decide what cobra adds.

Hidden commands and help topics are excluded, which is why `render` and
`inspect` do not appear; a deprecated command keeps its page for as long as it
still runs.

Constraints enforced inside RunE are invisible to cobra. Those on `config
set-site` and the two patch commands are now stated in the flag usage strings
and Long text, so --help and the reference agree. No behaviour changes: the
checks still run where they did, with the messages they had.

cobra/doc brings go-md2man and blackfriday into cli/go.mod. Neither is
reachable from ./cmd/nvkectl, so the shipped binary is unaffected and
THIRD_PARTY_NOTICES.md is unchanged.

Signed-off-by: Jonathan Meier <jomeier@nvidia.com>
2026-10-19 14:27:19 -04:00

92 lines
7.2 KiB
Markdown

> **Generated file -- do not edit.** This page is written from the nvkectl
> command tree in `cli/internal/nvkectl`. To change what it says, change the
> command's own metadata -- its Short, Long, Example, Args, Aliases, deprecation
> notice or flag usage strings -- and run `make -C cli docs`. An edit made here
> is lost on the next run, and `make -C cli docs-check` fails until the
> committed pages match the tree again.
# nvkectl command reference
Every public `nvkectl` command and subcommand, generated from the command tree
the binary runs. Each page states the command's purpose, how it is invoked and
what positional arguments it takes, its aliases, its examples, and its own and
inherited options with their types and defaults.
This is the complete reference. It is not a guide: it says what each command
accepts, not when to reach for it.
## Concepts and guides
The reference covers command metadata. Everything that is not command
metadata is written down here instead.
| Document | Contents |
|---|---|
| [nvkectl README](../../README.md) | Installing nvkectl, authenticating to the management plane, and every `NVKECTL_*` environment variable |
| [Compatibility and deprecation policy](../compatibility.md) | What is contract and what is not, the exit codes, and how a command or flag is removed |
| [Site spec reference](../sitespec.md) | Every field of the site spec file `bootstrap site` reads, with its type |
| [Site and tenant cluster flow](../user-flow.md) | The commands in the order an operator runs them |
| [Bootstrap troubleshooting](../bootstrap-troubleshooting.md) | Where a failed bootstrap leaves its evidence, and the common failures |
| [Management cluster bootstrap](../../../docs/site-bootstrap/overview.md) | What a bootstrap does, end to end |
| [Authenticating to the NVKE API](../../../controller/docs/authenticating-to-the-api.md) | How a client proves who it is |
| [Configuring NVKE API authentication](../../../controller/docs/configuring-api-authentication.md) | Turning authentication on, and the RBAC nvkectl needs |
## What is not here
Hidden commands, and help topics that are prose rather than commands. A hidden
command is absent from `--help` and is not part of the public CLI, so it is
absent here for the same reason.
Everything else the binary exposes is covered, including the commands cobra
provides rather than nvkectl: `help` and `completion`. A deprecated command
keeps its page, carrying its deprecation notice, for as long as it still runs.
## Commands
- [`nvkectl`](nvkectl.md) — NVKE control-plane CLI
- [`nvkectl bootstrap`](nvkectl_bootstrap.md) — Bootstrap NVKE clusters from a declarative site spec
- [`nvkectl bootstrap site`](nvkectl_bootstrap_site.md) — Bootstrap a new NVKE management cluster from a site spec file
- [`nvkectl completion`](nvkectl_completion.md) — Generate the autocompletion script for the specified shell
- [`nvkectl completion bash`](nvkectl_completion_bash.md) — Generate the autocompletion script for bash
- [`nvkectl completion fish`](nvkectl_completion_fish.md) — Generate the autocompletion script for fish
- [`nvkectl completion powershell`](nvkectl_completion_powershell.md) — Generate the autocompletion script for powershell
- [`nvkectl completion zsh`](nvkectl_completion_zsh.md) — Generate the autocompletion script for zsh
- [`nvkectl config`](nvkectl_config.md) — Manage nvkectl configuration
- [`nvkectl config set-site`](nvkectl_config_set-site.md) — Configure the management plane the CLI connects to
- [`nvkectl config use-site`](nvkectl_config_use-site.md) — Switch the active site to a previously configured entry
- [`nvkectl config view`](nvkectl_config_view.md) — Print the current nvkectl configuration
- [`nvkectl create`](nvkectl_create.md) — Create a resource
- [`nvkectl create cluster`](nvkectl_create_cluster.md) — Create a tenant cluster
- [`nvkectl create clusterrelease`](nvkectl_create_clusterrelease.md) — Create a cluster release: a control-plane release
- [`nvkectl create machineimage`](nvkectl_create_machineimage.md) — Create a machine image: an immutable node image and its NICo boot script
- [`nvkectl create nodepool`](nvkectl_create_nodepool.md) — Create a node pool
- [`nvkectl create nodepoolrelease`](nvkectl_create_nodepoolrelease.md) — Create a node pool release: a worker release
- [`nvkectl delete`](nvkectl_delete.md) — Delete a resource
- [`nvkectl delete cluster`](nvkectl_delete_cluster.md) — Delete a tenant cluster
- [`nvkectl delete clusterrelease`](nvkectl_delete_clusterrelease.md) — Delete a cluster release: a control-plane release
- [`nvkectl delete machineimage`](nvkectl_delete_machineimage.md) — Delete a machine image: an immutable node image and its NICo boot script
- [`nvkectl delete nodepool`](nvkectl_delete_nodepool.md) — Delete a node pool
- [`nvkectl delete nodepoolrelease`](nvkectl_delete_nodepoolrelease.md) — Delete a node pool release: a worker release
- [`nvkectl deprecate`](nvkectl_deprecate.md) — Deprecate a release
- [`nvkectl deprecate clusterrelease`](nvkectl_deprecate_clusterrelease.md) — Deprecate a cluster release
- [`nvkectl deprecate nodepoolrelease`](nvkectl_deprecate_nodepoolrelease.md) — Deprecate a node pool release
- [`nvkectl generate`](nvkectl_generate.md) — Generate NVKE configuration files
- [`nvkectl generate oidc-kubeconfig`](nvkectl_generate_oidc-kubeconfig.md) — Generate an oidc-login kubeconfig from an input kubeconfig
- [`nvkectl generate sitespec`](nvkectl_generate_sitespec.md) — Generate a site spec file for a tier-0 cluster
- [`nvkectl get`](nvkectl_get.md) — Display one or more resources
- [`nvkectl get bootstrap-manifest`](nvkectl_get_bootstrap-manifest.md) — Print the charts and images the bootstrap fetches, with version and digest
- [`nvkectl get clusterreleases`](nvkectl_get_clusterreleases.md) — List cluster releases on the active site's management cluster
- [`nvkectl get clusters`](nvkectl_get_clusters.md) — List tenant clusters on the management plane
- [`nvkectl get kubeconfig`](nvkectl_get_kubeconfig.md) — Get the admin kubeconfig for a tenant cluster
- [`nvkectl get machineimages`](nvkectl_get_machineimages.md) — List machine images on the active site's management cluster
- [`nvkectl get nodepoolreleases`](nvkectl_get_nodepoolreleases.md) — List node pool releases on the active site's management cluster
- [`nvkectl get nodepools`](nvkectl_get_nodepools.md) — List node pools on the management plane
- [`nvkectl get providers`](nvkectl_get_providers.md) — List infrastructure providers installed on the management cluster
- [`nvkectl help`](nvkectl_help.md) — Help about any command
- [`nvkectl patch`](nvkectl_patch.md) — Patch a resource
- [`nvkectl patch cluster`](nvkectl_patch_cluster.md) — Patch a tenant cluster
- [`nvkectl patch nodepool`](nvkectl_patch_nodepool.md) — Patch a node pool
- [`nvkectl validate`](nvkectl_validate.md) — Validate a file before acting on it
- [`nvkectl validate sitespec`](nvkectl_validate_sitespec.md) — Check a site spec the way nvkectl bootstrap site reads it
- [`nvkectl version`](nvkectl_version.md) — Print version information