Skip to content

gh search repos cannot handle multiple query terms and results in Invalid search query. #8984

Open
@TWiStErRob

Description

@TWiStErRob

Describe the bug

A clear and concise description of what the bug is. Include version by typing gh --version.

Steps to reproduce the behavior

  1. Type this gh search repos "user:TWiStErRob -is:fork -is:archive"
  2. View the output

Expected behavior

Lists my "active" (i.e. non-fork, non-archive) repositories.

Actual behavior

Invalid search query "user:\"TWiStErRob -is:fork -is:archive\"".
The listed users and repositories cannot be searched either because the resources do not exist or you do not have permission to view them.

Additional context

I also tried gh search repos -- "user:TWiStErRob -is:fork -is:archive" which gives the same.

gh search repos -- user:TWiStErRob -is:fork -is:archive does list the repositories, but it includes archived ones.

Swapping the search query terms results in similar error:
gh search repos -- "-is:fork -is:archive user:TWiStErRob"

Invalid search query "-is:\"fork -is:archive user:TWiStErRob\"".
None of the search qualifiers apply to this search type.

I'm aware of gh search repos --owner=TWiStErRob --include-forks=false --archived=false, but I want the "query" to be "user input" to a script. So I can't use gh cli arguments in there, only raw repository query.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingdiscussFeature changes that require discussion primarily among the GitHub CLI teamdocsgh-searchrelating to the gh search commandp3Affects a small number of users or is largely cosmetic

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions