Cette page est affichée en anglais. Une traduction française est en cours.
ScriptsJul 16, 2026·3 min de lecture

oh-my-posh — Cross-Platform Prompt Theme Engine

Customizable prompt theme engine for any shell on any OS, with 100+ built-in themes, Git status, and language segment support.

Prêt pour agents

Installation agent prête

Cet actif peut être installé après choix du runtime, vérification du plan et exécution de la commande adaptée.

Native · 96/100Policy : autoriser
Surface agent
Tout agent MCP/CLI
Type
Prompt
Installation
Single
Confiance
Confiance : Established
Point d'entrée
oh-my-posh Overview
Commande d'installation directe
npx -y tokrepo@latest install 91da5dfd-8135-11f1-9bc6-00163e2b0d79 --target codex

À exécuter après confirmation du plan en dry-run.

Introduction

oh-my-posh is a cross-platform prompt theme engine that works with Bash, Zsh, Fish, PowerShell, cmd, and Nushell on Linux, macOS, and Windows. It renders rich prompt segments showing Git status, language versions, cloud contexts, and execution time using a single JSON or YAML configuration file.

What oh-my-posh Does

  • Renders customizable prompt segments for Git status, language versions, and cloud contexts
  • Ships with 100+ community themes that work across all supported shells
  • Supports Nerd Font icons, Unicode glyphs, and emoji in prompt segments
  • Shows execution time, exit codes, battery level, and system information
  • Configures via a single JSON, YAML, or TOML file shared across shells

Architecture Overview

oh-my-posh is a compiled Go binary that shells invoke as an external command during prompt rendering. The binary reads a theme configuration file, evaluates each segment (Git, Node, Python, AWS, etc.) by inspecting the current environment, and emits ANSI-escaped strings that the shell displays. Because it runs as an external process, it works identically across all supported shells without shell-specific plugins.

Setup & Configuration

  • Install via Homebrew, Winget, Scoop, or download the binary directly
  • Initialize in your shell profile with eval "$(oh-my-posh init <shell>)"
  • Point --config to a local file or remote URL for your theme
  • Customize segments by editing the JSON/YAML theme file
  • Install a Nerd Font for icon rendering: oh-my-posh font install

Key Features

  • Works on every major shell and operating system with one binary
  • 100+ built-in themes with instant preview via the documentation site
  • Segments for 50+ tools: Git, Docker, Kubernetes, AWS, Python, Node, Rust, and more
  • Transient prompt support to clean up previous prompts after execution
  • Tooltip segments that appear contextually based on the current command

Comparison with Similar Tools

  • Starship — Rust-based, minimal by default; oh-my-posh offers richer theming and more segments
  • Powerlevel10k — Zsh-only with instant prompt; oh-my-posh is cross-shell and cross-platform
  • Pure — Zsh-only minimalist prompt; oh-my-posh provides full customization
  • Agnoster — single theme, oh-my-posh ships 100+ themes and custom segment support

FAQ

Q: Does oh-my-posh slow down my shell? A: Prompt rendering typically takes 20-50ms. Disable heavy segments like Git in large repos if latency is noticeable.

Q: Can I use oh-my-posh with Windows Terminal? A: Yes. It works with Windows Terminal, ConEmu, Alacritty, and any terminal that supports ANSI escape codes.

Q: Do I need a Nerd Font? A: Nerd Fonts are recommended for icon rendering. Without one, you can use Unicode-only themes or plain text segments.

Q: Can I share one config across Bash, Zsh, and PowerShell? A: Yes. The same JSON/YAML theme file works across all shells since oh-my-posh is shell-agnostic.

Sources

Fil de discussion

Connectez-vous pour rejoindre la discussion.
Aucun commentaire pour l'instant. Soyez le premier à partager votre avis.

Actifs similaires