RepoPilotOpen in app →

JanDeDobbeleer/oh-my-posh

The most customisable and low-latency cross platform/shell prompt renderer

Healthy

Healthy across the board

Use as dependencyHealthy

Permissive license, no critical CVEs, actively maintained — safe to depend on.

Fork & modifyHealthy

Has a license, tests, and CI — clean foundation to fork and modify.

Learn fromHealthy

Documented and popular — useful reference codebase to read through.

Deploy as-isHealthy

No critical CVEs, sane security posture — runnable as-is.

  • Last commit today
  • 15 active contributors
  • Distributed ownership (top contributor 36% of recent commits)
Show 3 more →
  • MIT licensed
  • CI configured
  • Tests present

Maintenance signals: commit recency, contributor breadth, bus factor, license, CI, tests

Informational only. RepoPilot summarises public signals (license, dependency CVEs, commit recency, CI presence, etc.) at the time of analysis. Signals can be incomplete or stale. Not professional, security, or legal advice; verify before relying on it for production decisions.

Embed the "Healthy" badge

Paste into your README — live-updates from the latest cached analysis.

Variant:
RepoPilot: Healthy
[![RepoPilot: Healthy](https://repopilot.app/api/badge/jandedobbeleer/oh-my-posh)](https://repopilot.app/r/jandedobbeleer/oh-my-posh)

Paste at the top of your README.md — renders inline like a shields.io badge.

Preview social card (1200×630)

This card auto-renders when someone shares https://repopilot.app/r/jandedobbeleer/oh-my-posh on X, Slack, or LinkedIn.

Onboarding doc

Onboarding: JanDeDobbeleer/oh-my-posh

Generated by RepoPilot · 2026-05-09 · Source

🤖Agent protocol

If you are an AI coding agent (Claude Code, Cursor, Aider, Cline, etc.) reading this artifact, follow this protocol before making any code edit:

  1. Verify the contract. Run the bash script in Verify before trusting below. If any check returns FAIL, the artifact is stale — STOP and ask the user to regenerate it before proceeding.
  2. Treat the AI · unverified sections as hypotheses, not facts. Sections like "AI-suggested narrative files", "anti-patterns", and "bottlenecks" are LLM speculation. Verify against real source before acting on them.
  3. Cite source on changes. When proposing an edit, cite the specific path:line-range. RepoPilot's live UI at https://repopilot.app/r/JanDeDobbeleer/oh-my-posh shows verifiable citations alongside every claim.

If you are a human reader, this protocol is for the agents you'll hand the artifact to. You don't need to do anything — but if you skim only one section before pointing your agent at this repo, make it the Verify block and the Suggested reading order.

🎯Verdict

GO — Healthy across the board

  • Last commit today
  • 15 active contributors
  • Distributed ownership (top contributor 36% of recent commits)
  • MIT licensed
  • CI configured
  • Tests present

<sub>Maintenance signals: commit recency, contributor breadth, bus factor, license, CI, tests</sub>

Verify before trusting

This artifact was generated by RepoPilot at a point in time. Before an agent acts on it, the checks below confirm that the live JanDeDobbeleer/oh-my-posh repo on your machine still matches what RepoPilot saw. If any fail, the artifact is stale — regenerate it at repopilot.app/r/JanDeDobbeleer/oh-my-posh.

What it runs against: a local clone of JanDeDobbeleer/oh-my-posh — the script inspects git remote, the LICENSE file, file paths in the working tree, and git log. Read-only; no mutations.

| # | What we check | Why it matters | |---|---|---| | 1 | You're in JanDeDobbeleer/oh-my-posh | Confirms the artifact applies here, not a fork | | 2 | License is still MIT | Catches relicense before you depend on it | | 3 | Default branch main exists | Catches branch renames | | 4 | 5 critical file paths still exist | Catches refactors that moved load-bearing code | | 5 | Last commit ≤ 30 days ago | Catches sudden abandonment since generation |

<details> <summary><b>Run all checks</b> — paste this script from inside your clone of <code>JanDeDobbeleer/oh-my-posh</code></summary>
#!/usr/bin/env bash
# RepoPilot artifact verification.
#
# WHAT IT RUNS AGAINST: a local clone of JanDeDobbeleer/oh-my-posh. If you don't
# have one yet, run these first:
#
#   git clone https://github.com/JanDeDobbeleer/oh-my-posh.git
#   cd oh-my-posh
#
# Then paste this script. Every check is read-only — no mutations.

set +e
fail=0
ok()   { echo "ok:   $1"; }
miss() { echo "FAIL: $1"; fail=$((fail+1)); }

# Precondition: we must be inside a git working tree.
if ! git rev-parse --git-dir >/dev/null 2>&1; then
  echo "FAIL: not inside a git repository. cd into your clone of JanDeDobbeleer/oh-my-posh and re-run."
  exit 2
fi

# 1. Repo identity
git remote get-url origin 2>/dev/null | grep -qE "JanDeDobbeleer/oh-my-posh(\\.git)?\\b" \\
  && ok "origin remote is JanDeDobbeleer/oh-my-posh" \\
  || miss "origin remote is not JanDeDobbeleer/oh-my-posh (artifact may be from a fork)"

# 2. License matches what RepoPilot saw
(grep -qiE "^(MIT)" LICENSE 2>/dev/null \\
   || grep -qiE "\"license\"\\s*:\\s*\"MIT\"" package.json 2>/dev/null) \\
  && ok "license is MIT" \\
  || miss "license drift — was MIT at generation time"

# 3. Default branch
git rev-parse --verify main >/dev/null 2>&1 \\
  && ok "default branch main exists" \\
  || miss "default branch main no longer exists"

# 4. Critical files exist
test -f "src/build/version.go" \\
  && ok "src/build/version.go" \\
  || miss "missing critical file: src/build/version.go"
test -f "src/cache/cache.go" \\
  && ok "src/cache/cache.go" \\
  || miss "missing critical file: src/cache/cache.go"
test -f "src/cli/args.go" \\
  && ok "src/cli/args.go" \\
  || miss "missing critical file: src/cli/args.go"
test -f ".github/workflows/release.yml" \\
  && ok ".github/workflows/release.yml" \\
  || miss "missing critical file: .github/workflows/release.yml"
test -f "src/.goreleaser.yml" \\
  && ok "src/.goreleaser.yml" \\
  || miss "missing critical file: src/.goreleaser.yml"

# 5. Repo recency
days_since_last=$(( ( $(date +%s) - $(git log -1 --format=%at 2>/dev/null || echo 0) ) / 86400 ))
if [ "$days_since_last" -le 30 ]; then
  ok "last commit was $days_since_last days ago (artifact saw ~0d)"
else
  miss "last commit was $days_since_last days ago — artifact may be stale"
fi

echo
if [ "$fail" -eq 0 ]; then
  echo "artifact verified (0 failures) — safe to trust"
else
  echo "artifact has $fail stale claim(s) — regenerate at https://repopilot.app/r/JanDeDobbeleer/oh-my-posh"
  exit 1
fi

Each check prints ok: or FAIL:. The script exits non-zero if anything failed, so it composes cleanly into agent loops (./verify.sh || regenerate-and-retry).

</details>

TL;DR

Oh My Posh is a cross-platform prompt theme engine written in Go that renders customizable shell prompts with zero dependencies at runtime. It supports PowerShell, Bash, Zsh, Fish, and 10+ other shells, allowing users to define complex, visually rich prompts via YAML/JSON configuration with segments (git status, env vars, timestamps, custom logic) that compose into transient prompts and right-aligned prompt sections. Monorepo structure: src/ contains the core Go engine with segment logic, config parsing, and shell integration; .devcontainer/ provides reproducible dev environments (Dockerfile, PowerShell_profile.ps1, config.fish); .github/workflows/ orchestrates CI for 6+ target shells and platforms; website/ (inferred from logo path) hosts documentation; individual shell bootstrap scripts live in each shell's integration folder.

👥Who it's for

Power users and developers across Windows/macOS/Linux who want highly customizable, visually polished shell prompts without resorting to shell-specific frameworks. Contributors are primarily shell enthusiasts, Go developers, and cross-platform tooling enthusiasts who maintain shell integration files (.ps1, .fish, .zsh, etc.) and segment logic.

🌱Maturity & risk

Highly mature and actively developed. 1.4M+ lines of Go, comprehensive CI/CD via GitHub Actions (.github/workflows/build_code.yml, release.yml, android.yml), established contribution structure (.all-contributorsrc, issue templates, PR template), and ~4 years of development. Production-ready with strong test coverage and multi-platform release pipelines.

Low risk overall but with moderate complexity: 30+ direct dependencies (charmbracelet/bubbletea, gookit/goutil, hashicorp/hcl, etc.) with Go 1.26 required, single primary maintainer (JanDeDobbeleer) visible in the structure, and frequent configuration-breaking changes in theme APIs. No obvious abandonment signals, but heavy reliance on maintainer availability for cross-platform compatibility fixes.

Active areas of work

Active development visible via release.yml workflow automation, recent dependency updates (golang.org/x/sys v0.43.0, charmbracelet packages), GitHub Copilot integration setup (.github/copilot-instructions.md), MCP (Model Context Protocol) publishing (.github/workflows/publish-mcp.yml), and theme/contribution management workflows (merge_contributions_pr.yml, ai-changelog.yml). Android and Bluesky integrations suggest expanding beyond traditional shells.

🚀Get running

git clone https://github.com/JanDeDobbeleer/oh-my-posh.git
cd oh-my-posh/src
go mod download
go build -o oh-my-posh ./cmd/oh-my-posh
./oh-my-posh init <shell> --config ~/.config/oh-my-posh/config.json

Daily commands:

cd src
go run ./cmd/oh-my-posh init powershell  # or bash, zsh, fish, nushell, etc.
# For dev/test:
go test ./...
go build -o oh-my-posh ./cmd/oh-my-posh

🗺️Map of the codebase

  • src/build/version.go — Defines versioning strategy for builds; essential for release pipeline and version tracking across all binaries
  • src/cache/cache.go — Core caching abstraction used throughout the prompt rendering pipeline to optimize performance; critical for low-latency guarantee
  • src/cli/args.go — Command-line argument parsing entry point; all CLI interactions flow through this handler
  • .github/workflows/release.yml — Release automation pipeline for cross-platform builds (Windows MSI, macOS, Linux); defines artifact generation and distribution
  • src/.goreleaser.yml — GoReleaser configuration controlling multi-platform binary compilation and packaging strategy
  • .editorconfig — Enforces consistent formatting rules across 600+ files; critical for maintaining code style in contributor submissions

🛠️How to make changes

Add a new cache backend strategy

  1. Define the new cache interface in src/cache/cache.go by adding a new type that implements the Cache interface (src/cache/cache.go)
  2. Implement platform-specific storage logic in src/cache/file_windows.go or src/cache/file_unix.go (src/cache/file_windows.go)
  3. Register the new backend in src/cache/store.go's initialization logic (src/cache/store.go)
  4. Add unit tests in src/cache/store_test.go or src/cache/duration_test.go to validate TTL and retrieval (src/cache/store_test.go)

Add a new CLI command

  1. Create a new handler file in src/cli/ (e.g., src/cli/mycommand.go) with a function implementing the command logic (src/cli/args.go)
  2. Register the command in src/cli/args.go by adding a case in the main argument dispatcher (src/cli/args.go)
  3. Define version and build metadata that may be injected by the build system in src/build/version.go (src/build/version.go)
  4. Update .github/workflows/code.yml if your command needs specific testing or validation (.github/workflows/code.yml)

Add support for a new platform or shell

  1. Create platform-specific cache path resolution in src/cache/path_<platform>.go following the pattern of path_windows.go and path_unix.go (src/cache/path_windows.go)
  2. Implement platform-specific file I/O in src/cache/file_<platform>.go using native APIs (src/cache/file_windows.go)
  3. Add shell-specific initialization in .devcontainer/ for local testing (e.g., .devcontainer/config.fish for Fish shell) (.devcontainer/config.fish)
  4. Update .github/workflows/release.yml to include new platform in the cross-platform build matrix (.github/workflows/release.yml)

🔧Why these technologies

  • Go 1.26 — Cross-platform compilation with single codebase; fast startup time critical for shell prompt latency; native Windows/Unix support
  • GoReleaser — Automates multi-platform binary builds (Windows MSI, macOS, Linux) with consistent versioning and artifact management
  • Sprig templating (Masterminds/sprig/v3) — Provides rich template function library for dynamic prompt customization without reimplementing template logic
  • Image processing (fogleman/gg, esimov/stackblur-go) — Enables advanced theming with image rendering and effects for visually rich prompts
  • ANSI color support (Azure/go-ansiterm, gookit/color) — Ensures cross-platform ANSI escape sequence compatibility, especially critical for Windows console rendering

⚖️Trade-offs already made

  • Single binary per platform vs. interpreted language

    • Why: Fast startup required for every shell invocation; compilation overhead paid once at build time, not per-prompt
    • Consequence: Requires separate builds for Windows/macOS/Linux; users cannot modify source without recompilation
  • Caching with file-based store vs. in-process memory

    • Why: Prompt rendering is invoked in fresh shell processes; in-memory cache useless across sessions
    • Consequence: I/O overhead on cache misses; file-based store requires platform-specific path resolution
  • Platform-specific code paths (file_windows.go, path_unix.go) vs. abstraction layer

    • Why: Windows and Unix have fundamentally different cache paths and file I/O semantics; abstraction adds latency
    • Consequence: Code duplication; maintainers must test on multiple OSes; simpler, faster code per platform
  • CLI-driven initialization vs. shell integration library

    • Why: Shell integration must work across Bash, Zsh, Fish, PowerShell; centralized Go binary is simplest distribution model
    • Consequence: Users must run oh-my-posh init <shell> to integrate; less direct shell API access

🚫Non-goals (don't propose these)

  • Real-time prompt recomputation on file system events (uses cache TTL instead)
  • Built-in authentication/secrets management (delegates to external credential stores)
  • GUI configuration tool (text-based JSON/YAML configuration model)
  • Plugin system with dynamic loading (statically compiled binary; extensions via templating only)
  • Cross-shell session state sharing (each shell invocation is independent)

🪤Traps & gotchas

  1. Shell-specific initialization: Each shell (PowerShell, Bash, Fish, Nushell) requires different bootstrap logic; changes must be tested in target shell environments, not just via go test. 2. Configuration versioning: YAML/JSON/HCL config schemas are documented in hcl/v2 and jsonschema generators; breaking changes to config structure propagate to all users. 3. Cross-platform path handling: Windows (backslash) vs Unix (forward slash) paths; rely on os.PathSeparator, not hardcoded separators. 4. Terminal capability detection: Go 1.26 constraint and Azure/go-ansiterm for Windows ANSI support; TERM env var affects color rendering on Unix. 5. Segment initialization order: Segments evaluate in config order; circular dependencies or race conditions in git/system calls can hang prompt rendering. 6. devcontainer.json: If modifying dev environment, ensure .devcontainer/Dockerfile, PowerShell_profile.ps1, and config.fish stay in sync.

🏗️Architecture

💡Concepts to learn

  • Segment-based prompt composition — Oh-my-posh's core model: segments (git, env, time, custom) are independent units that render conditionally and compose left-to-right/right-aligned; understanding segment lifecycle (init→eval→render) is essential for adding features or debugging prompt slowness.
  • Transient prompt — A secondary, minimal prompt rendered on previous command's output; requires prompt context tracking (exit code, duration) and shell-specific history manipulation; unique to oh-my-posh and adds complexity to shell integration.
  • Right-aligned prompt (RPROMPT/RPS1) — Renders prompt content to the right margin; not all shells support this (PowerShell does via $host.ui.RawUI, Zsh via RPROMPT, Bash requires manual manipulation); segment rendering must account for available terminal width.
  • ANSI escape sequence rendering — Oh-my-posh outputs colored, styled text via ANSI codes; Azure/go-ansiterm abstracts Windows console API differences; gookit/color manages code generation. Segment output must strip/calculate display width vs byte length for proper alignment.
  • Template-based segment rendering — Segments use Masterminds/sprig templating (Go text/template) to format output; custom segments rely on template functions and variable substitution; understanding sprig syntax is critical for advanced config.
  • Shell bootstrap/initialization protocol — Each shell (PowerShell, Bash, Fish, Nushell) requires distinct initialization hooks (PS: $PROFILE, Bash: .bashrc, Fish: config.fish); oh-my-posh ships shell-specific scripts that inject its eval into shell startup; understanding shell-specific state and timing is critical for cross-platform bugs.
  • Configuration schema versioning (HCL2/YAML/JSON) — Oh-my-posh supports multiple config formats (YAML primary, JSON, HCL2); hashicorp/hcl and invopop/jsonschema enable schema generation and validation; breaking config changes require migration tooling and user communication.
  • starship/starship — Direct competitor: cross-platform prompt renderer written in Rust with similar segment-based architecture; oh-my-posh explicitly credits Starship in README.
  • ohmyzsh/ohmyzsh — Predecessor/inspiration: Zsh-specific theme framework; oh-my-posh README credits Robby Russell; ohmyzsh themes inspired oh-my-posh's approach to composition.
  • dahlbyk/posh-git — Inspiration for PowerShell segment logic; oh-my-posh README credits posh-git for git status integration; many segment patterns derive from this.
  • charmbracelet/bubbletea — Direct dependency in go.mod; provides TUI framework used for interactive config building and transient prompt UI in oh-my-posh.
  • hashicorp/hcl — Direct dependency (hashicorp/hcl/v2); enables HCL2 config parsing as alternative to YAML/JSON; critical for advanced config use cases.

🪄PR ideas

To work on one of these in Claude Code or Cursor, paste: Implement the "<title>" PR idea from CLAUDE.md, working through the checklist as the task list.

Add comprehensive test coverage for segment creation workflow

The repo has a GitHub skill at .github/skills/segment-create/SKILL.md but lacks visible test files for the segment creation logic in src/. New contributors could add unit tests for segment validation, rendering, and configuration parsing to improve code quality and reduce regressions.

  • [ ] Review .github/skills/segment-create/SKILL.md to understand segment creation requirements
  • [ ] Identify segment-related source files in src/ that lack test coverage
  • [ ] Create test_*.go files following Go testing conventions for segment initialization, property validation, and template rendering
  • [ ] Add tests to the build_code.yml workflow to ensure segment tests run on every PR
  • [ ] Document test patterns in CONTRIBUTING.md for future segment contributors

Implement missing dependency vulnerabilities scanner workflow

While .github/dependabot.yml exists for dependency updates, there's no dedicated security scanning workflow (like Trivy or Snyk) in .github/workflows/ to catch vulnerabilities in the Go dependencies. Given the critical nature of a shell prompt tool, this would significantly improve security posture.

  • [ ] Add a new .github/workflows/security-scan.yml that runs Trivy or similar on Go dependencies on schedule and PR
  • [ ] Configure the workflow to fail on high/critical vulnerabilities and report results in PR comments
  • [ ] Update SECURITY.md with vulnerability disclosure and scanning process details
  • [ ] Add security scanning badge to README.md if workflow succeeds
  • [ ] Document the scanning results in CONTRIBUTING.md for developers

Create integration tests for cross-platform shell initialization

The repo supports multiple shells (PowerShell, Fish, Bash) via .devcontainer configs but lacks visible integration tests. Add tests validating that oh-my-posh correctly initializes in each shell environment by testing .devcontainer/config.fish, .devcontainer/Microsoft.PowerShell_profile.ps1, and bash equivalents.

  • [ ] Create src/integration_tests/ directory with shell-specific test files
  • [ ] Add test scripts that verify prompt initialization and rendering in PowerShell, Fish, and Bash within .devcontainer environments
  • [ ] Create .github/workflows/integration-tests.yml to run shell initialization tests across Linux, macOS, and Windows
  • [ ] Document shell-specific initialization requirements in a new SHELL_INTEGRATION.md file
  • [ ] Add integration test results reporting to the main build_code.yml workflow

🌿Good first issues

  • Add unit test coverage for src/segments/segment_*.go files lacking tests; many segment implementations (env, time, custom) have minimal test coverage, especially error paths.
  • Document the segment configuration schema: create .md file mapping each segment's YAML fields to jsonschema output from invopop/jsonschema; useful for users and reduces config issues.
  • Create a 'validate-config' subcommand in cmd/oh-my-posh that parses config (using hashicorp/hcl or YAML parser), reports schema violations, and suggests fixes—low-risk PR expanding CLI usability without touching rendering.

Top contributors

Click to expand

📝Recent commits

Click to expand
  • 5708b0b — chore(deps): bump hono from 4.12.14 to 4.12.18 in /website/api (dependabot[bot])
  • 767fb8b — chore(deps): bump ip-address and express-rate-limit in /website/api (dependabot[bot])
  • 3972a59 — chore(deps): bump axios from 1.15.0 to 1.15.2 in /website/api (dependabot[bot])
  • 315eea6 — chore: setup copilot's runspace (JanDeDobbeleer)
  • 1496d3e — fix(ytm): store YTMDA token in device cache (JanDeDobbeleer)
  • 9bc9610 — chore(deps): bump DavidAnson/markdownlint-cli2-action in the all group (dependabot[bot])
  • 9d811e7 — fix(goconst): address PR review feedback (JanDeDobbeleer)
  • 9f3fc28 — feat(claude): add missing statusline fields (AbdelrahmanHafez)
  • 22499ca — chore(deps): bump the minor-patch group across 1 directory with 5 updates (dependabot[bot])
  • 20ae140 — chore: add instructions (JanDeDobbeleer)

🔒Security observations

  • High · Outdated Go Version with Known CVEs — src/go.mod. The project specifies go 1.26.0, which appears to be a future or invalid version. The actual Go version in use should be verified. Older Go versions contain known vulnerabilities in crypto, net, and other packages. Ensure the project uses a currently supported Go version. Fix: Verify and update to the latest stable Go version (1.23+). Check golang.org/doc/devel/release for supported versions and security fixes.
  • High · Outdated Dependency: golang.org/x/crypto — src/go.mod - golang.org/x/crypto v0.48.0. The dependency golang.org/x/crypto v0.48.0 is outdated and may contain known vulnerabilities. This is a critical cryptographic library used across the codebase. Fix: Update to the latest version of golang.org/x/crypto (v0.31.0+). Run 'go get -u golang.org/x/crypto' and review release notes for breaking changes.
  • High · Outdated Dependency: golang.org/x/sys — src/go.mod - golang.org/x/sys v0.43.0. The dependency golang.org/x/sys v0.43.0 is outdated. This package contains system-level APIs and may have known vulnerabilities affecting system interactions. Fix: Update to the latest version of golang.org/x/sys (v0.27.0+). Run 'go get -u golang.org/x/sys' to patch known vulnerabilities.
  • Medium · Outdated Dependency: golang.org/x/image — src/go.mod - golang.org/x/image v0.39.0. The dependency golang.org/x/image v0.39.0 is outdated and may contain vulnerabilities in image processing code. This library is used for rendering and image manipulation. Fix: Update to the latest version of golang.org/x/image (v0.18.0+). Run 'go get -u golang.org/x/image'.
  • Medium · Outdated Dependency: golang.org/x/text — src/go.mod - golang.org/x/text v0.36.0. The dependency golang.org/x/text v0.36.0 is outdated and may contain unicode/text processing vulnerabilities. Fix: Update to the latest version of golang.org/x/text (v0.17.0+). Run 'go get -u golang.org/x/text'.
  • Medium · Outdated Dependency: golang.org/x/mod — src/go.mod - golang.org/x/mod v0.35.0. The dependency golang.org/x/mod v0.35.0 is outdated and may have compatibility or security issues. Fix: Update to the latest version of golang.org/x/mod. Run 'go get -u golang.org/x/mod'.
  • Medium · Incomplete Dependency Specification — src/go.mod - github.com/xo/terminfo v0.. The xo/terminfo dependency has an incomplete version string ('github.com/xo/terminfo v0.'), which may indicate a parsing error or incomplete dependency lock. Fix: Review and correct the go.mod file. Run 'go mod tidy' to clean up and validate all dependencies. Ensure all dependency versions are properly specified.
  • Low · Missing Go Module Audit — .github/workflows/ (go mod scanning not evident). No evidence of automated dependency vulnerability scanning (e.g., 'go vuln' or similar) in CI/CD pipelines visible in the provided configuration. Fix: Implement 'go vuln ./...' in the CI/CD pipeline or use GitHub's dependency scanning features to detect vulnerable dependencies automatically on each build.
  • Low · No SBOM or Dependency Lock Evidence — undefined. While go.mod and go.sum files should exist, there is no evidence of a Software Bill of Materials (SBOM) generation Fix: undefined

LLM-derived; treat as a starting point, not a security audit.


Generated by RepoPilot. Verdict based on maintenance signals — see the live page for receipts. Re-run on a new commit to refresh.

Healthy signals · JanDeDobbeleer/oh-my-posh — RepoPilot