Skip to content

Configuration

gapline reads its settings from a TOML file. Keep a gapline.toml next to your feed and you can drop -f, --format, and --min-severity from every command. This page walks through where to put the file and what to put in it; reference / configuration file lists every accepted key.

Settings resolve in four layers, highest priority first. Each layer overrides the next, so the CLI always has the last word.

PriorityLayerTypical use
1CLI flags (--feed, --format, --min-severity…)One-off overrides for a single invocation.
2./gapline.toml in the current directoryPer-project defaults — commit it alongside the feed.
3Global user config (see paths below)Personal preferences shared across every project.
4Built-in defaultsWhat you get with no config at all.

--config PATH on the CLI replaces layer 2 with the file you point at. Layer 3 is still consulted as a lower-priority layer — local overrides still win.

  • Local./gapline.toml in the directory you run gapline from.
  • Global~/.config/gapline/config.toml.
Terminal window
mkdir -p ~/.config/gapline
touch ~/.config/gapline/config.toml

This is all most projects need. Drop a feed path and the default format, stop typing them on every command.

gapline.toml
[default]
feed = "./data/gtfs.zip"
format = "json"
Terminal window
# With the config above, this runs validate on ./data/gtfs.zip and emits JSON.
gapline validate -o report.json

Once the project has a cadence (strict severity in CI, a couple of rules you know are noisy, specific speed thresholds for your rail feed), pin them in the config.

gapline.toml
[default]
feed = "./data/gtfs.zip"
format = "json"
[validation]
min_severity = "warning"
disabled_rules = ["block_id_trip_overlap"]
[validation.thresholds.speed_limits]
rail_kmh = 320
bus_kmh = 120
[validation.thresholds.calendar]
min_feed_coverage_days = 60
feed_expiration_warning_days = 14
[output]
show_progress = true
group_by_rule = true

The full list of accepted sections and keys is on reference / configuration file.

  • A missing file at any layer is silently skipped. No error, no warning — it just does not contribute to the merged config.
  • A malformed file (broken TOML, unknown key) aborts with exit code 2 and a message that points to the file and the offending token. gapline deliberately refuses unknown keys so a typo in a section name does not silently pass.
  • A semantically invalid value (a negative speed limit, zero calendar coverage, a transfer warning greater than the max) aborts with the same exit code and cites the specific field.
Config error in ./gapline.toml: unknown field `validattion`, expected one of `default`, `validation`, `performance`, `output`, `batch`, `experimental`