Configuration

Redline reads one TOML file. Tokens never go in it. They come from environment variables.

Where the file lives

Redline reads $XDG_CONFIG_HOME/redline/config.toml. When XDG_CONFIG_HOME is unset, that is ~/.config/redline/config.toml, on macOS too.

To use another file, set REDLINE_CONFIG to its path.

With no config file, REDLINE_URL and REDLINE_TOKEN define one Redmine provider called redmine.

A full example

config.toml
# The provider Redline opens on. The first one when unset.
default = "work"

[providers.work]
kind = "redmine"
url = "https://redmine.example.com"
token_env = "REDLINE_WORK_TOKEN"     # the variable that holds the API key

[providers.work.headers]              # extra headers a gateway wants
X-Redmine-Username = "${REDLINE_WORK_USER}"

[providers.work.limits]
per_minute = 60                       # requests started a minute, on average
at_once = 2                           # requests in flight

[providers.work.kinds]                # tracker name = Redline kind
Epic = "epic"
"User story" = "story"

[providers.work.statuses]             # status name = category
Resolved = "done"

[providers.home]
kind = "redmine"
url = "${HOME_REDMINE_URL}"
token_env = "HOME_REDMINE_KEY"

[[views]]
name = "Bugs this week"
query = "kind:bug updated:>-7d status:open"

[[views]]
name = "Release 2.0"
provider = "work"
query = "milestone:\"2.0\" sort:priority"

Top level

SettingMeans
defaultThe provider Redline opens on. When unset, Redline opens on the first provider in the file.

Providers

Each [providers.<name>] table is one tracker. The name is yours to choose, such as work or home. Commands and views refer to the provider by this name.

SettingMeans
kindThe tracker type. redmine is the only kind today.
urlThe address of the tracker.
token_envThe environment variable that holds the token. Defaults to REDLINE_<NAME>_TOKEN. See Token names.
headersExtra HTTP headers to send, for a gateway that wants them.
limits.per_minuteThe most requests Redline starts in a minute, on average. Default 60.
limits.at_onceThe most requests Redline has in flight at the same time. Default 2.
kindsMaps tracker names to Redline kinds.
statusesMaps status names to Redline categories.

The limits settings control the pacer. Up to 8 requests may start back to back, so opening Redline is quick. After that they are spaced out. Rate limits explains how it works.

Token names

When token_env is unset, Redline reads REDLINE_<NAME>_TOKEN. The name is the provider’s name in upper case, with anything but letters and digits turned into _. A provider called my-work reads REDLINE_MY_WORK_TOKEN.

A provider whose token is not set still shows in the sidebar, with the line to add to your shell profile. The other providers work as usual.

Kinds

Redmine admins name their own trackers. Redline maps each tracker name to one of five kinds: theme, epic, story, task, or bug. The mapping goes by name and has defaults. Add a kinds table to change it:

config.toml
[providers.work.kinds]
Epic = "epic"
"User story" = "story"

Quote a tracker name that has a space in it. Without a table, a tracker named like "Bug" or "Defect" is a bug, "Epic" is an epic, "Story" or "Feature" is a story, and anything else is a task.

Statuses

Every status has a category: backlog, todo, active, done, or canceled. Redline guesses it from the status name. Add a statuses table to change a guess:

config.toml
[providers.work.statuses]
Resolved = "done"

Without a table, a closed status named like "Rejected" is canceled and other closed ones are done. "Backlog" is backlog, "New" or "Open" is to do, and other open ones are active.

Views

A view is a saved query. Views show in the sidebar. Open one with Enter, or with :view <name>.

SettingMeans
nameThe name in the sidebar.
queryA query in the query language.
providerRuns the view on this provider only. Without it, the view runs on every provider and merges the results.

Environment variables in strings

Any string can use ${VAR}. Redline replaces it with the value of the environment variable VAR. If the variable is not set, Redline stops with an error that names it.

config.toml
url = "${HOME_REDMINE_URL}"

Use this for anything you keep out of the file: a URL, a user name, or a header.

The cache

Redline keeps answers from the tracker in $XDG_CACHE_HOME/redline, which is ~/.cache/redline when XDG_CACHE_HOME is unset. Deleting the cache is always safe. Clear it from a shell with redline cache clear, or from inside Redline with :cache clear.

Commands for the config

$ redline config init
$ redline config check
$ redline config path
  • redline config init writes a starting config file.
  • redline config check signs in to each provider and reports.
  • redline config path prints where the file is.

Edit this page on GitHub