rpk profile prompt
Print a profile name formatted for a PS1 prompt.
This command prints ANSI-escaped text per your current profile’s prompt
field. If the current profile does not have a prompt, this prints nothing.
If the prompt is invalid, this exits 0 with no message. To validate the
current prompt, use the --validate flag.
This command may introduce other % variables in the future. If you want to
print a % directly, use %% to escape it.
|
Format
The prompt field supports space or comma separated modifiers and a quoted
string that is be modified. Inside the string, the variable %p or %n refers to
the profile name. As a few examples:
prompt: hi-white, bg-red, bold, "[%p]"
prompt: hi-red "PROD"
prompt: white, "dev-%n
If you want to have multiple formats, you can wrap each formatted section in parentheses.
prompt: ("--") (hi-white bg-red bold "[%p]")
Colors
All ANSI colors are supported, with names matching the color name:
black, red, green, yellow, blue, magenta, cyan, white.
The hi- prefix indicates a high-intensity color: hi-black, hi-red, for example.
The bg- prefix modifies the background color: bg-black, bg-hi-red, for example.
Raw mode
The raw modifier disables ANSI color escapes entirely, outputting plain text. This is useful when your shell has issues with ANSI escape sequences affecting terminal width calculations.
prompt: raw, "%n"
prompt: raw, "[%p]"
Flags
| Value | Type | Description |
|---|---|---|
|
- |
Help for prompt. |
|
- |
Exit with an error message if the prompt is invalid. |
|
string |
Redpanda or |
|
stringArray |
Override |
|
- |
Ignore |
|
string |
Profile to use. See |
|
- |
Enable verbose logging. |