bath 0.3.1

A TUI tool to manage and export environment variable profiles
bath-0.3.1 is not a library.

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
  • Export a profile:
bath export my_profile
  • Eval in your shell:
eval "$(bath export my_profile)"
  • Choose export mode (prepend is default):
bath export my_profile --mode append

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 --check
  • cargo clippy -- -D warnings
  • cargo 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 scopes publish-new and publish-update), used by .github/workflows/release-plz.yml.

License

GPL-3.0. See LICENSE.