create
Synopsis
Section titled “Synopsis”gapline create <target> -s KEY=VALUE [KEY=VALUE...] [-f PATH] [--confirm] [-o PATH]Description
Section titled “Description”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.
Arguments
Section titled “Arguments”| Argument | Values |
|---|---|
<target> | Any GTFS file supported for CRUD — see read for the complete list of 17 values, including underscored aliases like stop_times. |
Options
Section titled “Options”| Flag | Short | Value | Description |
|---|---|---|---|
--feed | -f | PATH | Path to the GTFS feed. Optional when [default] feed is set in a config file. |
--set | -s | KEY=VALUE | Field values for the new record. Accepts multiple KEY=VALUE pairs after a single --set flag, separated by spaces. |
--confirm | Skip the interactive confirmation prompt. Required for non-TTY use (scripts, CI). | ||
--output | -o | PATH | Write the modified feed to this path instead of overwriting the source. |
Global flags are listed on reference/global-flags.
Examples
Section titled “Examples”Insert a new stop
Section titled “Insert a new stop”gapline create stops -f gtfs.zip \ --set stop_id=NEW_01 stop_name="Place du marché" stop_lat=45.5017 stop_lon=-73.5673 \ --confirmInsert a route with a new short name
Section titled “Insert a route with a new short name”gapline create routes -f gtfs.zip \ --set route_id=R999 agency_id=A1 route_short_name=999 route_long_name="Express" route_type=3 \ --confirmWrite the result to a new file
Section titled “Write the result to a new file”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.zipExit codes
Section titled “Exit codes”| Code | Meaning |
|---|---|
0 | Record inserted successfully. |
1 | A required field is missing, or a foreign key in --set does not resolve. |
2 | Configuration error. |
3 | I/O error (feed not found, output path unwritable). |
See concepts/exit-codes for the complete table.
See also
Section titled “See also”gapline read— confirm fields before inserting.gapline update— modify an existing record instead.- Concepts / Referential integrity.