From be555ad29f6ab19ae5f90274d479a4d4f750640d Mon Sep 17 00:00:00 2001 From: Adam Wolfe Gordon Date: Wed, 10 Jun 2026 09:42:03 -0600 Subject: [PATCH 1/3] Update the CLI docs path The CLI docs are now versioned separately from the rest of the docs, in preparation for the CLI version diverging from core. Update it in our contributing docs and the CI jobs where we validate generated docs changes. Signed-off-by: Adam Wolfe Gordon --- .github/workflows/ci.yml | 6 +++--- CONTRIBUTING.md | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6e54ba9..9a36848 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -202,13 +202,13 @@ jobs: run: | chmod +x ./bin/linux_amd64/crossplane ./bin/linux_amd64/crossplane config set features.enableAlpha true - ./bin/linux_amd64/crossplane generate-docs -o ./docs/content/master/cli/command-reference.md + ./bin/linux_amd64/crossplane generate-docs -o ./docs/content/cli/master/command-reference.md - name: Run Vale uses: vale-cli/vale-action@d89dee975228ae261d22c15adcd03578634d429c # v2.1.1 with: version: "3.14.2" - files: ./docs/content/master/cli/command-reference.md + files: ./docs/content/cli/master/command-reference.md vale_flags: "--config=./docs/utils/vale/.vale.ini" fail_on_error: true reporter: local @@ -217,4 +217,4 @@ jobs: - name: Show generated docs on failure if: ${{ failure() }} run: | - cat ./docs/content/master/cli/command-reference.md + cat ./docs/content/cli/master/command-reference.md diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 1bfef47..6bc0ee1 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -86,7 +86,7 @@ git clone https://github.com/crossplane/docs.git cd docs # Generate the docs. -crossplane generate-docs -o content/master/cli/command-reference.md +crossplane generate-docs -o content/cli/master/command-reference.md # Build the docs and serve them locally for preview. hugo serve From 241a73afdce7e828f65b3b7c7dd2e9900d3e8ea0 Mon Sep 17 00:00:00 2001 From: Adam Wolfe Gordon Date: Thu, 11 Jun 2026 15:23:54 -0600 Subject: [PATCH 2/3] docs: Update the command reference template to match the current docs Signed-off-by: Adam Wolfe Gordon --- cmd/crossplane/docs-templates/command-reference.md.tmpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/crossplane/docs-templates/command-reference.md.tmpl b/cmd/crossplane/docs-templates/command-reference.md.tmpl index 7ac1f96..2f10914 100644 --- a/cmd/crossplane/docs-templates/command-reference.md.tmpl +++ b/cmd/crossplane/docs-templates/command-reference.md.tmpl @@ -1,5 +1,5 @@ --- -weight: 50 +weight: 100 title: Command Reference description: "Command reference for the Crossplane CLI" --- From 96e0b27f94c3de74eae5203cc8fca2d8e839d337 Mon Sep 17 00:00:00 2001 From: Adam Wolfe Gordon Date: Thu, 11 Jun 2026 15:28:32 -0600 Subject: [PATCH 3/3] xpkg: Sort template names in the help for `crossplane xpkg init` Ensure stable help output (and generated documentation) by sorting the template names in the dynamically-generated part of the `crossplane xpkg init` help. Signed-off-by: Adam Wolfe Gordon --- cmd/crossplane/xpkg/init.go | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/cmd/crossplane/xpkg/init.go b/cmd/crossplane/xpkg/init.go index 0c00fb4..7f8f037 100644 --- a/cmd/crossplane/xpkg/init.go +++ b/cmd/crossplane/xpkg/init.go @@ -20,10 +20,12 @@ import ( "context" "fmt" "io" + "maps" "net/url" "os" "os/exec" "path/filepath" + "slices" "strings" "github.com/alecthomas/kong" @@ -69,7 +71,13 @@ type initCmd struct { func (c *initCmd) Help() string { b := strings.Builder{} - for name, url := range WellKnownTemplates() { + + // Sort the map keys to ensure stable help output. + tmpls := WellKnownTemplates() + names := slices.Sorted(maps.Keys(tmpls)) + + for _, name := range names { + url := tmpls[name] fmt.Fprintf(&b, "- `%s` ([%s](%s))\n", name, url, url) }