How to use Gitlab problems from terminal?

I know that you can use Github issues on the command line by installing ghi.

However, is there a way to use similar tools to publish / add / remove / edit repository problems on Gitlab ?

+8
source share
4 answers

You have a similar shell (in python, not ruby) with Itxaka/pyapi-gitlab

 git = gitlab.Gitlab(host=host) git.login(user=user, password=password) git.getall(git.getprojects) git.getissues(page=1, per_page=40) 

In ruby, it will be NARKOZ/gitlab :

 # set an API endpoint Gitlab.endpoint = 'http://example.net/api/v3' # => "http://example.net/api/v3" # set a user private token Gitlab.private_token = 'qEsq1pt6HJPaNciie3MG' # => "qEsq1pt6HJPaNciie3MG" # configure a proxy server Gitlab.http_proxy('proxyhost', 8888) # proxy server w/ basic auth Gitlab.http_proxy('proxyhost', 8888, 'proxyuser', 'strongpasswordhere') # list projects Gitlab.projects(per_page: 5) 

He can extract problems .

+3
source

Answering my question.

At first, I thought ghi would also be available on Gitlab, but after that I found out below about ghi questions in which the ghi owner says that he does not currently support Gitlab.

Just in case, you spend time looking for compatibility between ghi and using Gitlab.

I am not opposed to this feature (if you simply introduce it), but the GHI is definitely built around GitHub issues. I am not a GitLab user either, so the promotion should come from someone else.

https://github.com/stephencelis/ghi/issues/135

0
source

Looks like someone wrote a CLI tool for the gitlab API:

https://python-gitlab.readthedocs.io/en/stable/cli.html

 pip3 install --user python-gitlab $EDITOR ~/.python-gitlab.cfg 

A configuration example for the main gitlab site, but you can also add your own local instances:

 [global] default = gitlab ssl_verify = true timeout = 5 [gitlab] url = https://gitlab.com private_token = <insert API token here> api_version = 4 

Make sure your path is /home/<username>/.local/bin/

Then from your gitlab repository:

 gitlab issue list 

I'm not sure if it is as complete as ghi , but it looks like it supports a lot of APIs.

0
source

This answer does not affect your whole question, only a small part of it.

To create a problem programmatically, you can use the New Problem function through the URL .

This allows you to create a problem with the title and description (using the template if necessary) through the URL with the parameters.

The URL is as follows:

 https://gitlab.instance.url/group_name/project_name/issues/new?issue[title]=Your%20issue%20title&issue[description]=Issue%20description 

I wrapped this in an AHK shortcut associated with CTRL ALT T. I have included the URLEncode function for completeness.

 ;; Create issue on Gitlab tasks list with selected text as issue title ^!t:: ClipSaved := ClipboardAll Sleep, 300 Send ^c title := URLEncode(clipboard) mainURL := "https://gitlab.instance.com/gitlab/group_name/project/issues/new?issue[title]=" fullURL := mainURL title Run, %fullURL% Clipboard := ClipSaved return UrlEncode( String ) { OldFormat := A_FormatInteger SetFormat, Integer, H Loop, Parse, String { if A_LoopField is alnum { Out .= A_LoopField continue } Hex := SubStr( Asc( A_LoopField ), 3 ) Out .= "%" . ( StrLen( Hex ) = 1 ? "0" . Hex : Hex ) } SetFormat, Integer, %OldFormat% return Out } 
0
source

All Articles