fix: Preserve custom doc sections across generated reference updates#22486
Merged
kodiakhq[bot] merged 2 commits intomainfrom Apr 6, 2026
Merged
Conversation
…ates Add See Also navigation links, Modes section (init), and Flag Details section (sync) to the CLI doc generation so they survive future version release syncs to the frontend repo.
erezrokah
approved these changes
Apr 6, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
cloudquery/frontend#4444 added several custom documentation sections to the auto-generated CLI reference pages in the frontend repo:
### Modessection incloudquery_init.md— explaining AI-assisted, Basic interactive, and Non-interactive modes### Flag Detailssection incloudquery_sync.md— full--summary-locationfield table and--invocation-idexplanation## See Alsonavigation links appended to all 16 CLI reference pagesBecause the CLI release workflow copies
cli/docs/reference/*.mddirectly into the frontend repo (overwriting files), any new CLI version release — including cloudquery/frontend#4442 — strips those custom sections out. This is a recurring problem: every release would silently remove the manually-added content.Fix
Rather than maintaining the content manually in the frontend repo (where it gets overwritten), we move ownership of the content here so it survives regeneration:
cmd/init.go— AddedinitLongconstant containing the### Modessection. ChangedLong: initShort→Long: initLongso cobra includes it in the generated markdown under### Synopsis.cmd/sync.go— AddedsyncLongconstant containing the### Flag Detailssection (including the full--summary-locationJSONL field table and--invocation-idusage). ChangedLong: syncShort→Long: syncLong.cmd/doc.go— AddedseeAlsoSectionsmap (filename → markdown content) andappendSeeAlsoSections()post-processor. Afterdoc.GenMarkdownTreeCustomruns, the post-processor opens each generated file and appends its See Also section. This keeps the See Also content co-located with the generation logic rather than scattered in 16 separate markdown files.docs/reference/*.md— Regenerated viamake gen-docs. All 16 reference files now include their See Also sections;cloudquery_init.mdincludes the Modes section;cloudquery_sync.mdincludes the Flag Details section.Also corrects the publishing guide URL in
cloudquery_plugin_publish.mdSee Also — old path (/cli/advanced/publishing-an-integration-to-the-hub) updated to new path (/cli/integrations/creating-new-integration/publishing) per the redirect added in cloudquery/frontend#4444.Verification
All checks passed locally. The generated
docs/reference/files in this PR are the proof — they are the output ofmake gen-docswith these changes applied.Related