gitlab cli always connecting to localhost instead of gitlab.com ?

#13 · closed · 5 comments

View on GitHub ↗

e72575f3

I want to use the gitlab cli with gitlab.com but no matter what I put in the config "url" field gitlab cli always connects to 127.0.0.1, how can I use it with gitlab.com ? gitlab get project { [GitlabRequestError: connect ECONNREFUSED 127.0.0.1:80 (req "error"), GET undefined/api/v3/users -1 headers: {}] code: 'ECONNREFUSED', errno: 'ECONNREFUSED', syscall: 'connect', address: '127.0.0.1', port: 80, name: 'GitlabRequestError', data: { resBody: undefined }, headers: {}, statusCode: undefined, url: 'undefined/api/v3/users', method: 'get' }

Comments

der-On

Sorry, Undocumented feature. Place your config under `~/.config/gitlab-cli/default.js` https://github.com/der-On/gitlab-cli/blob/master/bin/cli.js#L33

e72575f3

I have set the url in config: ``` cat ~/.config/gitlab-cli/default.js var config = { "url": "https://gitlab.com", "username": "<user>", "privateToken": "<token>" } ``` but it comes out as undefined and tries to connect to localhost ``` gitlab get { [GitlabRequestError: connect ECONNREFUSED 127.0.0.1:80 (req "error"), GET undefined/api/v3/users -1 headers: {}] code: 'ECONNREFUSED', errno: 'ECONNREFUSED', syscall: 'connect', address: '127.0.0.1', port: 80, name: 'GitlabRequestError', data: { resBody: undefined }, headers: {}, statusCode: undefined, url: 'undefined/api/v3/users', method: 'get' } ``` even specifying the file with `--config=` yields the same error

der-On

Are you missing `module.exports = config;` in your config file?

e72575f3

I was, thank you! Is there a way to use the issue iid instead of the longform id when adding comments / closing an issue? and is there a way to list filter keys, e.g. how do I filter issues for an assignee? Thanks so much!

der-On

@e72575f3 Filtering issues can be done using the `-f` or the `-l` option (see [usage](https://github.com/der-On/gitlab-cli/blob/master/usage.txt#L28)) If you think you are typing to much you can [create aliases](https://github.com/der-On/gitlab-cli/blob/master/usage.txt#L19)