Closed
Conversation
…io/cli into update-schedule-command
121ee02 to
3959b17
Compare
00c7382 to
622fd00
Compare
Add a `-split` flag to gen-docs that specifies command names whose
subcommands should each get their own file in a subdirectory rather than
all being combined into a single file. This is needed for the cloud CLI
extension, which has ~130 commands that would produce an unmanageably
large single page.
Usage:
go run ./cmd/gen-docs \
-input internal/temporalcli/commands.yaml \
-input path/to/cloud-cli/commands.yml \
-split cloud \
-output dist/docs
This produces cloud/namespace.mdx, cloud/user.mdx, cloud/apikey.mdx,
etc. alongside the existing flat files. Existing non-split commands
are unaffected.
Also fixes the encodeJSONExample regex to catch standalone JSON objects
in single quotes (e.g., '{"key":"value"}'), not just key=value patterns.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
0562f8c to
3cfd1f2
Compare
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.
Summary
-splitflag togen-docsthat specifies command names whose subcommands should each get their own documentation file in a subdirectory, rather than all being combined into a single.mdxfile-split cloud), its direct children each become a separate file in a subdirectory:cloud/namespace.mdx,cloud/user.mdx,cloud/apikey.mdx, etc.encodeJSONExampleregex to catch standalone JSON objects in single quotes (e.g.,'{"key":"value"}'), not justkey=valuepatternsContext
The Temporal Cloud CLI extension has ~130 commands across 10 top-level groups. Without this change,
gen-docswould produce a singlecloud.mdxfile that's roughly 2800 lines. With this change, each command group gets a manageable page (the largest beingcloud/namespace.mdxat ~1150 lines, comparable toworkflow.mdx).Usage
No changes are needed in the cloud-cli repo. The
-splitflag is passed by the documentation repo's workflow:The flag can be specified multiple times if needed in the future.
Test plan
-split cloudproducescloud/subdirectory with correct file splits🤖 Generated with Claude Code