Repository navigation
Render cf CLI samples from the cf CLI's command metadata - #94
Merged
Merged
Conversation
The cf CLI sample of an operation was guessed from its path parameters: every path parameter became a positional, including `account_id`, and operations with a request body or a required query parameter got no sample at all. So `cf agent-memory recall` had no sample, and `cf agent-memory get-memory` showed `<account_id> <namespace_name> <profile_name> <memory_id>` instead of `<memory-id> --namespace-name … --profile-name …`. The sample now comes from `dist/_meta/commands.json` in the cf package, the metadata `cf <command> --help` is built from: the command that sends the operation, its required positionals, then its required options. Hand-written commands are left out, as the site documents them separately. cf is bumped to 1.0.0-beta.27, whose metadata the tests check against.
srikrsna
approved these changes
Nov 4, 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.
The cf CLI sample of an operation was guessed from its path parameters: each one became a positional,
account_idincluded, and operations with a request body or a required query parameter had no sample at all. Socf agent-memory recallshowed no sample, andcf agent-memory get-memoryshowed<account_id> <namespace_name> <profile_name> <memory_id>, which the CLI doesn't accept.Now the sample comes from the cf CLI itself:
dist/_meta/commands.jsonin thecfpackage, the metadatacf <command> --helpis built from. The sample is the command that sends the operation, with its required positionals and then its required options:cf ai run, get no sample here, since the site documents them separately.cf workflows instances pause/restart/resume/terminate), the one named like the operation's SDK method is used.cfis bumped from1.0.0-beta.19to1.0.0-beta.27, whose metadata the tests check against.Things to know:
dist/_meta/isn't an exported path of thecfpackage, so it's read from the package's directory. A cf release that moves it fails the tests.cfalso runs the site'sdev,buildanddeployscripts. With beta.27,pnpm devstartsastro devin the background and returns.cf buildandcf deployhaven't been tried with beta.27.