Skip to content

Latest commit

 

History

History
42 lines (27 loc) · 1.36 KB

README.md

File metadata and controls

42 lines (27 loc) · 1.36 KB

GitLab CLI

Wraps a docker image containing gitlab ruby gem to access Gitlab's API through the command line.

You just need:

Usage

Clone this repository with homesick or homeshick and be sure that $HOME/bin is inside your $PATH, you will able to:

$ gitlab help

You should create a Personal Access Token and then export it in your shell:

$ export GITLAB_API_PRIVATE_TOKEN=<your access token>

Environment variables used are:

  • GITLAB_API_PRIVATE_TOKEN
  • GITLAB_API_ENDPOINT defaults to https://gitlab.com/api/v4

Some recipes for you to use:

  • Trim alias (used in some examples): alias trim="sed 's/[\s\t\"]//g'"
  • List all clone URLs of projects the authenticated user has access to $ gitlab projects --json | jq '.result[] | .ssh_url_to_repo' | trim
  • List all repositories from an organization (limited to 250 max) $ gitlab group_projects --json gitlab-org "{per_page: '250'}" | jq '.result[] | .path_with_namespace' | trim