File: gcli.1.in

package info (click to toggle)
gcli 2.3.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,096 kB
  • sloc: ansic: 19,013; makefile: 312; yacc: 261; sh: 142; lex: 53
file content (283 lines) | stat: -rw-r--r-- 8,180 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
.Dd @PACKAGE_DATE@
.Dt GCLI 1
.Os @PACKAGE_STRING@
.Sh NAME
.Nm gcli
.Nd interact with git forges without using a web-browser
.Sh SYNOPSIS
.Pp
.Nm
.Op overrides
.Cm subcommand
.Op options
.Sh DESCRIPTION
.Nm
can be used to interact with
.Xr git 1
forges like GitHub, GitLab and Gitea from the command line in order to
make many tasks like managing issues and pull requests easier.
.Pp
Calls to
.Nm
usually consist of either only the subcommand to list requested data
or the subcommand plus further subcommands or options to perform
various tasks. Some commands may also take an item to operate on and
accept multiple actions that will be performed on the item (e.g. PRs
may be summarized, comments fetched and a diff printed all in one
command).
.Pp
The default behaviour of
.Nm
can be overridden to accommodate more nuanced use cases. Manual
overrides must be passed before subcommands and their options.
.Sh SUBCOMMANDS
Most of these subcommands are documented in dedicated man pages.
.Bl -tag -width milestones
.It Cm issues
Issues in repositories. See
.Xr gcli-issues 1 .
.It Cm pulls
Pull Requests on repositories. See
.Xr gcli-pulls 1 .
.It Cm labels
Manage labels for issues and pull/merge requests on repositories. See
.Xr gcli-labels 1 .
.It Cm forks
Forking repositories. See
.Xr gcli-forks 1 .
.It Cm gists
Github Gists are like paste bins to where you can dump code snippets
etc. See
.Xr gcli-gists 1 .
.It Cm snippets
Support for Gitlab snippets. See
.Xr gcli-snippets 1 .
.It Cm repos
Manage your own or other repositories. See
.Xr gcli-repos 1 .
.It Cm comment
Submit comments under issues and PRs. See
.Xr gcli-comment 1 .
.It Cm status
Print a list of TODOs and/or notifications. See
.Xr gcli-status 1 .
.It Cm pipelines
Inspect and manage Gitlab Pipelines. See
.Xr gcli-pipelines 1 .
.It Cm releases
Create and manage releases. See
.Xr gcli-releases 1 .
.It Cm milestones
List and manage milestones. See
.Xr gcli-milestones 1 .
.It Cm config
Change user settings for the forge. Allows you to e.g. upload or
delete ssh keys. See
.Xr gcli-config 1 .
.It Cm api
Perform direct queries to the API and dump the JSON response to
stdout. This is primarily intended to assist debugging gcli. See
.Xr gcli-api 1 .
.It Cm version
Print version and exit.
.El
.Sh OPTIONS
.Nm
overrides are:
.Bl -tag -width indent
.It Fl a , -account Ar override-account
Manually override the default account.
.Ar override-account
must name a config section for an account in the global config file. See
.Sx FILES .
.It Fl r , -remote Ar override-remote
Use
.Ar override-remote
as the remote when trying to infer repository data.
.It Fl c , -colours
Ignore
.Ev NO_COLOR
as well as whether the output is not tty and print ANSI escape
sequences for changing text formatting. Default is to output colours
unless stdout is not a tty. See
.Xr isatty 3 .
This is useful in combination with modern pagers such as
.Xr less 1 .
.It Fl q , -quiet
Suppresses most output of
.Nm .
.It Fl v , -verbose
Be very verbose. This means that warnings about missing config files
and request steps are printed to stderr.
.It Fl t , -type Ar forge-type
Forcefully override the forge type. Set
.Ar forge-type
to
.Sq github ,
.Sq gitlab
.Sq gitea ,
or
.Sq bugzilla
to connect to the corresponding services.
.El
.Pp
Common options across almost all of the subcommands are:
.Bl -tag -width indent
.It Fl s , -sorted
Reverse the output such that most recent items appear at the bottom.
.It Fl n , -count Ar n
Fetch multiple items of data. The default is usually 30 items, but
this parameter allows to fetch more than that. Setting
.Ar n
to -1 will result in all pages being queried and all items being read.
However, be careful with that, since if there is a lot of data to be
fetched, it may result in rate limiting by the Github API, aside from
the fact that it may also take a considerable amount of time to
process.
.It Fl a , -all
Fetch all data, including closed issues and closed/merged PRs.
.It Fl y , -yes
Do not ask for confirmation when performing destructive operations or
performing submissions. Always assume yes.
.It Fl o , -owner Ar owner
Operate on the given owner (organization or user).  Can only be used
in combination with
.Fl r .
.It Fl r , -repo Ar repo
Operate on the given repository.  Can only be used in combination with
.Fl o .
.It Fl i Ar id
Operate on the given numeric identifier.
.El
.Pp
Other options specific to the context are documented in the respective
man pages.
.Sh ENVIRONMENT
.Bl -tag -width XDG_CONFIG_HOME
.It Ev EDITOR
If the gcli config file does not name an editor,
.Nm
may use this editor.
.It Ev XDG_CONFIG_HOME
There should be a subdirectory called gcli in the directory this
environment variable points to where
.Nm
will go looking for its configuration file. See
.Sx FILES .
.It Ev GCLI_ACCOUNT
Specifies an account name that should be used instead of an inferred
one. The value of
.Ev GCLI_ACCOUNT
can be overridden again by using
.Fl a Ar account-name .
This is helpful in cases where you have multiple accounts of the same
forge-type configured and you don't want to use the default.
.It Ev NO_COLOR
If set to
.Sq 1 ,
.Sq y or
.Sq yes
(capitalization ignored) this will suppress output of ANSI colour
escape sequences. See
.Sx OPTIONS
(--colours).
.El
.Sh FILES
.Bl -tag -width ${XDG_CONFIG_HOME}/gcli/config -compact
.It Pa ${XDG_CONFIG_HOME}/gcli/config
The user configuration file for gcli. It contains account definitions
as well as sensible default values. See
.Xr gcli 5 .
.Pp
.It Pa .gcli
A repo-specific config file intended to be committed into the repo
so that users don't have to manually specify all the options like
.Fl -in ,
.Fl -from ,
.Fl -base etc.
when creating pull requests. See
.Xr gcli 5 for details about this file.
.Pp
.El
.Sh EXAMPLES
List recently opened issues in the current upstream repository:
.Bd -literal -offset indent
$ gcli issues
.Ed
.Pp
Merge upstream PR #22:
.Bd -literal -offset indent
$ gcli pulls -p 22 merge
.Ed
.Pp
Get a summary and comments of upstream PR #22:
.Bd -literal -offset indent
$ gcli pulls -p 22 summary comments
.Ed
.Pp
Establish a connection to github and print the last 10 pull requests
in contour-terminal/contour regardless of their state.
.Bd -literal -offset indent
$ gcli -t github pulls -o contour-terminal -r contour -a -n10
.Ed
.Pp
This can be useful if neither your config file nor the directory you're
working from contain the relevant forge and repository information.
.Sh SEE ALSO
.Xr git 1 ,
.Xr gcli-issues 1 ,
.Xr gcli-pulls 1 ,
.Xr gcli-labels 1 ,
.Xr gcli-comment 1 ,
.Xr gcli-review 1 ,
.Xr gcli-forks 1 ,
.Xr gcli-repos 1 ,
.Xr gcli-gists 1 ,
.Xr gcli-releases 1 ,
.Xr gcli-comment 1
.Xr gcli-pipelines 1
.Xr gcli-config 1
.Sh HISTORY
The idea for
.Nm
appeared during a long rant on IRC where the issue with the official
tool written by GitHub became clear to be the manual dialing and DNS
resolving by the Go runtime, circumventing almost the entirety of the
IP and DNS services of the operating system and leaking sensitive
information when using Tor.
.Pp
Implementation started in October 2021 with the goal of having a
decent, sufficiently portable and secure version of a cli utility to
interact with the GitHub world without using the inconvenient web
interface.
.Pp
Later, support for GitLab and Gitea (Codeberg) were added.
.Sh AUTHORS
.An Nico Sonack aka. herrhotzenplotz Aq Mt nsonack@herrhotzenplotz.de
and contributors.
.Sh CAVEATS
Not all features that are available from the web version are available in
.Nm .
However, it is a non-goal of the project to provide all this
functionality.
.Sh BUGS
There is an undocumented
.Cm ci
subcommand available for GitHub CI services. The subcommand is
undocumented as it is not well tested and likely subject to changes.
.Pp
Please report bugs via E-Mail to
.Mt @PACKAGE_BUGREPORT@ .
.Pp
Alternatively you can report them on any of the forges linked at
.Lk @PACKAGE_URL@ .
However, the preferred and quickest method is to use the mailing
list.
.Pp
You may also report an issue like so:
.Bd -literal -offset indent
$ gcli -a some-gitlab-account \\
        issues create \\
        -o herrhotzenplotz -r gcli \\
        "BUG : ..."
.Ed