In previous posts, I covered how to customize the GitHub Copilot CLI statusline. First with the default options, then witha dynamic script. Today we're taking it a step further: integrating Oh My Posh to bring full prompt theming support to your Copilot CLI session.
Oh My Posh has native support for GitHub Copilot CLI, so you get all its theming power (Nerd Font icons, color gradients, diamond-style segments,…) rendering right inside the Copilot CLI statusline.
What Is Oh My Posh?
Oh My Posh is a cross-shell prompt engine that lets you define richly styled prompts using a JSON (or YAML/TOML) configuration file. You probably know it from PowerShell or bash, but it also ships a dedicated copilot subcommand specifically for integration with GitHub Copilot CLI's statusLine feature.
Prerequisites
- Oh My Posh installed (
winget install JanDeDobbeleer.OhMyPoshsee docs) - A Nerd Font installed and set as your terminal font (for icons to render correctly)
- GitHub Copilot CLI with statusline support (the
STATUS_LINEfeature flag)
Wiring it up
The integration is a one-liner in your Copilot CLI config (check your %USERPROFILe%\.copilot folder). Point the statusLine.command at oh-my-posh copilot, enable the feature flag, and set experimental: true:
{
"statusLine": {
"type": "command",
"command": "oh-my-posh copilot"
},
"feature_flags": {
"enabled": ["STATUS_LINE"]
},
"experimental": true
}
Restart Copilot CLI (or run /restart in an open session) to pick up the change. Oh My Posh will now render your configured prompt theme in the statusline on every refresh.
Tip: You can point Oh My Posh at a config file specifically tailored for Copilot CLI — keeping it separate from your shell prompt theme:
"command": "oh-my-posh copilot --config /path/to/copilot.omp.json"
The copilot_cli segment
Oh My Posh reads the session JSON that Copilot CLI pipes to stdin on every statusline refresh. It exposes that data through a dedicated copilot_cli segment type, which you add to your .omp.json theme like any other segment.
Here's the minimal sample configuration from the docs:
{
"type": "copilot_cli",
"style": "diamond",
"leading_diamond": "",
"trailing_diamond": "",
"foreground": "#111111",
"background": "#fee898",
"template": " {{ .Model.DisplayName }} {{ .TokenGauge }} "
}
This gives you a styled, icon-adorned segment showing the active model name and a visual token gauge — out of the box.
What properties are available?
The segment exposes a rich set of properties you can reference in your template. Here are the most useful ones:
| Property | What it shows |
.Model.DisplayName |
Human-readable model name, e.g. claude-sonnet-4.6 (medium) |
.TokenGauge |
Visual gauge of remaining context capacity, e.g. ▰▰▰▱▱ |
.TokenGaugeUsed |
Visual gauge of used context capacity |
.TokenUsagePercent |
% of context window used (0–100) |
.RemainingPercent |
% of context window remaining |
.RemainingTokensCount |
Raw count of remaining tokens |
.FormattedTokens |
Human-readable total token count, e.g. 1.2K |
|
Total session duration, e.g. 2m 5s |
.SessionName |
Custom session name (empty if not set |
Customizing the gauge
The token gauge characters are configurable via segment options:
{
"type": "copilot_cli",
"gauge_marked_char": "█",
"gauge_unmarked_char": "░",
"template": " {{ .Model.DisplayName }} {{ .TokenGauge }} "
}
This replaces the default ▰/▱ with solid block characters. Use .TokenGauge and .TokenGaugeUsed — rather than the raw Percentage methods — to ensure your custom characters are respected.
A more complete example
Here's a template that surfaces model, token gauge, usage percentage, and session duration in one segment:
{
"type": "copilot_cli",
"style": "diamond",
"leading_diamond": "",
"trailing_diamond": "",
"foreground": "#111111",
"background": "#fee898",
"template": " {{ .Model.DisplayName }} {{ .TokenGauge }} {{ .TokenUsagePercent }}% {{ .FormattedDuration }}"
}
You can combine this with other Oh My Posh segments (git, path, time, etc.) exactly as you would in any other shell prompt config — the copilot_cli segment is just one more building block in your theme.
How it works under the hood
The oh-my-posh copilot command reads the session JSON from stdin, caches the parsed data, renders your configured prompt template, and writes the result back to Copilot CLI as the statusline output. Copilot CLI sends a fresh JSON payload on every refresh cycle, so the segment always reflects live session state.
The segment only renders when Copilot CLI is actively providing data — so it won't show up if Oh My Posh is also driving your regular shell prompt.
Wrapping up
Oh My Posh integration is the natural next step after getting comfortable with the raw statusLine JSON config. You get:
- The full Oh My Posh theming ecosystem (styles, colors, icons, diamonds)
- Live Copilot CLI session data (model, tokens, duration, cost) exposed as template properties
- A config you can version and share alongside the rest of your dev environment dotfiles
The full segment reference is at ohmyposh.dev/docs/segments/cli/copilot-cli. And if you haven't set up Nerd Fonts yet, that's the one prerequisite worth doing first.
More information
Always know where you stand: Setting up a live status line in GitHub Copilot CLI - Part 1
Always know where you stand: Setting up a live status line in GitHub Copilot CLI - Part 2