Standards for CLI command and flag descriptions in Kubebuilder. Use when writing or reviewing CLI flags, commands, or help text.
Use this skill to write, review, or normalize Kubebuilder CLI command descriptions, flag help text, and examples.
Use this pattern:
If set, <what happens>
Examples:
If set, enable multigroup layout (organize APIs by group)If set, skip Go version checkIf set, attempt to create resource even if it already existsWhen a boolean flag defaults to true, describe the behavior and how to disable it:
<what happens by default>; use --flag=false to <opposite behavior>
Or for flags with more context:
<what happens> (enabled by default; use --flag=false to disable)
Examples:
Run 'make generate' after generating files (enabled by default; use --make=false to disable)Run 'make manifests' after generating files (enabled by default; use --manifests=false to disable)Resource is namespaced by default; use --namespaced=false to create a cluster-scoped resourceGenerate the resource without prompting the user (enabled by default; use --resource=false to disable)Download dependencies after scaffolding (enabled by default; use --fetch-deps=false to disable)When a boolean flag preserves existing values if not provided, and supports both enabling and disabling:
Enable or disable <what>; use --flag=false to disable
Examples:
Enable or disable multigroup layout (organize APIs by group); use --multigroup=false to disableEnable or disable namespace-scoped deployment (default: cluster-scoped); use --namespaced=false to disableWhen a flag controls prompting behavior (prompts by default, but accepts explicit true/false to skip the prompt):
Prompt whether to <action> by default; use --flag=true or --flag=false to skip the prompt
Examples:
Prompt whether to generate the controller by default; use --controller=true or --controller=false to skip the promptUse these patterns:
With an example:
<what> (e.g., <example>)
With a default:
<what> (e.g., <example>). Defaults to <default> if unset
With auto-detection:
<what> (e.g., <example>); auto-detected <method> if not provided
Examples:
Go module name (e.g., github.com/user/repo); auto-detected from current directory if not providedLicense header to use for boilerplate (e.g., apache2, none). Defaults to apache2 if unsetProject version (e.g., 3). Defaults to CLI version if unsetDomain for your APIs (e.g., example.org creates crew.example.org for API groups)When a flag is optional and modifies behavior, use:
[Optional] <what>. <additional context if useful> (e.g., <example>)
Examples:
[Optional] Container command to use for image initialization (e.g., --image-container-command="memcached,--memory-limit=64,modern,-o,-v")[Optional] Container port used by the container image (e.g., --image-container-port="11211")Use:
Path to <what>; <behavior> (e.g., <example>)
Example:
Path to custom license file; content copied to hack/boilerplate.go.txt (overrides --license)For comma-separated lists or arrays:
Comma-separated list of <what> (e.g., --flag value1,value2)
Example:
Comma-separated list of spoke versions to be added to the conversion webhook (e.g., --spoke v1,v2)For deprecated flags that will be removed in future versions:
[DEPRECATED] If set, <what it does>. This option will be removed in future versions
Example:
[DEPRECATED] If set, attempts to create resource under the API directory (legacy path). This option will be removed in future versionsRules:
Examples:
Initialize a new projectScaffold a Kubernetes APIScaffold a Kubernetes API or webhookLong descriptions should:
Use this structure when it fits:
Initialize a new project including the following files:
- a "go.mod" with project dependencies
- a "PROJECT" file that stores project configuration
- a "Makefile" with useful make targets
Required flags:
--domain: Domain for your APIs (e.g., example.org creates crew.example.org for API groups)
Configuration flags:
--repo: Go module name (e.g., github.com/user/repo); auto-detected from current directory if not provided
Note: Layout settings can be changed later with 'kubebuilder edit'.
Examples should:
Example:
subcmdMeta.Examples = fmt.Sprintf(` # Initialize a new project
%[1]s init --domain example.org
# Initialize with multigroup layout
%[1]s init --domain example.org --multigroup
# Initialize with all options combined
%[1]s init --plugins go/v4,autoupdate/v1-alpha --domain example.org --multigroup --namespaced
`, cliMeta.CommandName)
Use these standard descriptions when applicable:
--domain: Domain for your APIs (e.g., example.org creates crew.example.org for API groups)--repo: Go module name (e.g., github.com/user/repo); auto-detected from current directory if not provided--plugins: Comma-separated list of plugins to use (default: go/v4)--multigroup:
init: If set, enable multigroup layout (organize APIs by group)edit: Enable or disable multigroup layout (organize APIs by group); use --multigroup=false to disable--skip-go-version-check: If set, skip Go version check--force: If set, attempt to create resource even if it already exists (or If set, regenerate all files except Chart.yaml for helm plugins)--license: License header to use for boilerplate (e.g., apache2, none). Defaults to apache2 if unset--owner: Owner name for copyright license headers--namespaced:
api: Resource is namespaced by default; use --namespaced=false to create a cluster-scoped resourceedit: Enable or disable namespace-scoped deployment (default: cluster-scoped); use --namespaced=false to disable--fetch-deps: Download dependencies after scaffolding (enabled by default; use --fetch-deps=false to disable)--make: Run 'make generate' after generating files (enabled by default; use --make=false to disable)--manifests: Run 'make manifests' after generating files (enabled by default; use --manifests=false to disable)--resource: Generate the resource without prompting the user (enabled by default; use --resource=false to disable)--controller: Prompt whether to generate the controller by default; use --controller=true or --controller=false to skip the promptWhen reviewing, use this format:
Example:
If set, enable multigroup layout (organize APIs by group)If set, ... pattern.false use If set, ...true describe the behavior and how to disable (e.g., "enabled by default; use --flag=false to disable")(e.g., ...)Comma-separated list of ...[DEPRECATED]--force, --make), use identical descriptions across all plugins.+ and break at natural boundaries (70-80 characters per line).--help output.