The full flag reference, grouped by what you're trying to do. New here? Start with the README quick start, then come back for the details.
osmsg --last hour|day|week|month|year
osmsg --days 7
osmsg --start "2026-04-01 00:00:00" --end "2026-04-08 00:00:00"
osmsg --update # resume from last finished run in <name>.duckdb
# (must use the same --url as the prior run; switching
# granularity would double-count via changeset_stats)Times are UTC.
osmsg --url minute|hour|day # planet replication shortcuts
osmsg --url https://... # any OSM replication base
osmsg --country nepal --country india --country africa # Geofabrik regions, resolved liveWhen
--urlis omitted, osmsg picks a planet replication granularity that fits the requested span: minute for spans under 6h, hour for 6h–7d, day for ≥7d. A warning prints when the auto-switch happens; pass--urlexplicitly to override (also suppressed by--country,--update, or multiple--urlvalues).
osmsg --hashtags hotosm-project-1234 --hashtags mapathon
osmsg --hashtags mapathon --exact-lookup # match whole hashtag, not substring
osmsg --users alice --users bob
osmsg --boundary nepal # Geofabrik region name
osmsg --boundary region.geojson # path to a GeoJSON file
osmsg --boundary '{"type":"Polygon",...}' # inline GeoJSON string
--boundaryfilters changesets whose bounding box intersects the given geometry. A Geofabrik region name resolves from the same index as--country— no separate file needed.--boundaryonly filters; it does not change the replication source. To scope the replication source to a country's diffs, use--countryinstead.Each
--users,--hashtags,--tags,--length,--country,--url,-ftakes one value at a time; pass the flag again for additional values.Editor stats are always included when
--changesetor--hashtagsis on: theeditorscolumn lists everycreated_bytag the user appeared with.
osmsg --tags building --tags highway # per-key create/modify counts
osmsg --length highway --length waterway # length in metres for created ways
osmsg --keys # every tag key (no value breakdown)
osmsg --all # every key=value combo + changeset metadata (hashtags, editors)osmsg --last day -f parquet # default; one columnar file
osmsg --last day -f csv -f json -f markdown
osmsg --last day --summary # daily breakdown in each requested format
osmsg --last day -f psql --psql-dsn "host=localhost dbname=osm user=osm"Every run writes
<name>.duckdbplus the formats you ask for. Parquet is the canonical exchange: open with DuckDB, polars, or pandas directly.
--summaryfollows the same-fformats: requesting-f csv --summaryproduces both<name>.csvand<name>_summary.csv. Thepsqltarget is intentionally skipped for summary, since the daily breakdown is just a query over the four base tables, so consumers derive it on demand instead of duplicating data.
Long invocations are easier to maintain in YAML. Keys mirror the CLI flag names.
osmsg --config nepal.yaml # all flags from yaml
osmsg --config nepal.yaml --rows 50 # CLI overrides yaml# nepal.yaml
name: nepal_weekly
country: [nepal]
last: week
hashtags:
- hotosm-project-1234
- mapathon
users: [alice, bob, charlie]
tags: [building, highway]
formats: [parquet, markdown]
summary: true
update: trueDownloaded .osc.gz files cache to a per-user dir (~/Library/Caches/osmsg on macOS,
~/.cache/osmsg on Linux). Re-running the same range reuses them, so no network is needed.
--cache-dir to relocate, --delete-temp to clean up after a run.
--country and any geofabrik URL need OSM credentials. Resolution order:
--username(CLI) +OSM_PASSWORDenv var, or--password-stdinto pipe a password in (e.g.cat secret | osmsg --password-stdin ...)OSM_USERNAME+OSM_PASSWORDenv vars (auto-loaded from.env)- Interactive prompt (TTY only)
The CLI does not accept
--passworddirectly, because passwords on the command line leak into shell history andpsoutput. Use stdin or env vars.
# Daily Nepal stats with summary
osmsg --country nepal --last day --summary --tags building --tags highway
# Mapathon report (hashtag substring, last 6 days, with TM totals)
osmsg --hashtags smforst --days 6 --summary --tm-stats
# Full year of global stats to Postgres (incremental-friendly)
osmsg --start "2025-01-01 00:00:00" --end "2026-01-01 00:00:00" \
--url day --all -f parquet -f psql \
--psql-dsn "host=localhost dbname=osm_stats user=osm"
# All-time Nepal stats via planet/day (Geofabrik only keeps ~4 months per country)
osmsg --url day --boundary nepal --start "2012-09-13" -f parquet -f psql ...
# Cron / systemd: refresh Nepal nightly
osmsg --country nepal --update
map_changesper row is the sum of the nine element columns ({nodes,ways,rels}_{created,modified,deleted}); POI counters are tracked separately.