docs: document kelos completion subcommand and dynamic shell completion

Merged
KE
5mo ago
+43-1

What type of PR is this?

/kind docs

What this PR does / why we need it:

The kelos CLI has a fully implemented shell completion feature — including dynamic, cluster-aware completion of Task / TaskSpawner / Workspace / AgentConfig names — but neither docs/reference.md nor README.md mention kelos completion. New users have no way to discover it short of reading internal/cli/completion.go.

This PR is a zero-code-change docs fix:

  • docs/reference.md
    • Adds kelos completion <shell> to the Core Commands table.
    • Adds a new Shell Completion subsection under ## CLI Reference that:
      • Lists the one-line per-shell setup (bash, zsh, fish, powershell).
      • Explains how to persist completion across sessions.
      • Notes that resource-name completion queries the cluster, so a reachable kubeconfig and list permission in the active namespace are required.
      • Tabulates which commands complete dynamically (matching the implementation in internal/cli/completion.go).
      • Calls out the enum-valued flags that complete from a fixed value set without contacting the cluster (--type, --credential-type, --output, --phase).
  • README.md
    • Adds kelos completion <shell> to the collapsible CLI Reference table and links to the new Shell Completion section in the reference doc.

The wording sticks to what the code actually does today (Cobra v1.10.2's auto-generated completion subcommand + the four cluster-aware completion funcs already registered across logs, get, delete, suspend, and resume).

Which issue(s) this PR is related to:

Fixes #1170

Special notes for your reviewer:

No code changes — make verify still passes. The dynamic-completion table mirrors the registrations in internal/cli/get.go, delete.go, logs.go, suspend.go, resume.go, and run.go; I checked each registration before listing it.

Does this PR introduce a user-facing change?

docs: document the `kelos completion` subcommand, including per-shell setup and the dynamic resource-name completion behavior for `kelos logs`, `kelos get`, `kelos delete`, `kelos suspend`, and `kelos resume`.

Summary by cubic

Documents the kelos completion <shell> command and dynamic, cluster-aware resource-name completion so users can discover and set up shell completion quickly. Adds per-shell setup for bash, zsh, fish, and powershell, persistence notes, and lists which commands (logs, get, delete, suspend, resume) and enum flags (--type, --credential-type, --output, --phase) complete; updates docs/reference.md and README.md. Fixes #1170.