profclems / glab

The GitLab CLI tool. Archived: now officially adopted by GitLab as the official CLI tool and maintained at https://gitlab.com/gitlab-org/cli. See https://github.com/profclems/glab/issues/983
https://glab.readthedocs.io/
MIT License
2.08k stars 163 forks source link

`repo search` documentation is wrong #984

Open gdzien opened 2 years ago

gdzien commented 2 years ago

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

zemzale commented 2 years ago

So few things here.

  1. 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.
  2. glab repo search error message is clear enough, although the help message is not great. You need to provide the --search flag instead of using an argument. e.g. glab repo search --search docker
gdzien commented 2 years ago

1) makes no sense to be directory sepecific when otherwise my calls to "search repo" says 401 unauthorised to gitlab.com 2) Documentation and messages need to be updated, also adding "--search" to "repo search" is illogical.

zemzale commented 2 years ago

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

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.

clemsbot commented 2 years ago

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.