# Oh My Posh — Cross-Platform Shell Prompt Theme Engine > A prompt theme engine for any shell that renders rich, informative prompts with Git status, language versions, cloud context, and custom segments using a single JSON or YAML config. ## Install Save as a script file and run: # Oh My Posh — Cross-Platform Shell Prompt Theme Engine ## Quick Use ```bash # Install (macOS/Linux) brew install jandedobbeleer/oh-my-posh/oh-my-posh # or on Windows winget install JanDeDobbeleer.OhMyPosh # Activate in your shell profile: eval "$(oh-my-posh init bash --config ~/.poshthemes/jandedobbeleer.omp.json)" ``` ## Introduction Oh My Posh is a custom prompt engine that works across Bash, Zsh, Fish, PowerShell, cmd, and Nushell on any operating system. It replaces your default prompt with a configurable, segment-based display that surfaces contextual information like Git branch status, active language versions, and cloud provider context. ## What Oh My Posh Does - Renders prompt segments showing Git status, language runtimes, and execution time - Works identically across Bash, Zsh, Fish, PowerShell, cmd, and Nushell - Loads themes from JSON, YAML, or TOML configuration files - Supports Nerd Font icons, Unicode glyphs, and plain-text fallbacks - Provides a built-in theme gallery with 100+ community themes ## Architecture Overview Oh My Posh is a single Go binary that your shell calls before rendering each prompt. The shell's init script hooks into the prompt lifecycle and invokes the binary with the current environment. The engine evaluates each configured segment, checks activation conditions, formats the output with ANSI escape codes, and returns the rendered string to the shell. ## Self-Hosting & Configuration - Install via Homebrew, winget, Scoop, or download the binary directly - Initialize for your shell by adding the eval/init line to your profile file - Point to a theme file or use the built-in default theme - Install a Nerd Font (e.g., FiraCode Nerd Font) for icon rendering - Customize segments by editing the JSON/YAML config or use oh-my-posh config export ## Key Features - Shell-agnostic: one config file works across all supported shells - Transient prompt mode collapses previous prompts to save terminal space - Tooltips show contextual segments only when relevant commands are typed - Secondary prompt customization for multiline input - Built-in upgrade command keeps the binary current without package manager steps ## Comparison with Similar Tools - **Starship** — Rust-based prompt with TOML config; faster cold start, fewer built-in segments - **Powerlevel10k** — Zsh-only prompt with instant prompt feature; deeper Zsh integration - **Pure** — minimalist Zsh prompt focused on async Git status; no segments or theming - **Tide** — Fish-only prompt inspired by Powerlevel10k; Fish-native configuration - **Liquidprompt** — Bash/Zsh adaptive prompt; text-based, no icon support ## FAQ **Q: Does Oh My Posh slow down my prompt?** A: The binary is compiled Go and typically renders in under 50ms. Segments that query external tools (kubectl, az) may add latency; disable segments you do not use. **Q: Do I need a Nerd Font?** A: Nerd Fonts are recommended for icon glyphs, but you can use a minimal theme with Unicode or ASCII-only output. **Q: Can I use Oh My Posh alongside Oh My Zsh?** A: Yes. Oh My Posh replaces only the prompt theme. Oh My Zsh plugins for completions and aliases continue to work. **Q: How do I preview themes without applying them?** A: Run oh-my-posh config export --format json to see the current config, or browse the theme gallery on the documentation site. ## Sources - https://github.com/JanDeDobbeleer/oh-my-posh - https://ohmyposh.dev --- Source: https://tokrepo.com/en/workflows/asset-1988a01e Author: Script Depot