Skip to content

Allow gh search repos --archived to take true or false value #8389

Description

@knutwannheden

Currently the gh search repos --archived is documented as "Filter based on archive state". It does indeed allow to filter on archived repos, but I think it would be really nice if it could also be used to exclude any archived repos, by using it as --archived false, similar to how it is described in the linked documentation: https://docs.github.com/en/search-github/searching-on-github/searching-for-repositories#search-based-on-whether-a-repository-is-archived

Activity

  1. samcoe commented on Nov 29, 2023

    @samcoe
    Contributor

    @knutwannheden Thanks for writing in, and sorry for the difficulty you are having. This feature is actually already supported, unfortunately the syntax is a bit wonky due to the implementation.

    You can use gh search repos --archived=false and gh search repos --archived=true to achieve what you are trying to do.

    I think we can improve the documentation here and indicate that the = sign is necessary and that invocations such as gh search repos --archived false will not work. Perhaps an example using the --archived flag.

  2. added
    gh-searchrelating to the gh search command
    and removed on Nov 29, 2023
  3. vanta commented on Apr 25, 2024

    @vanta

    Can we have the same for gh search code to skip (or not) archived repos?

  4. jvilimek commented on Oct 8, 2024

    @jvilimek

    Can we have the same for gh search code to skip (or not) archived repos?

    While "archived:true" works in the UI search, in the CLI this is not working: gh search code "something archived:true" :-(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    docsenhancementa request to improve CLIgh-searchrelating to the gh search commandhelp wantedContributions welcome

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions