`repo search` documentation is wrong
Description
glab config set gitlab_uri https://example.com failed to set "gitlab_uri" to "https://example.com": failed to write config: not a git repository alias glab alias glab='GITLAB_HOST=https://example.com glab'
$ glab repo search required flag(s) "search" not set
$ glab repo search docker accepts 0 arg(s), received 1
Expected Behavior vs Actual Behavior Commands actually work and tool is useful.
Possible Fix
Steps to Reproduce All should be obvious via description section.
Logs
Your Environment
- Version used (Run
glab --version): glab version 1.22.0 (2022-01-10) - Operating System and version: Mac OS (12.0.1) on M1 tool installed via homebrew.
So few things here.
-
glab config set gitlab_uri https://example.com/needs to be run inside a git repository to make, sense. This sets the URI for the GitLab API for that directory. -
glab repo searcherror message is clear enough, although the help message is not great. You need to provide the--searchflag instead of using an argument. e.g.glab repo search --search docker
- makes no sense to be directory sepecific when otherwise my calls to "search repo" says 401 unauthorised to gitlab.com
- Documentation and messages need to be updated, also adding "--search" to "repo search" is illogical.
makes no sense to be directory specific when otherwise my calls to "search repo" says 401 unauthorized to gitlab.com
The API host is found by
- GITLAB_HOST
- Check if the host in the current
gitdirectory is authenticated - If neither of the above is true, fall back to
gitlab.com
So you either have to set GITLAB_HOST and authenticate against the host using the glab auth login command
Documentation and messages need to be updated, also adding "--search" to "repo search" is illogical.
I agree with this. Since the tool is being adopted by GitLab( https://github.com/profclems/glab/issues/983) feel free to open an issue there.
This issue has been automatically marked as stale because it has not had recent activity. We haven't had the time to address it yet, but we want to keep it open. This message is just a reminder for us to help triage issues.