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

[GitHub models] Rename models root command #9

Merged
merged 2 commits into from
Oct 10, 2024

Conversation

Deborah-Digges
Copy link
Member

@Deborah-Digges Deborah-Digges commented Oct 9, 2024

Interestingly, it seems like it's not possible to have a multi word usage command for a single command: spf13/cobra#1057

We have a few options:

  • I looked at the way other extensions do it and they seem to use hyphenated words, which isn't exactly right. For example, gh-discussions uses the command gh-discussions which looks like this and isn't exactly right because running gh-discussions edit is not a valid command
@Deborah-Digges ➜ /workspaces/gh-models $ gh discussions --help
A CLI for GitHub Discussions
While not complete by any means, this CLI is intended to provide a quick way to
interact with GitHub Discussions from the GH CLI. PRs welcome!

Usage:
  gh-discussions [flags]
  gh-discussions [command]

Available Commands:
  completion  Generate the autocompletion script for the specified shell
  create      Create a discusson from the command line.
  edit        Edit a discusson from the command line.
  help        Help about any command
  • The other option could be to change it to just be models, such that the help command looks like this. This feels more correct than the previous option:
@Deborah-Digges ➜ /workspaces/gh-models $ gh models --help
GitHub Models extension

Usage:
  models [command]

Available Commands:
  completion  Generate the autocompletion script for the specified shell
  help        Help about any command
  list        List available models
  run         Run inference with the specified model

Flags:
  -h, --help   help for models

Use "models [command] --help" for more information about a command.

@garman
Copy link
Contributor

garman commented Oct 9, 2024

I dont exactly know how, but I think gh-dash was able to make a multi word usage.

╰─\models:garman-patch-1:% gh dash --help
A gh extension that shows a configurable dashboard of pull requests and issues.

Usage:
  gh dash [flags]

Flags:
  -c, --config string   use this configuration file (default is $GH_DASH_CONFIG, or if not set,
                        $XDG_CONFIG_HOME/gh-dash/config.yml)
      --debug           passing this flag will allow writing debug output to debug.log
  -h, --help            help for gh-dash
  -v, --version         version for gh

spf13/cobra#1057 eventually links to kubernetes-sigs/krew#547 which might give extra hints into how to do a multi word usage? Something about needing a "custom usage template," which might be what gh-dash is doing with their cfgFile var?

@Deborah-Digges
Copy link
Member Author

Deborah-Digges commented Oct 9, 2024

Thanks @garman for that great suggestion! That worked 🥳

@Deborah-Digges ➜ /workspaces/gh-models (deborah-digges/rename-models-root-command) $ ./gh-models --help
GitHub Models extension

Usage:
  gh models [command]

Available Commands:
  completion  Generate the autocompletion script for the specified shell
  help        Help about any command
  list        List available models
  run         Run inference with the specified model

Flags:
  -h, --help   help for models

@Deborah-Digges Deborah-Digges merged commit d3444ed into main Oct 10, 2024
3 checks passed
@Deborah-Digges Deborah-Digges deleted the deborah-digges/rename-models-root-command branch October 10, 2024 14:42
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.

4 participants