#toolchain #env-var #env #gcc #sqlite #fuzzy-search #cli

app bath

A TUI tool to manage and export environment variable profiles

3 releases (breaking)

0.3.0 Feb 3, 2025
0.2.0 Feb 3, 2025
0.1.0 Feb 3, 2025

#635 in Command line utilities

Download history 85/week @ 2025-01-28 259/week @ 2025-02-04

344 downloads per month

GPL-3.0 license

58KB
1K SLoC

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.

Dependencies

~27–37MB
~633K SLoC