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.0b2-py3-none-any.whl (19.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: wj_prompt-1.0.0b2-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.0b2-py3-none-any.whl
Algorithm Hash digest
SHA256 5982d7af50c0762e6ec7f6f060945b0f4572eed5a88b449057c36de523a859dc
MD5 87ce9397e27c06b79292b4ba84e72e8c
BLAKE2b-256 91f064d37bb99b4643cb067e849b8d167fc96ce104519dd9b5a5ba7d311eaa92

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