Skip to content

run

gapline run <file.gl>

run reads a .gl batch file, loads the feed declared by its first feed directive into memory, and executes the listed commands in order. The feed stays in memory between steps; disk is only touched when the script reaches a save directive.

Scripts are sequential and stop-on-error: the first failure halts execution, and the feed is not persisted unless an earlier save had already been reached. This makes .gl files safe to re-run idempotently.

run does not accept CLI flags beyond the global ones — all per-command options live inside the script. Nested run is not supported.

ArgumentDescription
<file.gl>Path to the .gl batch file. Required, positional.

run has no command-specific flags. See global flags for the options that apply to every sub-command.

weekly-fix.gl
# Load the feed once — subsequent commands operate on it in memory.
feed ./data/gtfs.zip
# Prune retired routes and anything referencing them.
delete trips --where "route_id=OLD_LINE" --confirm
# Normalise the route short name.
update routes --where "route_id=R1" --set route_short_name="1" --confirm
# Final validation, machine-readable, written to disk.
validate --format json -o report.json
# Atomic write — only reached if every previous step succeeded.
save ./data/gtfs-patched.zip

Run the script:

Terminal window
gapline run weekly-fix.gl
CodeMeaning
0Every command completed. The feed was saved if and only if save was reached.
1A command in the script failed. The feed on disk is unchanged.
2The script itself has a syntax error (unknown directive, malformed line).
3I/O error (script file missing, feed unreadable, save path unwritable).

See concepts/exit-codes for the complete table.