zdc-0.1.2 is not a library.
vZDC
Small Rust CLI for vZDC — quick access to pubs, charts, METAR/TAF, preferred routes and simple weather lookups.
Quick features
- pubs aliases -> open/print pub URL from configurable TOML
- chart lookup (aviationapi v2) -> open or print PDF URLs; fuzzy matching + ambiguity handling
- metar / taf -> fetch, pretty-print and show raw text (AviationWeather.gov)
- route -> fetch preferred routes (aviationapi preferred-routes)
- weather -> runs metar + taf for one station
- verbose mode for debugging
Prereqs
- Rust toolchain (rustc + cargo)
- Network access
- Optional: system PDF viewer for
chartopen behavior
Quick install
- From crates.io (after publishing):
- From Git:
- From a local checkout:
# or build
Quick usage
# list configured pubs
# print pub URL for alias "iad"
# preferred routes (pretty table)
# METAR / TAF
# Combined weather (metar + taf)
# charts (opens the PDF, prints URL if open fails)
# print URL only
# verbose for debug
Commands (summary)
- route [--raw] — preferred route lookup
- metar [--raw] [--json] — METAR fetch/parse
- taf [--raw] [--json] — TAF fetch/parse
- weather [--raw] [--json] — run metar then taf
- chart <QUERY...> [-l|--link] [--airac ] — chart search/open
- -p / --pubs — print pub URL for alias
- --list — list configured pub aliases
- -v / --verbose — verbose mode
Configuration
- Pubs config TOML (default)
- macOS / Linux default: $XDG_CONFIG_HOME/zdc/pubs.toml or ~/.config/zdc/pubs.toml
- override with env var: ZDC_CONFIG=/path/to/file.toml
Example pubs.toml
[]
= "https://vzdc.org/f/iad"
= "https://vzdc.org/f/bwi"
= "https://vzdc.org/f/dca"
= "https://vzdc.org/f/pct"
= "https://vzdc.org/f/pct-zdc2"
= "https://vzdc.org/f/pct-zdc3"
= "https://vzdc.org/f/zdc"
= "https://vzdc.org/f/zdc2"
= "https://vzdc.org/f/zdc3"
= "https://vzdc.org/f/zbw"
= "https://vzdc.org/f/zid"
= "https://vzdc.org/f/zjx"
= "https://vzdc.org/f/zny"
= "https://vzdc.org/f/zob"
= "https://vzdc.org/f/ztl"
= "https://vzdc.org/f/loa-usnv"
= "https://vzdc.org/f/staff"
= "https://vzdc.org/f/chp-charts"
= "https://vzdc.org/f/jrv-charts"
= "https://vzdc.org/f/charts-mtv"
= "https://vzdc.org/f/shd-charts"
= "https://vzdc.org/f/atpa"
= "https://vzdc.org/f/ids"
= "https://vzdc.org/f/train-radar"
= "https://vzdc.org/f/train-tower"
= "https://vzdc.org/f/sfra-pilot"
= "https://vzdc.org/f/sfra"
Environment overrides
- ZDC_CONFIG — full path to pubs TOML
- ZDC_CHARTS_BASE — charts API base URL (default:
https://api-v2.aviationapi.com/v2)- useful for testing or alternate chart backends
APIs used
- Charts: aviationapi v2 (default) — /v2/charts?airport=...
- METAR/TAF: AviationWeather.gov data API
- Preferred routes: aviationapi preferred-routes search endpoint
Behavior notes / tips
- Airport codes are normalized (leading
Kdropped when appropriate) charttries to open the PDF with the system default; if that fails it prints the absolute URL(s)- Use
-vto surface requests/responses for debugging - If you see a filename (e.g.
00294ad.pdf) returned, the CLI normalizes it into an absolute URL using the charts base URL
Dependencies (high level)
- clap, tokio, reqwest, serde, serde_json, toml, dirs
- comfy-table for terminal tables
- regex + strsim for fuzzy chart matching
- open for launching URLs
Extending / contributing
- Add new subcommands in
src/main.rs(use clap Subcommand) - Keep sensitive defaults configurable via env vars or config file
- Run
cargo fmtandcargo clippybefore PRs
Troubleshooting
- charts: if you get "No charts found", run with
-vto see which endpoint was queried and any API response body. - opening PDFs: if open fails, CLI prints the URL; you can manually download/open it.
- config file not found: a default pubs.toml is created at first run; set ZDC_CONFIG to override.