DEV Community

Cover image for prmt: instant-feeling shell prompts (sub-millisecond, even over SSH)
Ivan Zakharchanka
Ivan Zakharchanka

Posted on

prmt: instant-feeling shell prompts (sub-millisecond, even over SSH)

TL;DR: Rust-powered shell prompt with sub-millisecond rendering that stays fast over SSH.

GitHub logo 3axap4eHko / prmt

Ultra-fast, customizable shell prompt generator

prmt πŸš€

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

Crates.io License: MIT Rust

Terminal

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…


The problem

Starship: Beautiful but slow (~10-50ms renders). Async I/O adds unpredictable latency over SSH.

oh-my-posh: Feature-rich but heavy. 20MB binary, 20-100ms renders.

Pure Bash/Zsh: Fast but unmaintainable config spaghetti.


Why prmt?

  • Sub-millisecond renders β€” ~10-50 Β΅s for path + git
  • Predictable β€” no async I/O, no surprises over SSH
  • Zero config β€” works out of the box
  • Drop-in replacement β€” migrate from Starship in 5 minutes

Setup

cargo install prmt
Enter fullscreen mode Exit fullscreen mode

Bash / Zsh

# Bash: ~/.bashrc
PS1='$(prmt --code $? "{path:cyan:s} {git:purple:s:on :} {ok:green}{fail:red} ")'

# Zsh: ~/.zshrc (add this line first)
setopt PROMPT_SUBST
PROMPT='$(prmt --code $? "{path:cyan:s} {git:purple:s:on :} {ok:green}{fail:red} ")'
Enter fullscreen mode Exit fullscreen mode

Fish

# ~/.config/fish/config.fish
function fish_prompt
  prmt --code $status '{path:cyan:s} {git:purple:s:on :} {ok:green}{fail:red} '
end
Enter fullscreen mode Exit fullscreen mode

PowerShell is also supported β€” see the README.


Performance breakdown

Prompt Modules Time What's slow?
Minimal {path} ~10 Β΅s Nothing
Typical {path} {git} {ok}{fail} ~1-2 ms Git status check
Full {path} {git} {rust} {node} ~25-30 ms Running rustc --version etc
Fast mode --no-version < 5 ms Skips all version calls

Key insight: The renderer is microseconds. Version detection (running rustc --version, node --version) dominates total time. Use --no-version if you don't need versions.

Reproduce locally

# Internal benchmark
prmt --bench '{path} {git} {ok}{fail}'

# End-to-end with hyperfine
hyperfine --warmup 5 'prmt --no-version "{path} {git} {ok}{fail}"'
Enter fullscreen mode Exit fullscreen mode

Migrating from Starship

Starship prmt
directory {path:r} (relative) or {path:s} (short)
git_branch {git:s} (branch only)
git_status {git} (branch + status)
character {ok}{fail} with --code $?
nodejs {node:s} (short version)
rust {rust:s} (short version)

Plain prompt (path + git + indicator):

prmt --code $? "{path:cyan:s} {git:purple:s:on :} {ok:green}{fail:red} "
Enter fullscreen mode Exit fullscreen mode

With versions (add Node/Rust):

prmt --code $? "{path:cyan:s} {node:green:s: β¬’}{rust:red:s: πŸ¦€}{git:purple} {ok}{fail} "
Enter fullscreen mode Exit fullscreen mode

Output: projects β¬’20.5 πŸ¦€1.90 main ❯


Why it's fast

  • Zero-copy parsing β€” minimal allocations
  • Cached module detection β€” only checks relevant directories
  • No async runtime β€” no Tokio overhead, predictable latency

See the README for benchmarks and implementation details.


Format cheatsheet

Syntax: {module:style:type:prefix:postfix}

Modules: path, git, rust, node, python, go, time, ok, fail

Styles: red, cyan, #89dceb (hex), bold, dim, italic

Path types: r (relative), a (absolute), s (short β€” last dir only)

Git types: f (branch+status), s (branch only)

Version types: m (major), s (short), f (full)

Examples:

{path:cyan:s}              # Short path in cyan
{git:purple::on :}         # "on main" in purple
{rust:red:s: πŸ¦€}           # "πŸ¦€1.90" in red
{ok:green:βœ“}{fail:red:βœ—}  # Custom success/fail symbols
Enter fullscreen mode Exit fullscreen mode

Full reference in the README.


Try it

cargo install prmt
Enter fullscreen mode Exit fullscreen mode

Like it? ⭐ the repo and share your config!


Ivan Zakharchanka Β· GitHub @3axap4eHko

Top comments (0)