# cyber-rain
[](https://crates.io/crates/cyber-rain)
[](https://docs.rs/cyber-rain)
[](https://github.com/anthony-cervantes/cyber-rain/actions/workflows/ci.yml)
[](https://github.com/anthony-cervantes/cyber-rain/releases)
`cyber-rain` is a smoother, themeable Rust terminal digital-rain visualizer: falling glyph streams, raw terminal rendering, hidden messages, deterministic demo runs, and enough controls to make your terminal look like it knows something you do not.

## Install
With Homebrew:
```sh
brew install anthony-cervantes/tap/cyber-rain
```
From crates.io:
```sh
cargo install cyber-rain
```
With Nix:
```sh
nix run github:anthony-cervantes/cyber-rain
```
For Arch/AUR packaging, see [packaging/aur](packaging/aur).
From this repository:
```sh
cargo install --path .
```
Or run it directly:
```sh
cargo run --release
```
Quit with `q`, `Esc`, or `Ctrl-C`. Pause with `Space` or `p`.
## Features
- Themeable rain: `green`, `cyan`, `amber`, `crimson`, `ghost`, and `rainbow`.
- Tunable motion with `--fps`, `--speed`, and `--density`.
- TOML config from `~/.config/cyber-rain/config.toml` or `--config`.
- Custom TOML themes with `--theme examples/themes/phosphor.toml`.
- Hidden message mode with `--message "follow the white rabbit"`.
- Message files with `--message-file transmissions.txt`.
- Presets with `--preset classic|ghost|cyberpunk|calm|chaos`.
- Deterministic demo mode with `--demo`.
- Auto-exit recording mode with `--duration 10`.
- Clean screensaver output with `--no-status`.
- Shell completions with `--generate-completion zsh`.
- Man page generation with `--generate-man`.
- Benchmark mode with `--benchmark 3`.
- Runtime stats with `--stats`.
- `--ascii` mode for plain terminals.
- `--seed` for reproducible recordings or demos.
- Terminal resize handling.
- Buffered terminal rendering for smoother motion.
- Occasional burst storms, or `--calm` to disable them.
- Live keyboard controls while the rain is running.
## Controls
```text
q / Esc / Ctrl-C quit
Space / p pause
Up / Down speed up or slow down
Left / Right decrease or increase density
1-6 switch palettes
b toggle burst storms
m toggle hidden messages
s toggle status bar
```
## Examples
```sh
cyber-rain --palette rainbow --message "wake up neo"
cyber-rain --palette amber --density 0.55 --speed 3
cyber-rain --ascii --seed 42
cyber-rain --calm --fps 30 --density 0.4
cyber-rain --preset cyberpunk --message-file transmissions.txt
cyber-rain --demo --duration 10 --no-status
cyber-rain --theme examples/themes/sunset.toml
cyber-rain --benchmark 3 --benchmark-width 120 --benchmark-height 40
```
For a deterministic demo recording:
```sh
cyber-rain --demo --duration 10
```
Generate shell completions:
```sh
cyber-rain --generate-completion bash > cyber-rain.bash
cyber-rain --generate-completion zsh > _cyber-rain
cyber-rain --generate-completion fish > cyber-rain.fish
```
Generate a man page:
```sh
cyber-rain --generate-man man/cyber-rain.1
```
## Config
`cyber-rain` automatically reads `~/.config/cyber-rain/config.toml` when it exists. CLI flags override config values.
```sh
cyber-rain --print-config-template > ~/.config/cyber-rain/config.toml
```
Example config and themes live under [examples](examples).
Theme files support custom glyph sets and RGB colors:
```toml
name = "phosphor"
glyphs = "0123456789ABCDEF"
[colors]
head = [236, 255, 239]
hot = [255, 255, 255]
tail = [32, 255, 128]
dim = [0, 72, 42]
```
## Demo Asset
The README preview is generated from an actual PTY run:
```sh
python3 scripts/render_demo.py --output assets/demo.svg
```
## Release Checklist
1. Update `CHANGELOG.md`.
2. Run `cargo fmt --all`.
3. Run `cargo test`.
4. Run `cargo clippy -- -D warnings`.
5. Run `cargo package --allow-dirty`.
6. Publish with `cargo publish`.
7. Create a tag like `v0.3.0` and push it to build GitHub release binaries.
## License
Licensed under either of:
- Apache License, Version 2.0
- MIT license
at your option.