Skip to content

This is a CLI that helps you use the Gitlab GraphQL API.

License

Notifications You must be signed in to change notification settings

axeldotdev/gitlab-cli

Repository files navigation

Gitlab CLI

Latest Version on Packagist GitHub Tests Action Status GitHub Code Style Action Status Total Downloads

This is a CLI that helps you use the Gitlab API.

Installation

You can install the package via composer:

composer create-project --prefer-dist axeldotdev/gitlab-cli gitlab-cli

Gitlab API Resource

https://docs.gitlab.com/ee/api/api_resources.html

Usage

You need to run the commands below in a Git repository.

Authentication

You need to generate an access token on Gitlab to use the API.

To create a new access token, go to your access tokens section on GitLab (or the equivalent URL on your private instance) and create a new token. See also the GitLab access token documentation for more informations.

When you have your personal access token, add it to your composer global auth.json. See also The Composer authentification documentation for more informations.

Currently this package only works with Gitlab cloud. If you have a self-hosted Gitlab instance, you need to wait next release, I'm sorry.

WORK IN PROGRESS

Then you can register it with the command: gitlab-cli register:token {personal_token}

If you have a self-hosted Gitlab, you can register it with the command: gitlab-cli register:host {host_uri}

Issues

Create

TODO

Update

TODO

Delete

TODO

Reopen

gitlab-cli issue:reopen {issue_iid}

# gitlab-cli issue:reopen 345

Close

gitlab-cli issue:close {issue_iid}

# gitlab-cli issue:close 345

Browse

gitlab-cli issue:browse {issue_iid}

# gitlab-cli issue:browse 345

Only works on macOS

Add Labels

gitlab-cli issue:label:add {issue_iid} {label_names}

# gitlab-cli issue:label:add 345 todo,bug,auth

Remove Labels

gitlab-cli issue:label:remove {issue_iid} {label_names}

# gitlab-cli issue:label:remove 345 todo,bug,auth

Replace Labels

gitlab-cli issue:label:add {issue_iid} {old_label_names} {new_label_names}

# gitlab-cli issue:label:add 345 todo testing

Link Milestone

gitlab-cli issue:milestone:link {issue_iid} {milestone_iid}

# gitlab-cli issue:milestone:link 345 25

Unlink Milestone

gitlab-cli issue:milestone:unlink {issue_iid} {milestone_iid}

# gitlab-cli issue:milestone:unlink 345 25

Link Epic

gitlab-cli issue:epic:link {issue_iid} {milestone_iid}

# gitlab-cli issue:epic:link 345 25

Unlink Epic

gitlab-cli issue:epic:unlink {issue_iid} {milestone_iid}

# gitlab-cli issue:epic:unlink 345 25

Milestones

Create

TODO

Update

TODO

Delete

TODO

Releases

Create

TODO

Update

TODO

Delete

TODO

Epics

Testing

composer test

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

Credits

License

The MIT License (MIT). Please see License File for more information.

About

This is a CLI that helps you use the Gitlab GraphQL API.

Topics

Resources

License

Security policy

Stars

Watchers

Forks

Releases

No releases published