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

Support @repo as optional string to pass to --owner #9096

Open
major0 opened this issue May 18, 2024 · 1 comment
Open

Support @repo as optional string to pass to --owner #9096

major0 opened this issue May 18, 2024 · 1 comment
Labels
enhancement a request to improve CLI needs-user-input

Comments

@major0
Copy link

major0 commented May 18, 2024

Describe the feature or problem you’d like to solve

Easy method for passing the current repo owner to various commands. The gh api supports {owner} strings for handling this. It would be fairly useful, and quite a bit cleaner, if commands such as gh search prs supported something similar. This would allow for various commands to easily work in personal repositories, as well as enterprise repositories.

Proposed solution

These commands currently support @me to refer to the currently logged in GH user. Why not support @repo to refer to the owner of the currently checked out repo.

Additional context

gh search issues --owner @repo

@major0 major0 added the enhancement a request to improve CLI label May 18, 2024
@cliAutomation cliAutomation added the needs-triage needs to be reviewed label May 18, 2024
@williammartin
Copy link
Member

Some interesting thoughts in here though I'm not sure about your example:

gh search issues --owner @repo

I think I would expect a @repo arg to work with gh search issues --repo @repo and @owner to work with gh search issues --owner @owner. Perhaps that's what you meant?

Can you talk a little bit more about the workflow where you would want to use something like this? I'm trying to imagine being in a repo <owner>/<repo> and deciding I want to search for all issues that live in repositories of the same owner. I can sort of imagine doing this for the github owner but then I think I'd probably have all the context I need to write --owner github.

Are there other commands you had in mind where this would be useful?

@williammartin williammartin added needs-user-input and removed needs-triage needs to be reviewed labels May 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement a request to improve CLI needs-user-input
Projects
None yet
Development

No branches or pull requests

3 participants