GCLI(5) | File Formats Manual | GCLI(5) |
gcli
— gcli
configuration file formats
gcli
has two different configuration
files. A user configuration file that contains default values for
gcli
and a repository-local configuration that
contains sensible default values for a given repository. The latter is meant
to be checked into the repository and provide these default values to other
users as well.
The user configuration file is located in ${XDG_CONFIG_HOME}/gcli/config. On most systems this equal to ${HOME}/.config/gcli/config.
The user configuration file contains definitions for accounts as well as sensible default values for things like an editor.
The file is structured in sections, each section has a name and consists of a collection of key-value pairs. E.g.:
section-name { key1 = value 1 key2 = value 2 }
There must be a section named “defaults” which may contain the following keys:
EDITOR
.GCLI_ACCOUNT in
gcli(1).GCLI_ACCOUNT in
gcli(1).GCLI_ACCOUNT in
gcli(1).All other sections define accounts for forges. Each of these account definitions have the account name as their section name and may have one or more of the following keys defined:
forge-type | default value |
github | https://api.github.com |
gitlab | https://gitlab.com/api/v4 |
gitea | https://codeberg.org/api/v1 |
For repository-local configuration you can use a special configuration file. It contains definitions for gcli that are specific to the repository.
The Repository-local configuration file is located in the root directory of the repository and should be named .gcli.
It contains a list of key-value pairs. Allowed keys are:
An example for the user configuration file consisting of both a Github and a Gitlab account:
defaults { editor=/path/to/ganoooo/emacs github-default-account=herrhotzenplotz-gh gitlab-default-account=herrhotzenplotz-gitlab } herrhotzenplotz-gh { account=herrhotzenplotz token=foobar apibase=https://api.github.com forge-type=github } herrhotzenplotz-gl { account=herrhotzenplotz token=<valid gitlab api token> apibase=https://gitlab.com/api/v4 forge-type=gitlab }
Notice that this allows you to run gcli and force it to use a specific Gitlab account. E.g.:
$ gcli -a herrhotzenplotz-gl issues -a
The .gcli file for the gcli project itself looks like this:
pr.upstream=herrhotzenplotz/gcli pr.base=trunk pr.inhibit-delete-source-branch=yes
Nico Sonack aka. herrhotzenplotz <nsonack@herrhotzenplotz.de> and contributors.
Please report bugs via E-Mail to ~herrhotzenplotz/gcli-discuss@lists.sr.ht.
Alternatively you can report them on any of the forges linked at https://herrhotzenplotz.de/gcli. However, the preferred and quickest method is to use the mailing list.
2024-May-25 | gcli 2.3.0 |