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} "
- β‘ 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
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.
1. Install
cargo install prmt2. 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} ")'
# Or with hex colors for precise theming
PS1='$(prmt --code $? "{path:#89dceb} {git:#f9e2af} {ok:#a6e3a1}{fail:#f38ba8} ")'Zsh β Add to ~/.zshrc:
setopt PROMPT_SUBST
# Simple with named colors
PROMPT='$(prmt --code $? "{path:cyan} {git:purple} {ok:green}{fail:red} ")'
# Or with hex colors for precise theming
PROMPT='$(prmt --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} '
end3. Reload your shell
exec $SHELL # or open a new terminalDone! π
Advanced setup (PROMPT_COMMAND, precmd, environment variables)
function _prmt_prompt() {
local last=$?
PS1="$(prmt --code $last '{path:cyan} {git:purple} {ok:green}{fail:red}')"
}
PROMPT_COMMAND=_prmt_promptIf you already use PROMPT_COMMAND, append _prmt_prompt instead of overwriting it.
function _prmt_precmd() {
local code=$?
PROMPT="$(prmt --code $code '{path:cyan} {git:purple} {ok:green}{fail:red}')"
}
typeset -ga precmd_functions
precmd_functions+=(_prmt_precmd)# Add to $PROFILE
function prompt {
prmt --code $LASTEXITCODE '{path:cyan:s} {git:purple:s:on :} {ok:green}{fail:red} '
}All shells support using PRMT_FORMAT environment variable:
# Bash/Zsh
export PRMT_FORMAT="{path:cyan:r} {rust:red:m:v π¦} {git:purple}"
PS1='$(prmt --code $?)\$ '
# Fish
set -x PRMT_FORMAT "{path:cyan:r} {python:yellow:m: π} {git:purple}"
# PowerShell
$env:PRMT_FORMAT = "{path:cyan:r} {git:purple}"Minimal
prmt '{path:cyan:s} {ok:green}{fail:red} '
# Output: projects β―Developer
prmt '{path:cyan} {git:purple} {rust:red:s: π¦} {node:green:s: β¬’} {ok:green}{fail:red} '
# Output: ~/projects/prmt on main π¦1.90 β¬’20.5 β―Compact with time
prmt '{time:dim:12h} {path:cyan:s} {git:purple:s} {ok:green}{fail:red} '
# Output: 02:30PM projects main β―Full featured with newline
prmt '{path:cyan} {git:purple} {python:yellow:m: π} {time:dim}\n{ok:green}{fail:red} '
# Output: ~/ml-project on develop π3.11 14:30
# β―Status-focused
prmt '{path:cyan:s} {git:purple:s:on :} {ok:green:β}{fail:red:β} '
# Output (success): projects on main β
# Output (failure): projects on main βWith exit codes
prmt '{path:cyan} {git:purple} {ok:green:β―}{fail:red::code} '
# Output (success): ~/projects main β―
# Output (failure): ~/projects main 127# Install from crates.io
cargo install prmt
# Build from source (Rust 2024 edition required)
cargo build --release
cp target/release/prmt ~/.local/bin/
# Or install directly from source
cargo install --path .
# Verify installation
prmt --version# Simple format with defaults
prmt '{path} {rust} {git}'
# Output: ~/projects 1.89.0 master
# Format with types and styles
prmt '{path::a}' # /home/user/projects (absolute path)
prmt '{path::r}' # ~/projects (relative with ~)
prmt '{path::s}' # projects (short - last dir only)
prmt '{rust:red:s}' # 1.89 in red (short version)
prmt '{rust:red:m:v:}' # v1 in red (major version with prefix)
prmt '{path:cyan:s:[:]}' # [projects] in cyan
prmt '{git:purple::on :}' # on master in purple
# Simplified formats with omitted parts
prmt '{rust::::!}' # 1.89.0! (default style/type, suffix only)
prmt '{rust:::v:}' # v1.89.0 (default style/type, prefix only)
prmt '{path::::]}' # ~/projects] (suffix only)
prmt '{git:::on :}' # on master (prefix only)
# Add your own icons with prefix
prmt '{rust::: π¦}' # π¦1.89.0 (default color)
prmt '{node:green:: β¬’}' # β¬’20.5.0 in green
prmt '{python:yellow:: π}' # π3.11.0 in yellow
# Or add spacing with suffix for better readability
prmt '{rust::: π¦ }' # π¦ 1.89.0 (space after icon)
prmt '{node:green:: β¬’ }' # β¬’ 20.5.0 (space after icon)
# Using short format aliases
prmt '{path:cyan:s} {rust:red:m:v:}' # projects v1 (both in color)
prmt '{git::s:on :}' # on master (short format with prefix)
# No style with type
prmt '{path::s}' # projects (no color, short)
prmt '{path::a}' # /home/user/projects (no color, absolute)
prmt '{rust::m:v}' # v1 (no color, major with prefix)
# With exit code indicators (requires --code flag)
prmt --code $? '{path:cyan} {ok:green}{fail:red}'
# Output (success): ~/projects β― (green)
# Output (failure): ~/projects β― (red)
# Fast mode (no version detection)
prmt --no-version '{path:cyan} {rust:red} {node:green}'
# Output: ~/projects (only shows active modules, no versions)
# Custom symbols for ok/fail using type as symbol
prmt --code $? '{path} {ok::β} {fail::β}'
# Output (success): ~/projects β
# Output (failure): ~/projects β
# Show exit code on failure
prmt --code $? '{path} {ok::β―} {fail::code}'
# Output (success): ~/projects β―
# Output (failure with code 127): ~/projects 127
# Time formats
prmt '{time}' # 14:30 (default 24h)
prmt '{time::24hs}' # 14:30:45
prmt '{time::12h}' # 02:30PM
prmt '{time::12hs}' # 02:30:45PM
prmt '{path:cyan} {time:dim:12h}' # ~/projects 02:30PM (with styling){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
| 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.lockb |
Bun version |
go |
go.mod |
Go version |
time |
Always active | Current time in various formats |
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 ~ substitutionshortors- Last directory only
Git module:
fullorf- Branch with status (default)shortors- Branch name only
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
The format parser validates types at parse time to catch errors early:
# Valid types for each module
prmt '{path::short}' # β Valid
prmt '{rust::major}' # β Valid
prmt '{ok::β}' # β Valid (custom symbol)
prmt '{fail::code}' # β Valid (shows exit code)
# Invalid types produce clear errors
prmt '{path::major}'
# Error: Invalid type 'major' for module 'path'. Valid types: relative, r, absolute, a, short, s
prmt '{git::major}'
# Error: Invalid type 'major' for module 'git'. Valid types: full, short| 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 |
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
\{β{(literal brace)\}β}(literal brace)\nβ newline\tβ tab\:β:(literal colon in fields)\\β\(literal backslash)
| 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 |
| 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.
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
prmt [OPTIONS] [FORMAT]
OPTIONS:
-n, --no-version Skip version detection for speed
-d, --debug Show debug information and timing
-b, --bench Run benchmark (100 iterations)
--code <CODE> Exit code of the last command (for ok/fail modules)
--no-color Disable colored output
-h, --help Print help
-V, --version Print version
ARGS:
<FORMAT> Format string (default from PRMT_FORMAT env var)
# Requirements: Rust 2024 edition
git clone https://github.com/3axap4eHko/prmt.git
cd prmt
cargo build --release
# Run tests
cargo test
# Benchmark
./target/release/prmt --bench '{path} {rust} {git}'License The MIT License Copyright (c) 2025 Ivan Zakharchanka