bath

Crates.iobath
lib.rsbath
version0.3.0
created_at2025-02-03 22:08:08.437544+00
updated_at2025-02-03 23:19:31.342868+00
descriptionA TUI tool to manage and export environment variable profiles
homepagehttps://github.com/4thel00z/bath
repositoryhttps://github.com/4thel00z/bath
max_upload_size
id1541137
size77,682
ransomware (4thel00z)

documentation

README

bath

Motivation

$PATH is outdated.
So are a lot of other environment variables and mechanisms that rely on juggling : characters to establish implicit lookup precedence. It's 2025—why are we still managing our toolchains like it's the 90s?

Imagine a world where you can manage different versions of your applications, compiler flags, and linker options * properly*—all stored neatly in an SQLite database. No more weird shell scripts, no more lost configurations, and no more wondering why gcc just picked up the wrong library version again.

What does bath do?

Bath is a TUI-based CLI tool that helps you manage, edit, preview, and export your environment variable profiles. It brings order to your $PATH, compiler flags, and other C/C++-related variables without making you do mental gymnastics.

Features:

Manage $PATH like a sane person
Store multiple environment profiles in SQLite
Interactive TUI with fuzzy search & live previews
Export configurations in a format you can eval
Prepend, Append, or Replace mode for any env var
No weird shell scripts, just pure config bliss

Installation

cargo install bath

Running bath

Inside bath, you get:

  • Two Tabs: One for environment variables, one for profiles (←/→ to switch).
  • Full Control:
    • a → Edit/add a variable (with a fuzzy search for types and live export preview).
    • e → Modify an existing variable.
    • d → Delete a variable.
  • A live preview of the full export command (ready to be eval'd in your shell).

Exporting profiles

Bath doesn't generate weird scripts with shebangs. It just prints what you need to eval, like this:

➜ bath export my_profile
export PATH="/opt/coolstuff/bin:$PATH"
export CFLAGS="-O2 -Wall"
export LDFLAGS="-L/opt/coolstuff/lib"

Or, if you don't specify a profile, you'll get a TUI where you can select one interactively.

The recommended way to use bath export is by eval-ing it's output!

eval $(bath export my_profile)

License

This project is licensed under the GPL-3 license.

Commit count: 7

cargo fmt