- Rust 76.5%
- Shell 23.5%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
|
|
||
| .forgejo | ||
| completions | ||
| src | ||
| tests | ||
| .gitignore | ||
| build.rs | ||
| Cargo.lock | ||
| Cargo.toml | ||
| CLAUDE.md | ||
| LICENSE | ||
| README.md | ||
sporah-cli
Terminal and waybar client for the Sporah pollen API. It shows current pollen levels as Unicode bar graphs.
$ sporah city Berlin # in season; output illustrative
Berlin
alder: 🌳 ██░░░
birch: 🌲 ███░░
grass: 🌱 █░░░░
...
The API only covers Europe, and outside the pollen season it often has no data. In both cases (the API answers 204 or 400) sporah prints "no pollen data available" and exits with status 1.
Install
Download a prebuilt static Linux binary (x86_64, runs on any distro) from releases:
version=0.1.0 # the latest release
curl -LO "https://code.austinschaefer.com/schaefera/sporah-cli/releases/download/v$version/sporah-$version-x86_64-linux.tar.gz"
curl -LO "https://code.austinschaefer.com/schaefera/sporah-cli/releases/download/v$version/SHA256SUMS"
sha256sum -c SHA256SUMS
tar -xzf "sporah-$version-x86_64-linux.tar.gz"
mkdir -p ~/.local/bin
install -m 755 "sporah-$version-x86_64-linux/sporah" ~/.local/bin/
The archive also contains the shell completions (see below).
Or build from source (needs a Rust toolchain):
cargo install --git https://code.austinschaefer.com/schaefera/sporah-cli
Usage
sporah city Berlin # by city name
sporah city "Rothenburg ob der Tauber" # quote names with spaces
sporah coords --lat 52.52 --lon 13.40 # by coordinates
sporah --values-only city Berlin # bars only, no pollen type names
Global options go before the subcommand:
| Option | Default | Description |
|---|---|---|
--url <URL> / SPORAH_URL |
https://api.sporah.eu |
API base URL, e.g. for a self-hosted instance |
--waybar |
off | Print one pollen type per line, rotating forever |
--interval <SECS> |
2 |
Seconds per pollen type in waybar mode |
--refresh <SECS> |
3600 |
Seconds between API fetches in waybar mode |
--values-only |
off | Omit the pollen type name prefix |
Waybar
In --waybar mode the CLI keeps running and prints a new line every --interval seconds, cycling through the pollen types that currently have data. Use it as a continuous custom module:
"custom/pollen": {
"exec": "sporah --waybar city Berlin",
"restart-interval": 60
}
sporah exits on any fetch error, including a refresh inside the loop and the no-data case above. restart-interval makes waybar start it again.
Shell completions
completions/ contains generated completions (build.rs regenerates them on each build):
# bash
cp completions/sporah.bash ~/.local/share/bash-completion/completions/sporah
# zsh: copy into any directory on your $fpath
cp completions/_sporah ~/.zsh/completions/_sporah
Self-hosting the API
See the server repo, then point the CLI at your instance with SPORAH_URL.
License
GPL-3.0. See LICENSE.