Skip to main content

Installs a WaterJuice shell prompt into your bash or zsh run-command file

Project description

wj-prompt

A WaterJuice project.

A small CLI that installs a WaterJuice shell prompt into your bash or zsh run-command file. The prompt shows the host name and working directory in cyan, followed by a green $ for normal users (or a red # for root):

myhost:~/code/wj-prompt $

The prompt line is written inside a clearly marked block, so re-running updates it in place and uninstall removes it cleanly without disturbing the rest of your rc file.

Usage

# Install (or update) the prompt for your current shell
uvx wj-prompt

# Preview the change without writing anything
uvx wj-prompt --dry-run

# Target a specific shell or rc file
uvx wj-prompt --shell bash
uvx wj-prompt --rc-file ~/.bashrc

# Remove the prompt again
uvx wj-prompt uninstall

After installing, restart your shell or source the rc file to apply the change to the current session.

What gets installed

zsh (~/.zshrc):

PROMPT='%F{cyan}%m%f:%F{cyan}%~%f %(!.%F{red}#%f.%F{green}$%f) '

bash (~/.bashrc):

PS1='\[\e[36m\]\h\[\e[0m\]:\[\e[36m\]\w\[\e[0m\] \[\e[$((EUID?32:31))m\]\$\[\e[0m\] '

Each is wrapped in a managed block:

# >>> wj-prompt >>>
# Managed by wj-prompt. Re-run `wj-prompt` to update; `wj-prompt uninstall` to remove.
...
# <<< wj-prompt <<<

bash login shells

A bash login shell — for example an SSH session — reads ~/.bash_profile (or ~/.bash_login / ~/.profile) and does not read ~/.bashrc, so a prompt installed only in .bashrc would be missed on login. To cover this, wj-prompt also adds a managed block to the active login file that sources .bashrc, unless it already does:

# >>> wj-prompt >>>
# Managed by wj-prompt. Re-run `wj-prompt` to update; `wj-prompt uninstall` to remove.
[ -f ~/.bashrc ] && . ~/.bashrc
# <<< wj-prompt <<<

uninstall removes both blocks. (Passing an explicit --rc-file skips this login handling and only touches the file you name.)

Installation

# Run directly without installing
uvx wj-prompt

# Or install the tool
uv tool install wj-prompt
pip install wj-prompt

Development

# Set up development environment
make dev

# Run linting and type checks
make check

# Format code
make format

# Build wheel
make build

License

Released into the public domain under the Unlicense.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

wj_prompt-1.0.0-py3-none-any.whl (19.9 kB view details)

Uploaded Python 3

File details

Details for the file wj_prompt-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: wj_prompt-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 19.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for wj_prompt-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 216921b46d25f26436cf2143775676bf97d66472b2f6a660bdf75fd2ac2a370a
MD5 d51980567a9bbd9938af1008f6ebbebc
BLAKE2b-256 3e210d05a94664fd8506c262a49d8b71d66383902b3772cdb062e04c15368471

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page