https://github.com/augustohp/ore-gitlab_cli
A CLI wrapping a Docker image to interact with Gitlab's API.
https://github.com/augustohp/ore-gitlab_cli
castle castle-ore docker gitlab
Last synced: about 1 year ago
JSON representation
A CLI wrapping a Docker image to interact with Gitlab's API.
- Host: GitHub
- URL: https://github.com/augustohp/ore-gitlab_cli
- Owner: augustohp
- License: mit
- Created: 2018-07-14T01:04:30.000Z (almost 8 years ago)
- Default Branch: main
- Last Pushed: 2022-08-15T02:47:12.000Z (almost 4 years ago)
- Last Synced: 2025-03-30T12:11:32.761Z (about 1 year ago)
- Topics: castle, castle-ore, docker, gitlab
- Language: Shell
- Homepage:
- Size: 5.86 KB
- Stars: 4
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# GitLab CLI
Wraps a [docker image][] containing [gitlab ruby gem][gem] to access
[Gitlab's API][api] through the _command line_.
[gem]: https://github.com/narkoz/gitlab
[docker image]: https://hub.docker.com/r/augustohp/gitlab-cli
[api]: https://docs.gitlab.com/ee/api/
You just need:
* [Docker](https://docker.io)
* [JQ](https://stedolan.github.io/jq/) (optional)
## Usage
Clone this repository with [homesick][] or [homeshick][] and be sure that
`$HOME/bin` is inside your `$PATH`, you will able to:
$ gitlab help
[homesick]: https://github.com/technicalpickles/homesick
[homeshick]: https://github.com/andsens/homeshick
You should create a [Personal Access Token][1] and then export it in your shell:
$ export GITLAB_API_PRIVATE_TOKEN=
[1]: https://gitlab.com/profile/personal_access_tokens
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`