Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/romkatv/powerlevel10k/llms.txt

Use this file to discover all available pages before exploring further.

The p10k command is the single user-facing CLI installed by Powerlevel10k. It exposes every runtime capability of the theme — from launching the configuration wizard to controlling which prompt segments are visible — through a set of well-defined subcommands. All Powerlevel10k configuration is read from ~/.p10k.zsh, and p10k is your primary tool for generating, reloading, and dynamically adjusting that configuration without restarting your shell.

Subcommands

p10k configure

Launches the interactive configuration wizard, which walks you through a series of visual questions and writes a fully-commented ~/.p10k.zsh based on your answers. If the wizard has already run before, the file is overwritten.
p10k configure
The wizard runs automatically on the first Zsh startup if no POWERLEVEL9K_* parameters are defined. Set POWERLEVEL9K_DISABLE_CONFIGURATION_WIZARD=true in ~/.zshrc to suppress this auto-launch.
The output path for the generated config can be overridden with the POWERLEVEL9K_CONFIG_FILE environment variable:
POWERLEVEL9K_CONFIG_FILE=~/.config/zsh/p10k.zsh p10k configure

p10k reload

Re-applies the prompt configuration. You must call this after modifying any POWERLEVEL9K_* parameter in an already-running interactive shell (as opposed to editing ~/.p10k.zsh before a new session).
p10k reload
Set POWERLEVEL9K_DISABLE_HOT_RELOAD=false in ~/.p10k.zsh to enable automatic reload whenever a POWERLEVEL9K_* parameter changes. This eliminates the need to call p10k reload manually, at the cost of a marginally slower prompt.

p10k segment

Renders a single user-defined prompt segment. This command is designed to be called inside a custom prompt_<name> function during prompt rendering — it cannot be used from the command line directly.
p10k segment [-h] [{+|-}re] [-s STATE] [-b BG] [-f FG] [-i ICON] [-c COND] [-t TEXT]
To enable a custom segment named core, add core to POWERLEVEL9K_LEFT_PROMPT_ELEMENTS or POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS in ~/.p10k.zsh.

Options

FlagDescription
-s STATESegment state suffix (uppercase). Different states can have different colors and icons via POWERLEVEL9K_<NAME>_<STATE>_FOREGROUND etc. İ is normalized to I.
-b BGBackground color. Accepts a color name (blue), 0–255 index, or #RRGGBB. An empty value means transparent. Default is black (0).
-f FGForeground color. Same format as -b. Empty means the terminal default.
-i ICONIcon or glyph displayed before the text content.
-rTreat the icon as a symbolic reference (e.g., LOCK_ICON) to be resolved by Powerlevel10k.
+rIcon is already resolved and should be printed literally (default).
-eThe text content (-t) undergoes parameter expansion and process substitution. Advanced feature — use with caution.
+eDo not expand text content (default).
-c CONDCondition: if this expression expands to an empty string or false, the segment is hidden. Defaults to 1 (always shown).
-t TEXTMain text content of the segment. Undergoes prompt expansion (e.g., %F{blue}%*%f). Default is empty.
-hPrint usage help and exit.
p10k segment can only be called during prompt rendering (inside a prompt_<name> function). Calling it outside this context prints an error and returns non-zero.

p10k display

Shows, hides, or toggles individual prompt parts at runtime without editing ~/.p10k.zsh. Changes take effect immediately in ZLE (the line editor), making this ideal for key bindings.
# Set or toggle state
p10k display part-pattern=state-list...

# Dump current state
p10k display -a [part-pattern]...

# Redisplay prompt
p10k display -r

Options

FlagDescription
-rRedisplay (reset) the prompt.
-aDump the current display state into the reply associative array.
-hPrint help and exit.
NAME=showShow the named part.
NAME=hideHide the named part.
NAME=show,hideCycle through the listed states on each invocation.

Part names

PatternMatches
empty_lineThe empty separator line between prompts
rulerThe ruler line (if configured)
NEntire prompt line N (1-based; negative counts from bottom)
N/leftLeft prompt on line N
N/rightRight prompt on line N
N/gapGap between left and right prompts on line N
N/left_frameLeft frame on line N
N/right_frameRight frame on line N
N/left/SSegment S within the left prompt on line N
N/right/SSegment S within the right prompt on line N
Glob patterns are accepted for part names. For example, */kubecontext matches every kubecontext segment regardless of which prompt line it is on.

p10k help

Prints usage documentation for p10k or for a specific subcommand.
p10k help            # overall usage
p10k help segment    # segment subcommand reference
p10k help display    # display subcommand reference
p10k help configure  # configure subcommand reference
p10k help reload     # reload subcommand reference

p10k finalize

Marks the end of the instant-prompt initialization phase. This is called internally — Powerlevel10k’s instant-prompt snippet adds it to ~/.zshrc automatically. You do not need to call it manually.
# Added automatically by p10k configure at the bottom of ~/.zshrc
p10k finalize
Calling p10k finalize outside of the instant prompt context (i.e., when instant prompt is not active) is a no-op. Calling it with the wrong argument prints an error.

p10k clear-instant-prompt

Clears any content that was printed by the instant prompt. Useful if you need to programmatically remove the placeholder prompt that appears before Zsh has fully initialized.
p10k clear-instant-prompt
This command is safe to call even when instant prompt is not active — it simply returns 0.

Key Configuration Variables

The following POWERLEVEL9K_* parameters govern the overall behaviour of the theme. Set them in ~/.p10k.zsh (generated by p10k configure) or in ~/.zshrc before sourcing the theme.
POWERLEVEL9K_LEFT_PROMPT_ELEMENTS
array
Ordered list of segment names to display on the left side of the prompt. Example:
typeset -g POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(
  os_icon dir vcs prompt_char
)
POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS
array
Ordered list of segment names to display on the right side of the prompt. Example:
typeset -g POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=(
  status command_execution_time context time
)
POWERLEVEL9K_INSTANT_PROMPT
string
default:"verbose"
Controls the instant prompt feature.
  • verbose — enables instant prompt and prints a warning when console output is detected during initialization.
  • quiet — enables instant prompt without the warning.
  • off — disables instant prompt entirely.
POWERLEVEL9K_TRANSIENT_PROMPT
string
default:"off"
Controls the transient prompt feature, which replaces previous prompts with a condensed version to reduce scrollback clutter.
  • always — always use transient prompt.
  • same-dir — use transient prompt only when staying in the same directory.
  • off — disabled.
POWERLEVEL9K_MODE
string
default:"nerdfont-complete"
Determines which icon set is used.
  • nerdfont-complete — all Nerd Fonts glyphs.
  • nerdfont-v3 — Nerd Fonts v3 glyphs.
  • powerline — Powerline symbols only.
  • ascii — ASCII-only; works with every font.
POWERLEVEL9K_CONFIG_FILE
string
default:"${ZDOTDIR:-~}/.p10k.zsh"
Path to the configuration file written by p10k configure. Defaults to ${ZDOTDIR:-~}/.p10k.zsh. Override this variable before sourcing the theme to use a different location.
POWERLEVEL9K_DISABLE_CONFIGURATION_WIZARD
boolean
default:"false"
Set to true to prevent the configuration wizard from launching automatically when no POWERLEVEL9K_* parameters are defined.
POWERLEVEL9K_DISABLE_HOT_RELOAD
boolean
default:"true"
Set to false to enable automatic prompt refresh whenever a POWERLEVEL9K_* parameter is changed, without needing to call p10k reload. Adds a small overhead to every prompt.
POWERLEVEL9K_<SEGMENT>_SHOW_ON_COMMAND
string
An ERE regex. When set, the named segment is shown only while the command currently being typed matches this regex. Example:
typeset -g POWERLEVEL9K_KUBECONTEXT_SHOW_ON_COMMAND='kubectl|helm|kubens'
POWERLEVEL9K_<SEGMENT>_FOREGROUND / _BACKGROUND
string | integer
Per-segment color overrides. Colors can be specified as a 0–255 index or as a #RRGGBB hex string (requires truecolor terminal).
typeset -g POWERLEVEL9K_TIME_FOREGROUND=160
typeset -g POWERLEVEL9K_DIR_BACKGROUND='#005fd7'

Build docs developers (and LLMs) love