Skip to content

create

gapline create <target> -s KEY=VALUE [KEY=VALUE...] [-f PATH] [--confirm] [-o PATH]

create inserts a single new record into the target file. The record is built from the --set KEY=VALUE pairs — every field required by the GTFS spec for that file must be provided.

Unless --confirm is passed, gapline prints a summary of the record it is about to insert and waits for interactive confirmation. By default, the feed is overwritten in place; pass --output to write a new archive.

Referential integrity is validated before the insert is applied. A foreign key that does not resolve (for example, a trip_id that is not in trips.txt) aborts the command.

ArgumentValues
<target>Any GTFS file supported for CRUD — see read for the complete list of 17 values, including underscored aliases like stop_times.
FlagShortValueDescription
--feed-fPATHPath to the GTFS feed. Optional when [default] feed is set in a config file.
--set-sKEY=VALUEField values for the new record. Accepts multiple KEY=VALUE pairs after a single --set flag, separated by spaces.
--confirmSkip the interactive confirmation prompt. Required for non-TTY use (scripts, CI).
--output-oPATHWrite the modified feed to this path instead of overwriting the source.

Global flags are listed on reference/global-flags.

Terminal window
gapline create stops -f gtfs.zip \
--set stop_id=NEW_01 stop_name="Place du marché" stop_lat=45.5017 stop_lon=-73.5673 \
--confirm
Terminal window
gapline create routes -f gtfs.zip \
--set route_id=R999 agency_id=A1 route_short_name=999 route_long_name="Express" route_type=3 \
--confirm
Terminal window
gapline create stops -f gtfs.zip \
--set stop_id=NEW_02 stop_name="Terminus" stop_lat=45.5 stop_lon=-73.5 \
--confirm \
-o gtfs-patched.zip
CodeMeaning
0Record inserted successfully.
1A required field is missing, or a foreign key in --set does not resolve.
2Configuration error.
3I/O error (feed not found, output path unwritable).

See concepts/exit-codes for the complete table.