glctl is a powerful GitLab command line tool. It provides a declarative API to manage GitLab resources, making it easier for you to perform common GitLab operations from the terminal
Installationā ā Featuresā ā Quick-Startā ā Examplesā ā Licenseā
Using environment variables for authorization
* Basic Authentication (if using a username and password)
- GITLAB_USERNAME
- GITLAB_PASSWORD
- GITLAB_URL
* Private Token (if using a private token)
- GITLAB_PRIVATE_TOKEN
- GITLAB_URL
* OAuth Token (if using an oauth token)
- GITLAB_OAUTH_TOKEN
- GITLAB_URL
Basic Commands:
get Display one or many resources
edit Edit a resource on the server
delete Delete resources by file names, stdin, resources and names, or by resources
create Create a resource from a file or from stdin
Authorization Commands:
login Login to gitlab
logout logout current gitlab
Advanced Commands:
replace Replace a repository file by file name or stdin.
all formats are accepted. If replacing an existing repository file, the
complete repository file spec must be provided. This can be obtained by
$ glctl get files PROJECT --path=my.yml --ref=BRANCH --raw
Settings Commands:
completion Output shell completion code for the specified shell (bash, zsh,
fish, or powershell)
Other Commands:
version Print the client and server version information
docker pull huhouhua/glctl
docker run \
-e GITLAB_URL=https://gitlab.example.com \
-e GITLAB_PRIVATE_TOKEN=305e146a4aa23fb4021a4f162102251e85f651a058a34fb2c27d633617cf8877 \
huhouhua/glctl get projects
š Note: Above examples use private token authentication by default. See environmentā for details. To run glctl against other compatible servers, start the container this way:
docker run -it --entrypoint=/bin/sh huhouhua/glctl
When using the Docker container in GitLab CI, you must set the entrypoint to an empty stringā .
deploy:
image:
name: huhouhua/glctl
entrypoint: ['']
stage: deploy
before_script:
- export GITLAB_URL=https://gitlab.example.com
- export GITLAB_PRIVATE_TOKEN=305e146a4aa23fb4021a4f162102251e85f651a058a34fb2c27d633617cf8877
script:
- glctl get projects
Download the appropriate version for your platform from the releases pageā .
git clone https://github.com/huhouhua/glctl.git
cd glctl
make build
glctl <command> <subcommand> [flags]
glctl login https://gitlab.example.com
glctl login https://gitlab.example.com --username myname
glctl login https://gitlab.example.com --username myname --password mypassword
export GITLAB_URL=https://gitlab.example.com
export GITLAB_PRIVATE_TOKEN=305e146a4aa23fb4021a4f162102251e85f651a058a34fb2c27d633617cf8877
export GITLAB_URL=https://gitlab.example.com
export GITLAB_OAUTH_TOKEN=aefb8b4e0895799aa60cf50eb8bcd9ae1fecf08fb6cc8249238219067e5aa926
export GITLAB_URL=https://gitlab.example.com
export GITLAB_USERNAME=myname
export GITLAB_PASSWORD=mypassword
glctl get groups
glctl get projects
glctl get branchs group1/project1
glctl create branch develop --project=group1/project1 --ref=master
login - Authenticate with GitLablogout - Log out from GitLabcreate - Create new GitLab resources (projects, issues, merge requests, etc.)get - Get information about GitLab resourcesedit - Edit existing GitLab resourcesdelete - Delete GitLab resourcesreplace - Replace existing GitLab resourcesversion - Display version informationcompletion - Generate shell completion scriptsFiles are stored in $HOME/.glctl.yaml example:
access_token: 305e146a4aa23fb4021a4f162102251e85f651a058a34fb2c27d633617cf8877
created_at: 1.748339041e+09
host_url: https://gitlab.example.com
refresh_token: aefb8b4e0895799aa60cf50eb8bcd9ae1fecf08fb6cc8249238219067e5aa926
scope: api
token_type: Bearer
user_name: root
If you have an issue: report it on the issue trackerā
Kevin Berger ([email protected]ā )
Contributions are always welcome. For more information, check out the contributing guideā
Licensed under the Apache License 2.0. See LICENSEā for details.
Content type
Image
Digest
sha256:5acd80e8aā¦
Size
12.6 MB
Last updated
8 months ago
docker pull huhouhua/glctl:0.0.6