Skip to content

Command reference

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

rainlog 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 rainlog.sqlite (default: ~/.local/share/rainlog/).
rainlog add 12.5
rainlog add 4 --date 2025-05-01
rainlog add 0 --back-fill --date 2025-05-10

rainlog 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.
rainlog change 10.2
rainlog change 9 --date 2025-04-20 --db-dir ~/weather

rainlog 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.
rainlog graph
rainlog graph --size 14 --group weekly

rainlog 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.
rainlog rainy-days --group monthly --size 12

rainlog 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 rainlog.sqlite directory (default: ~/.local/share/rainlog/).
rainlog weewx-import
rainlog 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