prmt ๐
Ultra-fast, customizable shell prompt that won't slow you down

Rendered with
"{path:#89dceb}{rust:#f38ba8:f: ๐ฆ}{git:#f9e2af:f: }\n{ok:#a6e3a1}{fail:#f38ba8} "
Features
- โก Blazing Fast: Sub-millisecond rendering for typical prompts (~2ms end-to-end)
- ๐จ Highly Customizable: Full control over colors, formats, and what information to show
- ๐ Context Aware: Automatically detects git repos, project files, shows only what's relevant
- ๐ฆ Zero Dependencies: Single binary, no runtime dependencies required
- ๐ฆ Memory Efficient: Zero-copy parsing with SIMD optimizations
- โจ Smart Rendering: Only shows information when relevant to your current directory
Why prmt?
Faster than alternatives โ Typical prompts render in ~2ms. Starship averages 10-50ms, oh-my-posh 20-100ms.
Zero configuration needed โ Works out of the box with sensible defaults. Customize only what you want.
Predictable performance โ No async operations, no network calls, no surprises. Your prompt is always instant.
Single binary โ Just install and go. No configuration files required unless you want them.
Context-aware โ Automatically detects git repositories, Rust/Node/Python projects, and shows only relevant info.
Quick Start
1. Install
2. Add to your shell (pick one)
Bash โ Add to ~/.bashrc:
# Simple with named colors
PS1='$(prmt --code $? "{path:cyan} {git:purple} {ok:green}{fail:red} ")'
# Explicit shell wrapping (recommended for prompt usage)
PS1='$(prmt --shell bash --code $? "{path:cyan} {git:purple} {ok:green}{fail:red} ")'
# Or with hex colors for precise theming
PS1='$(prmt --code $? "{path:#89dceb} {git:#f9e2af} {ok:#a6e3a1}{fail:#f38ba8} ")'
Zsh โ Add to ~/.zshrc (auto-detected by default; --shell zsh forces wrapping):
# Simple with named colors
PROMPT='$(prmt --shell zsh --code $? "{path:cyan} {git:purple} {ok:green}{fail:red} ")'
# Or with hex colors for precise theming
PROMPT='$(prmt --shell zsh --code $? "{path:#89dceb} {git:#f9e2af} {ok:#a6e3a1}{fail:#f38ba8} ")'
Fish โ Add to ~/.config/fish/config.fish:
function fish_prompt
prmt --code $status '{path:cyan} {git:purple} {ok:green}{fail:red} '
end
3. Reload your shell
Done! ๐
Bash with PROMPT_COMMAND
PROMPT_COMMAND=_prmt_prompt
If you already use PROMPT_COMMAND, append _prmt_prompt instead of overwriting it.
Bash transient prompt (no ble.sh)
PS1='$(prmt --shell bash --code $? "{path:cyan} {git:purple} {ok:green}{fail:red} ")'
PS0='\[$(_prmt_deleteprompt)\]$(_prmt_indicator ${LAST_EXIT_CODE}) $(_prmt_lastcommand)\n\[${PS1:0:$((EXPS0=1,0))}\]'
PROMPT_COMMAND='LAST_EXIT_CODE=$?; [ "$EXPS0" = 0 ] && _prmt_deleteprompt && echo -e "$(_prmt_indicator ${LAST_EXIT_CODE})" || EXPS0=0'
This replaces the full prompt with a compact one after the command runs. It relies on tput and Bash 4.4+.
Zsh with precmd
precmd_functions+=(_prmt_precmd)
PowerShell
# Add to $PROFILE
function prompt {
prmt --code $LASTEXITCODE '{path:cyan:s} {git:purple:s:on :} {ok:green}{fail:red} '
}
Environment Variable
All shells support using PRMT_FORMAT environment variable:
# Bash/Zsh
PS1='$(prmt --code $?)\$ '
# Fish
# PowerShell
Popular Prompts
Minimal
# Output: projects โฏ
Developer
# Output: ~/projects/prmt on main ๐ฆ1.90 โฌข20.5 โฏ
Identity (via env module)
# Output: zenpie@workbox projects on main โฏ
Compact with time
# Output: 02:30PM projects main โฏ
Full featured with newline
# Output: ~/ml-project on develop ๐3.11 14:30
# โฏ
Status-focused
# Output (success): projects on main โ
# Output (failure): projects on main โ
With exit codes
# Output (success): ~/projects main โฏ
# Output (failure): ~/projects main 127
Installation
# Install from crates.io
# Build from source (Rust 2024 edition required)
# Or install directly from source
# Verify installation
Usage Examples
# Simple format with defaults
# Output: ~/projects 1.89.0 master
# Format with types and styles
# Simplified formats with omitted parts
# Add your own icons with prefix
# Or add spacing with suffix for better readability
# Using short format aliases
# No style with type
# With exit code indicators (requires --code flag)
# Output (success): ~/projects โฏ (green)
# Output (failure): ~/projects โฏ (red)
# Fast mode (no version detection)
# Output: ~/projects (only shows active modules, no versions)
# Custom symbols for ok/fail using type as symbol
# Output (success): ~/projects โ
# Output (failure): ~/projects โ
# Show exit code on failure
# Output (success): ~/projects โฏ
# Output (failure with code 127): ~/projects 127
# Time formats
Format Specification
Format Syntax
{module} - Default everything
{module:style} - Custom style
{module:style:type} - Custom style and type
{module:style:type:prefix} - Add prefix to value
{module:style:type:prefix:postfix} - Add prefix and postfix
# Omitting parts (empty means default)
{module::::suffix} - Default style/type, suffix only
{module:::prefix:} - Default style/type, prefix only
{module:::prefix:suffix} - Default style/type, both prefix/suffix
{module::type} - No style, specific type
{module::type::suffix} - No style, specific type, suffix only
Available Modules
| Module | Detection | Description |
|---|---|---|
path |
Always active | Current directory with ~ for home |
ok |
Exit code = 0 | Shows when last command succeeded (default: โฏ) |
fail |
Exit code โ 0 | Shows when last command failed (default: โฏ) |
git |
.git directory |
Branch name with status indicators |
node |
package.json |
Node.js version |
python |
requirements.txt, pyproject.toml, etc |
Python version |
rust |
Cargo.toml |
Rust version |
deno |
deno.json, deno.jsonc |
Deno version |
bun |
bun.lock, bun.lockb |
Bun version |
go |
go.mod |
Go version |
elixir |
mix.exs |
Elixir version |
env |
Requested variable is set/non-empty | Value of a specific environment variable (format = name) |
time |
Always active | Current time in various formats |
json |
--stdin flag |
Extract values from JSON piped via stdin (format = dot-path) |
Type Values
Version modules (rust, node, python, etc.):
fullorf- Full version (1.89.0)shortors- Major.minor (1.89)majororm- Major only (1)
Path module:
relativeorr- Path with ~ for home directory (default)absolute,a, orf- Full absolute path without ~ substitutioninitialsori- Parent segments shortened to their first character; last segment kept full (hidden dirs keep the leading.)unvoweloru- Interior vowels stripped from each segment; first character kept; segments โค 3 chars unchangedshortors- Last directory only
Git module:
fullorf- Branch with status (default)shortors- Branch name only- Add
+owned(or+o) to show only repos owned by the current user (e.g.,{git::full+owned})
Ok/Fail modules:
full- Default symbol (โฏ)code- Shows the actual exit code number- Any other string - Uses that string as the symbol (e.g.,
{ok::โ}shows โ)
Time module:
24h- 24-hour format HH:MM (default)24hsor24HS- 24-hour format with seconds HH:MM:SS12hor12H- 12-hour format hh:MMAM/PM12hsor12HS- 12-hour format with seconds hh:MM:SSAM/PM
Env module:
- The
typefield is required and must be the environment variable name (e.g.,{env::USER}or{env:blue:PATH}). - The module emits the variable value only when it exists and is non-empty; otherwise it returns nothing so the placeholder is effectively inactive.
- Example for identity:
{env::USER}@{env::HOSTNAME}
Json module (requires --stdin):
- Reads JSON from stdin and extracts values using dot-path notation.
- The
typefield is the dot-path to the value (e.g.,{json::.model.id}or{json::name}). - Supports nested objects (
{json::.a.b.c}), array indexing ({json::.items.0}), and the leading dot is optional. - Strings are returned as-is, numbers and booleans are stringified, null and missing paths produce no output.
- When
--stdinis not passed, json placeholders are silently inactive.
Claude Code status line -- pipe JSON context to prmt to display model and context window usage.
Add to your Claude Code settings.json:
Type Validation
The format parser validates types at parse time to catch errors early:
# Valid types for each module
# Invalid types produce clear errors
# Error: Invalid type 'major' for module 'path'. Valid types: relative, r, absolute, a, f, initials, i, unvowel, u, short, s
# Error: Invalid type 'major' for module 'git'. Valid types: full, short
Default Module Styles
| Module | Default Color | Can Override |
|---|---|---|
path |
cyan | Yes |
ok |
green | Yes |
fail |
red | Yes |
git |
purple | Yes |
node |
green | Yes |
rust |
red | Yes |
python |
yellow | Yes |
go |
cyan | Yes |
deno |
- | Yes |
bun |
- | Yes |
time |
- | Yes |
Styles
Colors: black, red, green, yellow, blue, purple, cyan, white, #hexcode
Modifiers: bold, dim, italic, underline, reverse, strikethrough
Combine with dots: cyan.bold, red.dim.italic
Background colors: use fg+bg or +bg (background only), then modifiers.
Examples: #ffffff+#333333, +blue, cyan+#222.dim
Escaping
\{โ{(literal brace)\}โ}(literal brace)\nโ newline\tโ tab\:โ:(literal colon in fields)\\โ\(literal backslash)
Performance
Actual Response Times
| Scenario | Time | Notes |
|---|---|---|
| Path only | ~0.01ms | Minimal prompt |
| Path + Git | ~1-2ms | Branch and status |
| With Rust version | ~25-30ms | Includes rustc --version |
With --no-version |
<5ms | Skips all version detection |
Benchmark Snapshot
| Scenario | Time (ยตs) | Notes |
|---|---|---|
| Minimal render | 0.69 | {path} only |
| Typical prompt | 1.71 | {path} {git} {ok}{fail} |
| Full prompt with versions | 4.90 | {path} {git} {rust} {node} |
| End-to-end (typical) | 2.53 | prmt binary execution |
Measurements captured on an Intel Core i9-13900K host with project files on a SATA SSD (Rust 1.90.0 release build). Each value is the median of 100
cargo benchruns.
Prompt Timeout
Prompt timeout is disabled by default. If you enable it, modules that do not finish before the timeout show ... instead of blocking the prompt. This is a latency tradeoff for slow filesystems like network drives, WSL2 /mnt/c/, or NFS mounts.
Benchmark mode ignores this setting so --bench measures the actual module work instead of the timeout fallback.
# Adjust timeout (milliseconds)
# Or set via environment variable
Why is it fast?
- Zero-copy parsing with SIMD optimizations
- Efficient memory allocation strategies
- Context-aware detection (only checks what's needed)
- No async operations or network calls
- Written in Rust for maximum performance
Command-Line Options
prmt [OPTIONS] [FORMAT]
OPTIONS:
-n, --no-version Skip version detection for speed
-t, --timeout <MS> Prompt timeout in ms (default 0, disabled)
-d, --debug Show debug information and timing
-b, --bench Run benchmark (100 iterations, ignores prompt timeout)
--stdin Read JSON from stdin (enables json module)
--code <CODE> Exit code of the last command (for ok/fail modules)
--no-color Disable colored output
--shell <SHELL> Wrap ANSI escapes for the specified shell (bash, zsh, none)
-h, --help Print help
-V, --version Print version
ARGS:
<FORMAT> Format string (default from PRMT_FORMAT env var)
ENVIRONMENT:
PRMT_FORMAT Default format string
PRMT_TIMEOUT Prompt timeout in ms (overridden by --timeout)
Building from Source
# Requirements: Rust 2024 edition
# Run tests
# Benchmark
License
License The MIT License Copyright (c) 2025 Ivan Zakharchanka