|
2 | 2 |
|
3 | 3 | CLI commands for performing actions against GitLab repositories. The main reasons for building this tool is to be able to use it without any prerequisites and to deal with global labels, which GitLab API doesn't expose. |
4 | 4 |
|
| 5 | +- [Installation](#installation) |
5 | 6 | - [Usage](#usage) |
6 | 7 | - [Labels](#labels) |
7 | 8 | - [Specifying a repository](#specifying-a-repository) |
8 | 9 | - [The config file](#the-config-file) |
9 | | -- [Install](#install) |
10 | | - - [Update](#update) |
11 | 10 | - [Development](#development) |
12 | 11 |
|
| 12 | +## Installation |
| 13 | + |
| 14 | +Follow the instructions from the [releases page](https://github.com/clns/gitlab-cli/releases). |
| 15 | + |
13 | 16 | ## Usage |
14 | 17 |
|
15 | | -See help for all available commands (`gitlab-cli -h`). |
| 18 | +For all available commands see the command's help: `gitlab-cli -h`. The most common commands are documented below. |
16 | 19 |
|
17 | 20 | ### Labels |
18 | 21 |
|
19 | | -##### Copy global labels into a target repository |
| 22 | +#### Copy global labels into a repository |
20 | 23 |
|
21 | | -> GitLab Limitation: Currently there's no way to [access global labels through the API](https://twitter.com/gitlab/status/724619173477924865), so this tool provides a workaround for copying them into a repository. Note that you should configure the global labels manually in GitLab. |
| 24 | +GitLab Limitation: Currently there's no way to [access global labels through the API](https://twitter.com/gitlab/status/724619173477924865), so this tool provides a workaround to copy them. |
22 | 25 |
|
23 | 26 | ```sh |
24 | 27 | gitlab-cli label copy -U https://gitlab.com/<USER>/<REPO> -t <TOKEN> |
25 | 28 | ``` |
26 | 29 |
|
27 | 30 | > Tip: To avoid specifying `-U` and `-t` every time you refer to a repository, you can use the config file to save the details of it. See [Specifying a repository](#specifying-a-repository). |
28 | 31 |
|
29 | | -##### Copy labels from one repository to another |
| 32 | +#### Copy labels from one repository to another |
30 | 33 |
|
31 | 34 | ```sh |
32 | 35 | gitlab-cli label copy -r <NAME> <GROUP>/<REPO> |
33 | 36 | ``` |
34 | 37 |
|
35 | 38 | > Tip: The above command copies labels between repositories on the same GitLab instance. To copy from/to a different GitLab instance, use the config file as explained in [Specifying a repository](#specifying-a-repository). |
36 | 39 |
|
37 | | -##### Update label(s) based on a regex match |
| 40 | +#### Update labels that match a regex |
38 | 41 |
|
39 | 42 | ```sh |
40 | 43 | gitlab-cli label update -r <NAME> --match <REGEX> --replace <REPLACE> --color <COLOR> |
41 | 44 | ``` |
42 | 45 |
|
43 | 46 | > Note: `<REGEX>` is a Go regex string as in <https://golang.org/pkg/regexp/syntax> and `<REPLACE>` is a replacement string as in <https://golang.org/pkg/regexp/#Regexp.FindAllString>. |
44 | 47 |
|
45 | | -##### Delete label(s) that match a regex |
| 48 | +#### Delete labels that match a regex |
46 | 49 |
|
47 | 50 | ```sh |
48 | 51 | gitlab-cli label update -r <NAME> --regex <REGEX> |
49 | 52 | ``` |
50 | 53 |
|
51 | 54 | ### TODO |
52 | 55 |
|
53 | | -Currently only the label commands are useful. Other commands can be added as needed. Feel free to open pull requests or issues. |
| 56 | +Other commands can be added as needed. Feel free to open pull requests or issues. |
54 | 57 |
|
55 | 58 | ### Specifying a repository |
56 | 59 |
|
@@ -106,22 +109,6 @@ But there's no need to manually edit this file. Instead use the config commands |
106 | 109 | - `gitlab-cli config repo save ...` - save a repository |
107 | 110 | - `gitlab-cli config repo show -r <repo>` - show the details of a saved repository |
108 | 111 |
|
109 | | -## Install |
110 | | - |
111 | | -1. Follow the instructions from the [releases page](https://github.com/clns/gitlab-cli/releases) and run the `curl` command, which the releases page specifies, in your terminal. |
112 | | - |
113 | | - > Note: If you get a "Permission denied" error, your `/usr/local/bin` directory probably isn't writable and you'll need to install Compose as the superuser. Run `sudo -i`, then the commands from the release page, then `exit`. |
114 | | - |
115 | | -2. Test the installation. |
116 | | - |
117 | | - ```sh |
118 | | - gitlab-cli version |
119 | | - ``` |
120 | | - |
121 | | -### Update |
122 | | - |
123 | | -When running any command, the tool will notify you if a new update is available (e.g. `New update available: 1.0.1. Run 'gitlab-cli update' to update.`), and you can simply run `gitlab-cli update` to update. |
124 | | - |
125 | 112 | ## Development |
126 | 113 |
|
127 | 114 | You'll need a [Go dev environment](https://golang.org/doc/install). |
|
0 commit comments