Console interface to Gerrit Code Review
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

14 KiB


Gertty uses a YAML based configuration file that it looks for at ~/.config/gertty/gertty.yaml. Several sample configuration files are included. You can find them in the examples/ directory of the source distribution or the share/gertty/examples directory after installation.

Select one of the sample config files, copy it to ~/.config/gertty/gertty.yaml and edit as necessary. Search for CHANGEME to find parameters that need to be supplied. The sample config files are as follows:


Only contains the parameters required for Gertty to actually run.


An exhaustive list of all supported options with examples.


A configuration designed for use with OpenDev's installation of Gerrit.


A configuration designed for use with installations of Gerrit running on

You will need your Gerrit password which you can generate or retrieve by navigating to Settings, then HTTP Password.

Gertty uses local git repositories to perform much of its work. These can be the same git repositories that you use when developing a project. Gertty will not alter the working directory or index unless you request it to (and even then, the usual git safeguards against accidentally losing work remain in place). You will need to supply the name of a directory where Gertty will find or clone git repositories for your projects as the git-root parameter.

The config file is designed to support multiple Gerrit instances. The first one is used by default, but others can be specified by supplying the name on the command line.

Configuration Reference

The following describes the values that may be set in the configuration file.


This section lists the servers that Gertty can talk to. Multiple servers may be listed; by default, Gertty will use the first one listed. To select another, simply specify its name on the command line.


A list of server definitions. The format of each entry is described below.

name (required)

A name that describes the server, to reference on the command line.

url (required)

The URL of the Gerrit server. HTTPS should be preferred.

username (required)

Your username in Gerrit. [required]

password (required)

Your password in Gerrit. Obtain it from Settings -> HTTP Password in the Gerrit web interface.


Authentication type required by the Gerrit server. Can be 'basic', 'digest', or 'form'. Defaults to 'digest'.

git-root (required)

A location where Gertty should store its git repositories. These can be the same git repositories where you do your own work --Gertty will not modify them unless you tell it to, and even then the normal git protections against losing work remain in place.


The location of Gertty's sqlite database. If you have more than one server, you should specify a dburi for any additional servers. By default a SQLite database called ~/.gertty.db is used.


If your Gerrit server uses a non-standard certificate chain (e.g. on a test server), you can pass a full path to a bundle of CA certificates here:


In case you do not care about security and want to use a sledgehammer approach to SSL, you can set this value to false to turn off certificate validation.


By default Gertty logs errors to a file and truncates that file each time it starts (so that it does not grow without bound). If you would like to log to a different location, you may specify it with this option.


Gertty listens on a unix domain socket for remote commands at ~/.gertty.sock. This option may be used to change the path.


Gertty uses a lock file per server to prevent multiple processes from running at the same time. The default is ~/.gertty.servername.lock



Gertty comes with two palettes defined internally. The default palette is suitable for use on a terminal with a dark background. The light palette is for a terminal with a white or light background. You may customize the colors in either of those palettes, or define your own palette.

If any color is not defined in a palette, the value from the default palette is used. The values are a list of at least two elements describing the colors to be used for the foreground and background. Additional elements may specify (in order) the color to use for monochrome terminals, the foreground, and background colors to use in high-color terminals.

For a reference of possible color names, see the Urwid Manual

To see the list of possible palette entries, run gertty --print-palette.

The following example alters two colors in the default palette, one color in the light palette, and one color in a custom palette.

Palettes may be selected at runtime with the -p PALETTE command line option, or you may set the default palette in the config file.


This option specifies the default palette.


Keymaps work the same way as palettes. Two keymaps are defined internally, the default keymap and the vi keymap. Individual keys may be overridden and custom keymaps defined and selected in the config file or the command line.

Each keymap contains a mapping of command -> key(s). If a command is not specified, Gertty will use the keybinding specified in the default map. More than one key can be bound to a command.

Run gertty --print-keymap for a list of commands that can be bound.

The following example modifies the default keymap:

To specify a sequence of keys, they must be a list of keystrokes within a list of key series. For example:

The default keymap may be selected with the -k KEYMAP command line option, or in the config file.


Set the default keymap.

Commentlinks are regular expressions that are applied to commit and review messages. They can be replaced with internal or external links, or have colors applied.


This is a list of commentlink patterns. Each commentlink pattern is a dictionary with the following values:


A regular expression to match against the text of commit or review messages.


A list of replacement actions to apply to any matches found. Several replacement actions are supported, and each accepts certain options. These options may include strings extracted from the regular expression match in named groups by enclosing the group name in '{}' braces.

The following replacement actions are supported:


Plain text whose color may be specified.


The replacement text.


The color in which to display the text. This references a palette entry.


A hyperlink with the indicated text that when activated will open the user's browser with the supplied URL


The replacement text.


The color in which to display the text. This references a palette entry.


A hyperlink that will perform a Gertty search when activated.


The replacement text.


The search query to use.

This example matches Gerrit change ids, and replaces them with a link to an internal Gertty search for that change id.

Change List Options


This is the query used for the list of changes when a project is selected. The default is status:open.


This section defines default sorting options for the change list.


This key specifies the sort order, which can be number (the Change number), updated (when the change was last updated), or last-seen (when the change was last opened in Gertty).


This is a boolean value which indicates whether the list should be in ascending (true) or descending (false) order.



Dependent changes are displayed as "threads" in the change list by default. To disable this behavior, set this value to false.

Change View Options


This is a list of descriptors which cause matching comments to be hidden by default. Press the t key to toggle the display of matching comments.

The only supported criterion is author.


A regular expression to match against the comment author's name.

For example, to hide comments from a CI system:


Specifies how patch diffs should be displayed. The values unified or side-by-side (the default) are supported.


When a review is saved, close the change view and pop up to the previous screen, which will be the change list for the repo.


This section defines customized dashboards. You may supply any Gertty search string and bind them to any key. They will appear in the global help text, and pressing the key anywhere in Gertty will run the query and display the results.


A list of dashboards, the format of which is described below.


The name of the dashboard. This will be displayed in the status bar at the top of the screen.


The search query to perform to gather changes to be listed in the dashboard.


The key to which the dashboard should be bound.



Reviewkeys are hotkeys that perform immediate reviews within the change screen. Any pending comments or review messages will be attached to the review; otherwise an empty review message will be left. The approvals list is exhaustive, so if you specify an empty list, Gertty will submit a review that clears any previous approvals. Reviewkeys appear in the help text for the change screen.


A list of reviewkey definitions, the format of which is described below.


This key to which this review action should be bound.


A list of approvals to include when this reviewkey is activated. Each element of the list should include both a category and a value.


The name of the review label for this approval.


The value for this approval.


Optional, it can be used to include a message during the review.


Set this to true to instruct Gerrit to submit the change when this reviewkey is activated.

The following example includes a reviewkey that clears all labels, one that leaves a +1 "Code-Review" approval and another one that leaves 'recheck' on a review.

General Options


Gertty displays a footer at the bottom of the screen by default which contains navigation information in the form of "breadcrumbs" -- short descriptions of previous screens, with the right-most entry indicating the screen that will be displayed if you press the ESC key. To disable this feature, set this value to false.


Times are displayed in the local timezone by default. To display them in UTC instead, set this value to true.


Gertty handles mouse input by default. If you don't want it interfering with your terminal's mouse handling, set this value to false.


By default, closed changes that are older than two months are removed from the local database (and their refs are removed from the local git repos so that git may garbage collect them). If you would like to change the expiration delay or disable it, uncomment the following line. The time interval is specified in the same way as the "age:" term in Gerrit's search syntax. To disable it altogether, set the value to the empty string.


By default, the size column is a pair of stacked logarithmic graphs. The top, red graph represents the number of lines removed, the bottom, green graph the number added. For an alternate representation, use this setting.


A string with one of the following values:


The default stacked bar graphs.


Rather than vertically stacked, the bar graphs are side-by-side


A single number which represents the number of lines changed (added and removed).


A list of integers to determine the magnitude of the graph increments, or the color coding of the number. If the type is graph or split-graph, the list should be four elements long. The default is 1, 10, 100, 1000 for a logarithmic representation. If the type is number, the list should be eight elements long; the default in that case is 1, 10, 100, 200, 400, 600, 800, 1000.