Skip to content

blackflame007/mehshell

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

30 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

mehshell ๐Ÿš

โšก A blazingly fast, parallelized prompt engine for zsh written in Go.

Prompt Example

Prompt styles

โœจ Features

  • ๐Ÿš€ Single Go binary, ~6ms per prompt.
  • ๐Ÿ”€ All segments run as parallel goroutines.
  • ๐Ÿ”ฅ Git dirty check with 150ms timeout. It never blocks, even in huge repos.
  • ๐Ÿง  Zero-fork git branch detection. It reads .git/HEAD directly.
  • ๐Ÿ–ฅ๏ธ OS icon auto-detection for Arch, Ubuntu, Fedora, Debian, NixOS, and macOS.
  • ๐Ÿ“ฆ Runtime version detection for Node.js, Python, Go, Rust, Ruby, and Java when marker files are present.
  • โ˜๏ธ Cloud context support for Kubernetes, AWS, Azure, and GCP profiles.
  • ๐Ÿ—๏ธ Terraform workspace and Docker context detection.
  • ๐Ÿ Environment detection for Conda and virtualenv.
  • ๐Ÿ”‹ Battery level with charge state icons.
  • โฑ๏ธ Command duration (3s+), time, and exit code coloring.
  • โœ๏ธ Vi mode indicator (swaps prompt char on keymap change).
  • ๐Ÿช„ Transient prompt (collapses previous prompt on Enter).
  • โšก Instant prompt (caches last prompt for zero-latency shell startup).
  • โžก๏ธ Right-aligned segments on the first line.
  • ๐ŸŽจ Nerd Font icons.
  • ๐Ÿ”„ Live config reloading. Save the file, next prompt picks it up โ€” no shell restart required.
  • โš™๏ธ Configurable via ~/.config/mehshell/config.

๐Ÿ“ฅ Install

Homebrew (macOS & Linux)

brew tap blackflame007/tap
brew install mehshell

AUR (Arch Linux)

paru -S mehshell-bin

Binary releases

Download a prebuilt binary from GitHub Releases:

# Linux (x86_64)
curl -sL https://github.com/blackflame007/mehshell/releases/latest/download/mehshell_linux_amd64.tar.gz | tar xz && mv mehshell ~/.local/bin/

# Linux (ARM64)
curl -sL https://github.com/blackflame007/mehshell/releases/latest/download/mehshell_linux_arm64.tar.gz | tar xz && mv mehshell ~/.local/bin/

# macOS (Apple Silicon)
curl -sL https://github.com/blackflame007/mehshell/releases/latest/download/mehshell_darwin_arm64.tar.gz | tar xz && mv mehshell ~/.local/bin/

# macOS (Intel)
curl -sL https://github.com/blackflame007/mehshell/releases/latest/download/mehshell_darwin_amd64.tar.gz | tar xz && mv mehshell ~/.local/bin/

From source

go install github.com/blackflame007/mehshell@latest

๐Ÿ”Œ Zsh Integration

Add this to your .zshrc:

eval "$(mehshell init zsh)"

๐Ÿ› ๏ธ Configuration

Generate a default config file:

mehshell config init

This creates ~/.config/mehshell/config (or $XDG_CONFIG_HOME/mehshell/config). See config.example for the full default config.

Features

Option Default Description
transient_prompt true Collapse previous prompts to โฏ on Enter. Set false to preserve full prompts with timestamps in scrollback.
instant_prompt true Show cached prompt immediately on shell startup.
vi_mode true Swap prompt character on vi keymap change (โฏ/โฎ).
icons true Show Nerd Font icons. Set false for text labels (go, py, rs, etc.).
style lean Prompt style: lean (colored text, no backgrounds), classic (powerline with dark grey background), or rainbow (powerline with per-segment colored backgrounds).

Left Segments

Option Default Description
os true OS icon (Arch, Ubuntu, Fedora, Debian, NixOS, macOS).
dir true Current working directory.
git true Git branch and dirty state (โœ“, +, !, ?).
node true Node.js version when package.json is present.
python true Python version when marker files are found.
go true Go version from go.mod.
rust true Rust version when Cargo.toml is present.
ruby true Ruby version when marker files are found.
java true Java version when pom.xml or build.gradle is present.

Right Segments

Option Default Description
conda true Conda environment name (skips base).
venv true Python virtualenv name.
k8s true Kubernetes context when manifest files are in cwd.
terraform true Terraform version when .tf files are present.
docker true Docker context when Dockerfile/compose is present.
aws true AWS profile from $AWS_PROFILE.
azure true Azure resource group from $AZURE_DEFAULTS_GROUP.
gcloud true GCP project from $CLOUDSDK_CORE_PROJECT.
battery true Battery level with charge state icon.
duration true Command duration (shown when โ‰ฅ 3s).
time true Current time.

Set any option to false to disable it. Config changes are picked up live โ€” save the file and your next prompt reflects the update. No shell restart needed.

To see where your config lives:

mehshell config path

๐Ÿ“Š Benchmarks

Metric p10k mehshell
Shell startup 870ms+ 64ms
Between commands 6000ms (with vcs_info) 28ms
Prompt generation ~45ms 6ms

๐Ÿ†š Feature Comparison with Powerlevel10k

mehshell is intentionally minimal. p10k is a full-featured theme engine. Pick the right tool for your workflow.

Feature mehshell p10k
Architecture Single Go binary Zsh scripts + gitstatusd daemon
Dependencies Zero (Go stdlib only) gitstatus binary (downloaded)
Prompt generation ~6ms ~45ms
Shell startup impact ~64ms ~870ms+
Configuration ~/.config/mehshell/config ~/.p10k.zsh + config wizard
Async rendering Goroutines (parallel) Zsh workers + gitstatusd
Git branch detection Zero-fork (reads .git/HEAD) gitstatusd (libgit2)
Git dirty check git status with 150ms timeout Async, never blocks
Instant prompt โœ“ (cache-based) โœ“
Transient prompt โœ“ โœ“
Vi mode โœ“ (prompt char swap) โœ“ (full indicator)
Custom segments Add in source Public API (p10k segment)
Total segments 20 67+

Segment Coverage

Segment mehshell p10k
OS icon โœ“ โœ“
Directory โœ“ โœ“ (smart truncation)
Git โœ“ (branch + dirty) โœ“ (branch, ahead/behind, stash, conflicts)
Node.js โœ“ โœ“ (+ nvm, nodenv, package name)
Python โœ“ โœ“ (+ pyenv, poetry)
Go โœ“ โœ“ (+ goenv)
Rust โœ“ โœ“
Ruby โœ“ โœ“ (+ rvm, chruby)
Java โœ“ โœ“ (+ jenv)
Conda โœ“ โœ“
Virtualenv โœ“ โœ“
Kubernetes โœ“ โœ“ (+ show-on-command)
Terraform โœ“ โœ“
Docker โœ“ โœ“
AWS โœ“ โœ“ (+ Elastic Beanstalk)
Azure โœ“ โœ“
GCP โœ“ โœ“
Battery โœ“ โœ“
Duration โœ“ โœ“
Time โœ“ โœ“ (+ date)
CPU / RAM โ€” โœ“
Vi mode โœ“ (prompt char) โœ“ (full indicator)

Note: p10k is in limited maintenance mode โ€” no new features are in development.

๐Ÿ“‹ Requirements

  • Go 1.22+ (build only)
  • Nerd Font
  • zsh

๐Ÿ“„ License

MIT

About

โšก Blazingly fast zsh prompt engine. ๐Ÿš€ p10k alternative written in Go. ๐Ÿš

Topics

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors