ScriptsJul 8, 2026·3 min read

Oh My Posh — Cross-Platform Prompt Theme Engine

Oh My Posh is a customizable cross-platform prompt theme engine written in Go that works with any shell including PowerShell, Bash, Zsh, Fish, and Nushell.

Agent ready

Review-first install path

This asset needs a review step. The copied prompt tells the agent to dry-run, show the writes, then proceed only after confirmation.

Needs Confirmation · 62/100Policy: confirm
Agent surface
Any MCP/CLI agent
Kind
Prompt
Install
Single
Trust
Trust: Established
Entrypoint
Overview
Review-first command
npx -y tokrepo@latest install 260f0073-7a85-11f1-9bc6-00163e2b0d79 --target codex

Dry-run first, confirm the writes, then run this command.

Introduction

Oh My Posh is a prompt theme engine that renders informative, visually consistent shell prompts across every major platform and shell. Built as a single Go binary with no runtime dependencies, it brings a unified prompt experience whether you use PowerShell on Windows or Zsh on macOS.

What Oh My Posh Does

  • Renders customizable shell prompts using segment-based configuration files
  • Ships with 100+ built-in themes in JSON, YAML, or TOML format
  • Displays git status, language versions, cloud context, and system metrics
  • Supports PowerShell, Bash, Zsh, Fish, Cmd, and Nushell
  • Provides Nerd Font icon rendering for visual indicators in terminal prompts

Architecture Overview

Oh My Posh runs as a compiled Go binary invoked by the shell's prompt hook on each command. It reads a theme configuration file, evaluates segment conditions, gathers environment data such as git state and language versions, then outputs an ANSI-escaped string. Segments render in configurable blocks (left, right, newline) with customizable separators and color schemes.

Self-Hosting & Configuration

  • Install via Homebrew, winget, Scoop, or direct binary download
  • Theme files use JSON, YAML, or TOML with a well-documented schema
  • Each segment is independently toggled, styled, and conditionally displayed
  • Custom themes can be built from scratch or derived from built-in presets
  • Shell integration requires adding a single init line to your profile file

Key Features

  • Cross-platform: identical prompt rendering on Windows, macOS, and Linux
  • Shell-agnostic: one configuration works across all supported shells
  • Transient prompt: displays a simplified prompt for previous command lines
  • Tooltips: context-sensitive right-aligned prompts triggered by specific commands
  • Palette support: define reusable color variables across your theme

Comparison with Similar Tools

  • Starship — Rust-based, cross-platform; Oh My Posh offers deeper theming control and PowerShell-native origins
  • Powerlevel10k — Zsh-only with instant prompt; Oh My Posh covers all shells with one config
  • Tide — Fish-only theme framework; Oh My Posh is shell-agnostic
  • Pure — Minimal Zsh prompt; Oh My Posh provides richer segment types and conditional logic

FAQ

Q: Does Oh My Posh slow down my prompt? A: It is compiled Go optimized for low latency. Most prompts render in under 50 ms even with multiple segments enabled.

Q: Do I need Nerd Fonts? A: Nerd Fonts are recommended for icon glyphs but not required. Themes can fall back to plain-text indicators.

Q: Can I use it inside VS Code or other IDE terminals? A: Yes. Set your IDE terminal font to a Nerd Font and add the init line to your shell profile.

Q: How do I preview or switch themes? A: Run oh-my-posh font install for fonts and oh-my-posh init <shell> --config <theme> to switch. A built-in theme browser is available on the docs site.

Sources

Discussion

Sign in to join the discussion.
No comments yet. Be the first to share your thoughts.

Related Assets