I was reading up on creating issues on Gitlab and I am wondering if it is possible to create issues using the command line? Thank you
I was reading up on creating issues on Gitlab and I am wondering if it is possible to create issues using the command line? Thank you
You can use the GitLab CLI https://glab.readthedocs.io/en/latest/issue/create.html
glab issue create [flags]
Examples:
$ glab issue create
$ glab issue new
$ glab issue create -m release-2.0.0 -t "we need this feature" --label important
$ glab issue new -t "Fix CVE-YYYY-XXXX" -l security --linked-mr 123
$ glab issue create -m release-1.0.1 -t "security fix" --label security --web
You can always invoke the GitLab API using any command line HTTP library, like curl. You can see examples of this in the Issues API documentation.
Example:
curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/4/issues?title=Issues%20with%20auth&labels=bug"
There are also some third-party CLI tools. For example, python-gitlab offers a CLI (in addition to the Python toolkit). or glab mentioned by Markus.
Ultimately, these tools are simply interacting with the GitLab REST API and are, fundamentally, not much different than using an HTTP client like curl, but are certainly a bit more convenient/usable.