Skip to content

Command reference

This page summarises each rain subcommand. Exact flags match what Cyclopts generates (kebab-case on the CLI).

rain add

Add a rain total in millimetres for the appropriate daily bucket.

Parameter Flag Description
Reading --reading Rain amount (mm); typically positional.
Date --date Optional; defaults to “now” (then normalised to the 09:00 bucket).
Back fill --back-fill / --no-back-fill When enabled, inserts 0.0 mm for consecutive prior days until an existing record is found.
DB directory --db-dir Directory containing MyWeather.sqlite (default: .).
rain add 12.5
rain add 4 --date 2025-05-01
rain add 0 --back-fill --date 2025-05-10

rain change

Update an existing row for the same bucket as add.

Parameter Flag Description
Reading --reading New amount (mm).
Date --date Optional; same default semantics as add.
DB directory --db-dir Same as add.
rain change 10.2
rain change 9 --date 2025-04-20 --db-dir ~/weather

rain graph

Plot rainfall totals (mm) as a terminal bar chart.

Parameter Flag Description
Size --size Number of buckets to show (default: 30).
Group --group daily, weekly, monthly, yearly, or annually (default: daily).
DB directory --db-dir Same as above.
rain graph
rain graph --size 14 --group weekly

rain rainy-days

Plot counts of rainy days (days where stored total > 0) aggregated by --group. The Y axis is a count, not millimetres.

Parameter Flag Description
Size --size Number of aggregated buckets (default: 30).
Group --group Same choices as graph.
DB directory --db-dir Same as above.
rain rainy-days --group monthly --size 12

rain weewx-import

Import from a WeeWX SQLite database (archive_day_rain). Values are converted from inches to millimetres (× 25.4).

Parameter Flag Description
WeeWX DB --weewx-db Path to weewx.sdb (default: weewx.sdb in the working directory).
DB directory --db-dir Target MyWeather.sqlite directory (default: .).
rain weewx-import
rain weewx-import --weewx-db /var/lib/weewx/weewx.sdb --db-dir ~/weather

Note

weewx-import uses INSERT for imported rows. If you need idempotent merges or conflict handling, adjust the workflow (for example import into a fresh DB or extend the code).

See also