A ZSH plugin that adds a live statusline to GitHub Copilot CLI — no Oh-My-Posh, no extra renderers, no dependencies beyond Python 3 (always available on macOS/Linux).
Based on the approach described in Scott Hanselman's gist, adapted for pure ZSH / ANSI terminals.
my-repo ctx 123.5k/200.0k ██████░░░░ ⏱ 00:12:34 +42/-8
Each segment uses a distinct ANSI background colour:
| Segment | Colour | Content |
|---|---|---|
| Folder | 🟠 orange | Working directory name Copilot is operating in |
| Context | 🟢 green | current tokens / limit |
| Gauge | green→orange→red | Visual fill bar (shifts colour as context fills) |
| Duration | 🔵 blue | Elapsed session time HH:MM:SS |
| Changes | 🟣 purple | +lines added / -lines removed (hidden when zero) |
- ZSH
- Python 3 (standard on macOS / most Linux distros)
- GitHub Copilot CLI with the experimental
STATUS_LINEfeature
With Znap (recommended)
Add to your ~/.zshrc:
znap source kruzyk/zsh-copilot-statuslineThen reload your shell and run the one-time setup:
source ~/.zshrc
copilot_statusline_setupSource the main plugin file from wherever your manager clones it:
source /path/to/zsh-copilot-statusline/zsh-copilot-statusline.plugin.zsh
copilot_statusline_setupcopilot_statusline_setup writes two keys into ~/.copilot/settings.json:
{
"statusLine": {
"type": "command",
"command": "/path/to/plugin/scripts/statusline.sh",
"padding": 1
},
"feature_flags": {
"enabled": ["STATUS_LINE"]
},
"experimental": true
}Existing settings are preserved — the function only merges/adds, never replaces.
After running setup, restart Copilot CLI:
/restart
copilot_statusline_test # uses current $PWD
copilot_statusline_test ~/my-repo # use a specific pathThis pipes a sample JSON payload through the renderer so you can verify colours and layout before opening Copilot.
Copilot CLI ──JSON──► statusline.sh ──exec──► _renderer.py ──ANSI text──► Copilot CLI
stdin stdout
Copilot CLI sends a JSON payload on stdin each time it wants to refresh the statusline.
statusline.sh is a thin bash entry point that exec-replaces itself with python3 _renderer.py, inheriting stdin.
The Python renderer parses the JSON and writes a single ANSI-coloured line to stdout.
The statusline can appear in screenshots, screen recordings, and pair-programming sessions.
It intentionally shows only: folder name, token counts, elapsed time, and line-change counts.
No secrets, tokens, URLs, or personal data are rendered.
MIT