This section is for people who just want to install the program. If you want more information, check developers issues at the DEV section below.
The first easiest option is SNAP.
Try the snap
command to install or to update the program.
sudo snap install gitlab-cli --edge --devmode
sudo snap refresh gitlab-cli --edge --devmode
If you have NodeJs installed,
a good option is NPM. Try the npm
command to install or to update the program.
npm i -g @andreclinio/gitlab-cli
Use --help
option for instructions.
$ gitlab-cli --help
...
A brief example to see your projects:
$ gitlab-cli --token XXXXX --url https://gitlab.mycompany.com projects
- [id:1] : projectA - group1/projectA
- [id:2] : projectB - group2/projectB
Tip: The personel token can set previosly inside Gitlab -- see docspersonal_access_tokens.html for details
You can create the file gitlab-cli.cfg
(in the current directory) or a
$HOME/gitlab-cli.cfg
(in your home directory) to store the GitLab URL and your personel token.
Once configured this way, you can use the options
--auto-token
and/or --auto-url
(or just simply --auto-all
) to avoid exposing sensitive data in command line.
The file should follow the JSON syntax:
{
"token": "yadayadayada",
"url": "https://gitlab.mycompany.com"
}
Example:
$ gitlab-cli --auto-token --auto-url projects -n 2
- [id:1] : projectA - group1/projectA
- [id:2] : projectB - group2/projectB
$ gitlab-cli --auto-all issues -n 10 --pna projectA --opened
- [issue-1231] Yada yada
- [issue-1232] Yada yada yada
Tip: Do not grant read access for file (gitlab-cli.cfg
) to other users...
git clone https://github.com/andreclinio/gitlab-cli
cd gitlab-cli
npm i
npx tsc && node build/main.js --help
npx tsc && node build/main.js --help
npx tsc && node build/main.js --token XXXXX --url https://mygit.mycompany.com issues --opened --verbose --project-name my-project
npx tsc && node build/main.js release-notes --token XXXXX --url https://mygit.mycompany.com --project-name my-project --verbose --milestone-name my-milestone
See package.json
scripts for details.
npm run release
npm run release-beta
The npm
command below is used only to remove snap files and rebuild the project.
See the package.json
file.
npm run snapcraft
snapcraft login
snapcraft upload gitlab-cli_<version>_<arch>.snap
snapcraft status gitlab-cli
snapcraft list-revisions gitlab-cli
rm -fr *.snap
The npm login
command below is needed only at first time.
First, move to a valid tag (git checkout
) and perform the folloeing commands:
npm login
npm publish --access public
npm publish --tag beta --access public
Installing a beta version:
npm i @andreclinio/gitlab-cli@0.5.1-beta.1 --global