Skip to content

Command Line Options

tromador edited this page Jul 1, 2026 · 2 revisions

Command Line Options

TD functionality is broken up into "sub-commands". For instance, when we refer to the run command, we mean trade run ….

If you run trade without any commands, or ask for top-level help, it will give you a list of the sub-commands available. You can find out more details about a specific command, such as local, by typing:

trade local --help

Each command has a number of optional and/or required arguments that can be specified.

Optional arguments are denoted by a keyword that starts with one or two dashes (--from, -S). The long form is clearer; the short form is quicker to type. Some short options are "stackable" count-style switches, for example -vvv, -www, and -qq.

Other options are "parameters" which take a value, for example --from Sol states the starting location for a command. You can usually write these as --param value or --param=value.

TD also accepts unambiguous abbreviations for commands and many long options, but the full option name is safer for documentation and scripts.

In the list below, you'll see --detail and -v listed together. This indicates that -v is the short form for --detail.

Filing under D for Default

You can store preferred/default arguments/options in text files called "fromfiles". Each command automatically looks for a file called .tdrc_<command>; for example, the run command looks for .tdrc_run. TD checks the current directory first and then your home directory.

You can also provide your own fromfile explicitly by prefixing the filename with +.

Basic Usage:

trade command arguments

Common Options:

These can be used with all TD commands.

 --help
 -h
   Show help for the selected command.

 --detail
 -v
   Increases the amount of detail shown in the output.
   Each use increases the detail level, e.g. `-vvv`.

 --quiet
 -q
   Reduces the amount of output shown.
   Each use increases the quiet level, e.g. `-qq`.
   NOTE: `--detail` and `--quiet` are mutually exclusive.

 --debug
 -w
   Gives additional diagnostic output while TD is running.
   Each use increases the debug level, e.g. `-www`.

 --color
 -c
   Enables colored output where supported.

Sub Commands:

For additional help on a specific command, use:

trade <command> --help

Current commands include:

trade run …
  Calculates a trade run

trade direct …
  Lists profitable trades between two endpoints without routing

trade buy …
  Finds places to buy a given item or ship

trade sell …
  Finds places to sell a given item

trade market …
  Summarizes the market at a specific station

trade nav …
  Calculates a route between two systems

trade local …
  Lists nearby systems and, optionally, stations

trade olddata …
  Lists old station data

trade buy --rare …
  Helps to find rare items

trade import …
  Imports price/station data, either from legacy `.prices` files or via plugins

trade export …
  Exports data from the database to `.csv` files

trade buildcache …
  Rebuilds the cache/database from source files

Advanced Commands:

trade buildcache
  Rebuilds the cache/database from source files.
  Note: for most users, import plugins are the normal way to build and
  refresh local data.

trade export …
  Exports data from the db to `.csv` files

RUN sub-command:

This is TD's primary trade run calculator.

Ship/Trade options:

 --capacity N
   Maximum cargo capacity.

 --credits N
   Starting credits, where N can be an exact number or can use a suffix
   such as `20k` for 20,000, `2.5m` for 2.5 million, or `1.25b`
   for 1.25 billion.
   e.g.
     --credits 20000
     --credits 20k
     --credits 15.2m

 --ly-per N.NN
   Maximum distance your ship can jump between systems at full capacity.
   e.g.
     --ly-per 19.1
     --ly-per 3

 --empty-ly N.NN
   DEFAULT: same as `--ly-per`
   Maximum jump range when empty.
   Used by `--start-jumps` and `--end-jumps`.

 --limit N
   Maximum number of units of any one cargo item to buy on a hop.
   If omitted, no extra per-item limit is applied.
   `0` means unlimited.
   e.g.
     --capacity 16 --limit 8

 --insurance N
   DEFAULT: 0
   How many credits to hold back for insurance purposes.
   e.g.
     --insurance 1000
     --insurance 5000
     --insurance 1.2m

 --margin N.NN
   DEFAULT: 0.00
   Reduces gains on each hop to provide a margin of error for
   market fluctuations.
   e.g.
     --margin 0      (no margin)
     --margin 0.01   (1% margin)

 --max-price N
 --mp N
   DEFAULT: 1,500,000
   Maximum commodity market price to use.
   Use `0` to disable this cap.

Route options:

 --from <station or system>
 -f <station or system>
   Lets you specify the starting point.
   e.g.
     --from "Asellus Primus/Beagle 2"
     --from beagle2
     --from asellus

 --to <station or system>
 -t <station or system>
   Lets you specify the final destination.
   If you specify a station, the route must finish there.
   If you specify a system, TD will consider stations in that system.
   e.g.
     --to beagle2
     --to lhs64

 --towards <goal system>
 -T <goal system>
   Builds a route that continually reduces the distance from your origin
   towards the specified goal system.
   Requires `--from`.

 --loop
   Looks for routes that return to the starting station.

 --loop-interval N
 -li N
   Requires at least N hops before revisiting the same station.
   Minimum useful value is 2.
   If `--loop-interval` is greater than `--hops`, TD will effectively
   behave as though `--unique` were enabled.

 --via <station or system>
   Requires specified systems/stations to appear on the route.
   May be repeated, and comma-separated lists are also accepted.
   e.g.
     --via Enterprise
     --via Chango
     --via lave,leesti

 --hops N
   DEFAULT: 2
   Maximum number of hops (station-to-station cargo pickups).
   Mutually exclusive with `--direct`.

 --jumps-per N
   DEFAULT: 2
   Maximum number of system-to-system jumps allowed between stations.

 --direct
   Assumes the endpoints are reachable without worrying about the jump path.
   Mutually exclusive with `--hops`.
   Cannot be used with `--loop`.

 --start-jumps N
 -s N
   Considers stations within this many jumps of your origin.
   Requires `--from`.

 --end-jumps N
 -e N
   Considers stations within this many jumps of your destination.
   Requires `--to`.

Filter options:

 --age N.NN
 --max-days-old N.NN
 -MD N.NN
   Filters out trade data older than the specified age in days.
   e.g.
     --max-days-old 7
     -MD=2

 --gain-per-ton credits
 --gpt credits
   Only consider trades which generate at least this much profit
   per ton of cargo.

 --max-gain-per-ton credits
 --mgpt credits
   DEFAULT: 0 (disabled)
   Sets an upper threshold on the maximum profit/ton that TD will believe.
   This is a way to ignore obviously bad data.
   e.g.
     --mgpt 2000
     --mgpt 2k

 --supply N
   Only consider purchases where the station has at least this many units
   in supply.

 --demand N
   Only consider sales where the station has at least this much demand.

 --pad-size SML?
 -p SML?
   Limit results to stations that match one of the specified pad sizes.
     --pad-size ML?
     -p ML?
     --pad-size ?
     --pad-size L

 --planetary YN?
   Limit results to stations matching the specified planetary attribute.
     --planetary Y?
     --planetary N

 --fleet-carrier YN?
 --fc YN?
   Limit results to stations matching the specified fleet-carrier attribute.
     --fc Y?
     --fc N

 --settlement YN?
 --stl YN?
   Limit results to stations matching the specified settlement attribute.
     --stl Y?
     --stl N

 --black-market YN?
 --bm YN?
   Limit results by black-market state.

 --ls-penalty N.NN
 --lsp N.NN
   DEFAULT: 12.5
   Applies a percentage penalty for station distance from star,
   helping TD prefer shorter supercruise legs.
   `0` disables this feature.

 --sco
   Declare an SCO (Supercruise Overcharge) drive; ignore `--ls-penalty`
   so distant stations are not penalised.

 --ls-max N
   DEFAULT: 0
   Filter stations by distance from star.
   Stations with a known distance above this value are excluded.
   `0` disables this filter.
   e.g.
     --ls-max 10000

 --avoid ITEM/SYSTEM/STATION
   Excludes matching items, systems, or stations from consideration.
   May be repeated and/or given as comma-separated lists.
   e.g.
     --avoid Gold
     --avoid Aulin
     --avoid Enterprise
     --avoid gold,aulin,enterprise

 --unique
   Only show routes which do not visit any station twice.

Other options:

 --summary
   Uses a more compact summary layout for route instructions.

 --progress
 -P
   Shows progress updates as TD calculates the route.

 -v
   Shows the jumps between each hop.

 --routes N
   DEFAULT: 1
   Shows the top N completed routes.

 --checklist
   Walks you through the purchases, sales and jumps of the chosen route.
   Note: this is intended for a single selected route.

Examples:

trade run --from "andere/kummer city" --credits 5k --capacity 8 --ly-per 8.56
trade run --from iBootis --to LiuBese --capacity 128 --credits 5m --ly-per 18 --hops 4
trade run --from iBootis --loop --capacity 128 --credits 5m --ly-per 18 --hops 4
trade run --from lave --to leesti --capacity 96 --credits 2m --ly-per 20 -v --progress

DIRECT sub-command:

Lists profitable trades between two endpoints without planning a route. Endpoints may be stations or whole systems.

Specify -v, -vv, or higher for more detail.

Options:

origin
  Station or system you are purchasing from.

dest
  Station or system you are selling to.

--local
  Show the best trades between stations within the origin system.

--gain-per-ton credits
--gpt credits
  Specify the minimum profit per ton.

--limit N
-n N
  Limit output to the first N rows.

--fill
-f
  Uses current ship cargo capacity from game data to show the
  maximum profit for a full hold.

--load
  Uses current free cargo space from game data.

--full-load
  Uses full cargo capacity from game data, ignoring current occupancy.

--supply N
-S N
  Requires at least this many units available at the seller.

--demand N
-D N
  Requires at least this many units of demand at the buyer.

--reverse
-r
  Swaps origin and destination.

--detail
-v
  Once: adds source/destination age columns.
  Twice (or more): also adds supply and demand columns.

Notes:

The `direct` command also understands the following journal-driven shortcuts
when game data is available:

  ~
    Your current docked station

  ~/<station>
    Your current system plus the specified station

  ~@/<station>
    Your current nav-target system plus the specified station

Examples:

trade direct "sol/daedalus" "groom/frank"
trade direct "sol/daedalus" "groom/frank" -v
trade direct "sol/daedalus" "groom/frank" -vv
trade direct --reverse "sol/daedalus" "groom/frank"
trade direct --fill "sol/daedalus" "groom/frank"
trade direct sol --local --limit 20

IMPORT sub-command and plugins:

This command provides two broad import paths:

  • a legacy .prices importer, and
  • plugin-based importers such as spansh and eddblink.

The recommended and supported method to populate your database is via plugins.

The legacy .prices path is deprecated, but still available for compatibility.

Import Mode (legacy default):

  • Replaces station price data for each station included in the imported file.
  • Items are removed from a station when there is an explicit 0 0 entry, or when they are absent from that station's imported data.

Merge Mode (--merge-import):

  • Only imports entries that are newer than the local data.
  • Items are only removed when there is an explicit newer 0 0 entry.

Plugins:

TD also supports "import plugins". These can fetch data from external sources and populate the local database. Current built-in examples include:

trade import -P spansh
trade import -P eddblink

Plugin-specific options are passed with -O. Use -O help for a plugin's own help.

Options:

trade import
    [-q | -v] [--ignore-unknown] [--reset-all | --merge-import]
    [filename | --url URL | -P <plugin> -O <options>]

filename
  Specifies the name of the file to load.
  e.g.
    import.prices

--url URL
  Specifies a URL to download and import.
  If `filename` is also given, TD uses it as the saved filename.

--download
  Downloads the file and stops without importing it.

".prices" import mode options:

--ignore-unknown
-i
  Unknown systems, stations and items are reported as warnings and skipped.
  Unknown stations may be created locally as placeholders.

--merge-import
-M
  Merge imported data with existing data instead of replacing station data.

--reset-all
  Clears existing price data before importing.

Plugin options:

--plug <plugin>
-P <plugin>
  Specifies a plugin to use instead of the legacy `.prices` importer.
  e.g.
    -P spansh
    -P eddblink

--option <option>
--option <option1>,<option2>,...<optionN>
-O <option>,...
  Passes options through to a plugin.
  e.g.
    -O all,skipvend
    -O help

MARKET sub-command:

Lists items bought and/or sold at a given station.

Options:

station
  Name of the station to list, e.g. "paes/ramon" or "ramoncity".

--buying
-B
  List only items bought by the station (listed as `SELL` in-game).

--selling
-S
  List only items sold by the station (listed as `BUY` in-game).

--detail
-v
  Adds more columns.
  At higher detail levels TD also includes averages, age, category
  headings, and additional demand information where relevant.

Examples:

trade market ramoncity
trade market --buying ramoncity
trade market --selling ramoncity
trade market ramoncity -v
trade market ramoncity -vv

NAV sub-command:

Provides route details between two systems without considering trade profitability.

trade nav [-q | -v] [--ly-per N.NN] from to
             [--avoid SYSTEM] [--via PLACE[,PLACE,...]]
             [--stations]
             [--pad-size SML?]
             [--planetary YN?]
             [--fleet-carrier YN?] [--settlement YN?]

Options:

--ly-per N.NN
  Constrains jumps to a maximum lightyear distance.

--avoid SYSTEM
  Produces a route that does not pass through the specified system.
  Use system names here.

--via PLACE[,PLACE,...]
  Require specified systems/stations to be en-route, in order.

--stations
-S
  Lists stations at each stop.

--pad-size SML?
-p SML?
  Filters which stations are shown/used when station details are included.

--planetary YN?
  Limit station details to the specified planetary attribute.

--fleet-carrier YN?
--fc YN?
  Limit station details to the specified fleet-carrier attribute.

--settlement YN?
--stl YN?
  Limit station details to the specified settlement attribute.

from
  Name of the starting system, or a station in that system.

to
  Name of the destination system, or a station in that system.

Examples:

trade nav mok/be v7/me --ly-per 8.56
trade nav mok/be v7/me --ly-per 8.56 -vv --stations
trade nav lave leesti --ly-per 12 --via diso
trade nav lave leesti --ly-per 12

LOCAL sub-command:

Lists local systems and, with detail enabled, stations near a given system.

trade local [-q | -v] [--ly N.NN] system

Options:

--ly N.NN
  Constrains local systems to a maximum lightyear distance.

--pad-size SML?
-p SML?
  Limit stations to those matching one of the specified pad sizes.

--planetary YN?
  Limit stations to the specified planetary attribute.

--fleet-carrier YN?
--fc YN?
  Limit stations to the specified fleet-carrier attribute.

--settlement YN?
--stl YN?
  Limit stations to the specified settlement attribute.

--stations
  Limit results to systems which have at least one matching station.

--trading
  Limit stations to those which have markets or trade data.

--age N.NN
--max-days-old N.NN
-MD N.NN
  Limit stations to those with trade data no older than the specified age.

--shipyard
  Limit stations to those known to have a shipyard.

--black-market YN?
--bm YN?
  Limit stations by black-market state.

--outfitting
  Limit stations to those known to have outfitting.

--rearm
  Limit stations to those known to sell munitions.

--refuel
  Limit stations to those known to sell fuel.

--repair
  Limit stations to those known to offer repairs.

-v
  Show stations and their distance from star.

-vv
  Also include item counts where available.

system
  Name of the system, or a station in the system.

Examples:

trade local mokosh --ly 6
trade local mokosh --ly 6 -v
trade local LAVE --trading --ly 4 -vv
trade local lave --ly 10 --black-market Y --shipyard

BUY sub-command:

Finds stations that are selling a named list of items or ships.

You can search for multiple items/categories, or multiple ships, but not both types in the same command.

trade buy
    [-q | -v] [--supply N] [--limit N]
    [--near PLACE] [--ly N.NN] [--avoid PLACES]
    [--age N.NN]
    [--pad-size SML?] [--black-market YN? | --bm YN?]
    [--planetary YN?]
    [--fleet-carrier YN?] [--settlement YN?]
    [--one-stop | --price-sort | --units-sort]
    [--gt N] [--lt N] [--ls-max N]
    category|item [category|item ...]
    ship [ship ...]

Options:

--supply N
--quantity N
  Show stations known to have at least this much supply.

--limit N
  Limit how many results are shown.

--near system
--near station
  Only consider stations within reach of the specified place.

--ly N.N
  Sets the range of `--near` (requires `--near`).

--avoid <system|station>[,<system|station>,...]
  Do not show entries for the specified systems/stations.

--age N.NN
--max-days-old N.NN
-MD N.NN
  Limit results to data no older than the specified age.

--planetary YN?
  Limit results to the specified planetary attribute.

--fleet-carrier YN?
--fc YN?
  Limit results to the specified fleet-carrier attribute.

--settlement YN?
--stl YN?
  Limit results to the specified settlement attribute.

--black-market YN?
--bm YN?
  Limit results by black-market state.

--pad-size SML?
-p SML?
  Limit results to stations matching one of the specified pad sizes.

--one-stop
-1
  When multiple items/ships are listed, only list stations that carry all
  of them.

--lt credits
--gt credits
  Specify min (`--gt`) and max (`--lt`) credit cost for items.

--price-sort
-P
  With `--near`, sort by price rather than distance.

--units-sort
-S
  Sort by available units first and then price.

--ls-max N
  Only consider stations up to this many ls from their star.

Examples:

trade buy --near achenar food
trade buy --near achenar foodcart
trade buy asp
trade buy --near achenar food,clothing,scrap --one-stop
trade buy --near achenar type6,type7 -1

SELL sub-command:

Looks for stations buying the specified item.

trade sell
    [-q | -v] [--demand N] [--limit N]
    [--near PLACE] [--ly-per N] [--avoid PLACES]
    [--age N.NN]
    [--pad-size SML?] [--black-market YN? | --bm YN?]
    [--planetary YN?]
    [--fleet-carrier YN?] [--settlement YN?]
    [--lt N] [--gt N] [--price-sort]
    item

Options:

--demand N
--quantity N
  Requires at least this much known demand.

--limit N
  Limit how many results are shown.

--near system
--near station
  Only considers stations within reach of the specified place.

--ly-per N.N
  Sets the range of `--near`.

--avoid <system|station>[,<system|station>,...]
  Do not show entries for the specified systems/stations.

--age N.NN
--max-days-old N.NN
-MD N.NN
  Limit results to data no older than the specified age.

--black-market YN?
--bm YN?
  Limit results by black-market state.

--pad-size SML?
-p SML?
  Limit results to stations that match one of the specified pad sizes.

--planetary YN?
  Limit results to the specified planetary attribute.

--fleet-carrier YN?
--fc YN?
  Limit results to the specified fleet-carrier attribute.

--settlement YN?
--stl YN?
  Limit results to the specified settlement attribute.

--lt credits
--gt credits
  Specify min (`--gt`) and max (`--lt`) prices.

--price-sort
-P
  With `--near`, sort by price rather than distance.

Examples:

trade sell gold
trade sell gold --near sol --ly-per 20
trade sell gold --near sol --ly-per 20 --price-sort
trade sell gold --black-market Y

OLDDATA sub-command:

Lists stations with the oldest known market data.

trade olddata
    [--limit N]
    [--near PLACE] [--ly N.NN] [--route]
    [--min-age N.NN]
    [--pad-size SML?]
    [--planetary YN?]
    [--fleet-carrier YN?] [--settlement YN?]
    [--ls-max N]

Options:

--limit N
  Maximum number of results to show.

--near system
--near station
  Limit results to stations within reach of the specified place.

--ly N.NN
  Sets the range of `--near`.

--route
  Requires `--near`.
  Reorders the result set into a shortest-path style route.

--min-age N.NN
  Only show data at least this many days old.

--pad-size SML?
-p SML?
  Limit results to stations matching one of the specified pad sizes.

--planetary YN?
  Limit results to the specified planetary attribute.

--fleet-carrier YN?
--fc YN?
  Limit results to the specified fleet-carrier attribute.

--settlement YN?
--stl YN?
  Limit results to the specified settlement attribute.

--ls-max N
  Only consider stations up to this many ls from their star.

Examples:

trade olddata
trade olddata --limit 50
trade olddata --near sol --ly 30
trade olddata --near sol --ly 30 --route
trade olddata --min-age 14

EXPORT sub-command:

This command generates the CSV data files of the current database. By default it exports all tables except the price table and writes them to the data directory.

CAUTION: If you have changed any CSV file and did not rebuild the database first, those changes may be overwritten. Use the buildcache command first if you need to regenerate the database from CSV/SQL sources.

trade export [--path PATH] [--tables TABLE[,TABLE,…] | --all-tables] [--delete-empty]

Options:

--path PATH
  Specify the save location of the CSV files.
  Defaults to the data directory.

--tables TABLE[,TABLE,…]
-T TABLE[,TABLE,…]
  Specify a comma-separated list of table names to export.

--all-tables
  Include the price tables in the export.

--delete-empty
  Delete CSV files without content.

Examples:

trade export --path misc
trade export -T System,Station
trade export --all-tables

Rare goods:

Rare goods are found with the buy command and its --rare switch.

trade buy --rare [ITEM[,ITEM...]] [--near SYSTEM] [--ly N.NN] [--limit N]

Options:

 --rare
   Limit results to rare commodities.

 ITEM[,ITEM...]
   Optional item/category names to limit the search. Omit to list rare
   commodities found in live market data.

 --near SYSTEM
   System or station to center the search on.

 --ly N.NN
   Search range from `--near`.

 --limit N
   Maximum number of results to show.

 --pad-size SML?
 -p SML?
   Limit results to stations that match one of the specified pad sizes.

 --planetary YN?
   Limit results to the specified planetary attribute.

 --fleet-carrier YN?
 --fc YN?
   Limit results to the specified fleet-carrier attribute.

 --settlement YN?
 --stl YN?
   Limit results to the specified settlement attribute.

 --price-sort
 -P
   When using `--near`, sort by price rather than proximity.

Examples:

trade buy --rare --near lave --ly 180
trade buy --rare --near neto --ly 50 --price-sort --limit 5
trade buy --rare lavian --near lave --ly 180

Clone this wiki locally