Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Add a script to generate a list of all the commands and subcommands #1287

Merged
merged 4 commits into from
Dec 11, 2024

Conversation

joe-yeager
Copy link
Contributor

@joe-yeager joe-yeager commented Dec 3, 2024

Add a script to list all of the available (not hidden) cli commands because yargs doesn't have support for this


const execAsync = util.promisify(exec);

async function extractCommands(
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This recurses over the commands running --get-yargs-completions and generates a JSON object to keep the hierarchy. We can use this in the future to scrape help documents etc to auto generate docs from the help text in the CLI if we so choose.

@joe-yeager joe-yeager changed the base branch from main to next December 4, 2024 20:52
Copy link
Contributor

@brandenrodgers brandenrodgers left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, I think we'll be able to do a lot with this!

@joe-yeager joe-yeager merged commit a8858bd into next Dec 11, 2024
1 check passed
@joe-yeager joe-yeager deleted the jy/add-get-all-commands-script branch December 11, 2024 22:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants