6 releases
| 0.3.3 | Dec 19, 2025 |
|---|---|
| 0.3.2 | Dec 19, 2025 |
| 0.3.0 | Feb 3, 2025 |
| 0.2.0 | Feb 3, 2025 |
| 0.1.0 | Feb 3, 2025 |
#1060 in Command line utilities
285KB
5K
SLoC
bath 🚿
bath is a terminal UI (TUI) tool for managing environment-variable profiles (e.g. PATH, compiler flags, and linker flags) backed by SQLite.
Features
- Profiles in SQLite: store multiple named profiles and switch/export them consistently
- Interactive TUI: edit variables with live preview of the resulting export output
- Export for shell eval: print
export ...statements for the selected profile - Modes: prepend/append/replace behavior per variable
Installation
cargo install bath
Usage
- TUI mode:
bath
-
TUI navigation (k9s-style)
-
Views: single active view with an always-visible bottom Details pane.
-
Global keys
:: command palette (jump views / run commands)/: filter current view (live while typing,Esccancels/clears)j/kor Arrow keys: move selectiong/End: jump to bottomG/Home: jump to topq: quit
-
Common
:commands:profiles:vars:parts:items:defs:preview:export:help:use <profile>:themes(list available theme presets):theme <name>(switch theme; also persists to config):new-var(create a custom env var definition):new-item(create an item):quit
-
Theming
- Config file:
~/.config/bath/config.toml(or$XDG_CONFIG_HOME/bath/config.toml) - Example:
- Config file:
[theme]
preset = "dracula"
# Optional overrides (accepts oklch(...) like DaisyUI, or #RRGGBB)
primary = "oklch(75% 0.18 346)"
base_100 = "#0b0f19"
- Demo
The README includes a GIF (assets/bath.gif) showing the TUI in action.
- Export a profile:
bath export my_profile
- Eval in your shell:
eval "$(bath export my_profile)"
- Choose export mode (
prependis default):
bath export my_profile --mode append
- Export help:
bath export --help
Data storage
Bath stores profiles in a SQLite database at:
~/.bath.db
Development
pre-commit hooks
This repository includes a .pre-commit-config.yaml to run basic checks locally (formatting, clippy, tests).
pipx install pre-commit
pre-commit install
pre-commit run -a
CI
GitHub Actions runs the following on every push and pull request:
cargo fmt --checkcargo clippy -- -D warningscargo test
Releasing (crates.io)
Releases are automated with release-plz (it opens a release PR and publishes to crates.io after merge).
- Required GitHub setting: in
Settings → Actions → General, set workflow permissions to allow GitHub Actions to create and approve pull requests. See the official quickstart: https://release-plz.dev/docs/github/quickstart - Required secret:
CARGO_REGISTRY_TOKEN(crates.io token with scopespublish-newandpublish-update), used by.github/workflows/release-plz.yml.
License
GPL-3.0. See LICENSE.
Dependencies
~29–43MB
~678K SLoC