Usage

See Install to set up sjvair. Once installed:

sjvair monitors list --county Fresno --output fresno.csv

Output

Most commands print CSV to stdout by default. Pass --output PATH to write a file; the format is inferred from the extension (.csv, .json, .yaml). Force a format with --format {csv,json,yaml}. Re-running a command that would overwrite an existing file errors unless you pass the global --force.

sjvair monitors list   # CSV to stdout
sjvair monitors list --output monitors.json   # JSON, format from extension
sjvair monitors list --format yaml   # YAML to stdout

Timestamps

--timestamp/--start/--end (map create, timelapse create) are UTC unless they carry an explicit offset (e.g. 2026-07-04 20:30:00-07:00). Pass --tz (or set SJVAIR_TZ) with an IANA zone name to localize naive timestamps instead of computing the offset by hand — an explicit offset in the timestamp itself always wins over --tz.

sjvair --tz America/Los_Angeles map create \
  --type pm25 \
  --county Fresno \
  --timestamp "2026-07-04 20:30:00" \
  --output fresno-2026-07-04.png

Region filters

Wherever a command accepts a location, these flags resolve to a region and scope the results. Use at most one:

--county · --city · --zip · --tract (FIPS) · --urban (urban-area name) · --region-id (region ID)

Environment

Each of these client-configuration flags has a matching environment variable, so you can set them once instead of repeating them on every command:

Flag

Environment variable

Default

--base-url

SJVAIR_BASE_URL

https://www.sjvair.com/api/2.0/

--api-key

SJVAIR_API_KEY

(none — public endpoints work without one)

--timeout

SJVAIR_TIMEOUT

30 seconds

--tz

SJVAIR_TZ

(none — naive timestamps are treated as UTC)

A .env file in the current directory is loaded automatically — no flag needed to enable it. This is the easiest way to stop passing --tz on every timestamp-bearing command:

# .env
SJVAIR_TZ=America/Los_Angeles
# --tz is no longer needed -- SJVAIR_TZ from .env applies automatically
sjvair map create --type pm25 --county Fresno --timestamp "2026-07-04 20:30:00" --output fresno.png

Shell completion

sjvair supports tab completion for commands and options, provided by the underlying Click framework — nothing extra to install beyond sjvair itself.

_SJVAIR_COMPLETE=bash_source sjvair > ~/.sjvair-complete.bash
echo '. ~/.sjvair-complete.bash' >> ~/.bashrc

Restart your shell (or re-source the rc file) afterward. To try it out first without installing anything:

eval "$(_SJVAIR_COMPLETE=bash_source sjvair)"

Entry types

Entry types are lowercase slugs: pm25, pm10, pm100, o3, no2, so2, co, co2, particulates, temperature, humidity, pressure.