Skip to content

canair config

usage: canair config [-h] {show,example,path,get,set,unset,edit} ...

``canair config`` — view and manage user configuration.

Shows the effective (merged) configuration, where it lives on disk, the
resolved transport, and the configured devices — and edits the user config
(``$XDG_CONFIG_HOME/canair/config.yaml``) in place, preserving comments.

Subcommands:
  show            Show config file locations + effective settings (default)
  example         Print the commented, fully-documented example config
  path            Print the user config file path (handy for scripting)
  get KEY         Print one value; KEY may be dotted (e.g. transport.port)
  set KEY VALUE   Set a value (dotted keys create nested mappings)
  unset KEY       Remove a value
  edit            Open the user config in $EDITOR

Examples:
  canair config
  canair config example
  canair config set default_wican home
  canair config set devices.home.host 10.0.2.86
  canair config set devices.home.transport wican-ws
  canair config get transport.host
  canair config unset transport.port

Every key is documented — with inline comments — in `canair config example`
(`config.example.yaml` in the repo root); it's the authoritative reference. See
also: https://philipkocanda.github.io/canair/reference/config/

positional arguments:
  {show,example,path,get,set,unset,edit}
    show                Show config locations and effective settings
    example             Print the commented, fully-documented example config
    path                Print the user config file path
    get                 Print a single (dotted) config value
    set                 Set a (dotted) config value
    unset               Remove a (dotted) config value
    edit                Open the user config in $EDITOR

options:
  -h, --help            show this help message and exit

canair config show

usage: canair config show [-h] [--json]

options:
  -h, --help  show this help message and exit
  --json      Emit machine-readable JSON

canair config example

usage: canair config example [-h]

Print `config.example.yaml` — the authoritative, fully-commented reference for
every config key. See also:
https://philipkocanda.github.io/canair/reference/config/

options:
  -h, --help  show this help message and exit

canair config path

usage: canair config path [-h]

options:
  -h, --help  show this help message and exit

canair config get

usage: canair config get [-h] key

positional arguments:
  key         Config key, e.g. default_wican or transport.port

options:
  -h, --help  show this help message and exit

canair config set

usage: canair config set [-h] [-s] [key] [value]

Set a config value:  canair config set KEY VALUE
Dotted keys create nested mappings (e.g. transport.type).

known keys:
  default_profile
  profiles_dir
  default_wican
  devices.<alias>.host
  devices.<alias>.transport                valid: slcan-tcp, wican-ws, elm327-tcp
  devices.<alias>.port
  devices.<alias>.bitrate
  wican_addresses.<alias>
  wican_model                              valid: pro, classic
  check_for_updates
  grid_region                              valid: EU, UK, AU, CN, US, JP
  transport.type                           valid: slcan-tcp, wican-ws, elm327-tcp
  transport.host
  transport.port
  transport.bitrate
  transport.fallback
  transport.connect_timeout
  transport.fallback_order
  transport.reconnect_max_wait
  transport.ws_ping_interval
  transport.stale_cycles_before_reconnect
  transport.expected_responses

Every key is documented in `canair config example` (config.example.yaml) and https://philipkocanda.github.io/canair/reference/config/

positional arguments:
  key           Config key, e.g. transport.type or devices.home.host
  value         Value (coerced to int/float/bool where unambiguous)

options:
  -h, --help    show this help message and exit
  -s, --string  Store the value verbatim as a string (skip int/bool coercion)

examples:
  canair config set default_wican home
  canair config set devices.home.host 10.0.2.86
  canair config set devices.home.transport slcan-tcp   # or: wican-ws
  canair config set transport.fallback false            # disable auto-fallback
  canair config set transport.connect_timeout 5.0       # fallback probe timeout (s)
  canair config set transport.fallback_order home,vpn,ap   # comma-separated
  canair config set wican_model pro               # or: classic
  canair config set check_for_updates false

Values are coerced to int/float/bool/null where unambiguous; pass --string to
force a string (e.g. a zero-padded id). Dotted keys create nested mappings.
Comma-separated values are stored as a list for list-valued keys
(transport.fallback_order).

See `canair config example` (config.example.yaml) for every key documented
with inline comments, and https://philipkocanda.github.io/canair/reference/config/ for the rendered reference.

canair config unset

usage: canair config unset [-h] key

positional arguments:
  key         Config key to remove

options:
  -h, --help  show this help message and exit

canair config edit

usage: canair config edit [-h]

options:
  -h, --help  show this help message and exit