Skip to content

A CLI wrapping a Docker image to interact with Gitlab's API.

License

Notifications You must be signed in to change notification settings

augustohp/ore-gitlab_cli

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 

Repository files navigation

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