From d712e98e86a10e51b69beff37fd1e55b9de41ed5 Mon Sep 17 00:00:00 2001 From: ebner Date: Mon, 6 May 2024 13:39:55 +0200 Subject: [PATCH] add section for gitlab cli --- _toc.yml | 1 + services-user-guide/gitlab/gitlab_cli.md | 34 ++++++++++++++++++++++++ 2 files changed, 35 insertions(+) create mode 100644 services-user-guide/gitlab/gitlab_cli.md diff --git a/_toc.yml b/_toc.yml index 94582b19..e341247d 100644 --- a/_toc.yml +++ b/_toc.yml @@ -176,6 +176,7 @@ chapters: - file: services-user-guide/gitlab/container.psi.ch - file: services-user-guide/gitlab/gitpages.psi.ch - file: services-user-guide/gitlab/dependency_proxy + - file: services-user-guide/gitlab/gitlab_cli - file: services-admin-guide/index sections: diff --git a/services-user-guide/gitlab/gitlab_cli.md b/services-user-guide/gitlab/gitlab_cli.md new file mode 100644 index 00000000..6539b2a9 --- /dev/null +++ b/services-user-guide/gitlab/gitlab_cli.md @@ -0,0 +1,34 @@ +# Gitlab CLI + +To interact with your gitlab instances via CLI you can use the Gitlab CLI tool: https://gitlab.com/gitlab-org/cli + + +## Installation + +On a standard PSI RHELX system you can install the CLI client via: +``` +yum install glac +``` + +Otherwise please head over to https://gitlab.com/gitlab-org/cli/-/releases and download/install the client for your platform. + +## Usage + +Configuration for your instance: +``` +glab config set -g host git.psi.ch +``` + +Global configuration file can be found: +`~/.config/glab-cli/config.yml` + +Authentication +- Create access token with at least **API** and **write_repository** permissions: https://git.psi.ch/-/profile/personal_access_tokens?scopes=api,write_repository + +``` +glab auth login --hostname git.psi.ch --token +``` + +After authentication you can work with the `glab` command as documented on: +https://gitlab.com/gitlab-org/cli#core-commands +