# rpk profile prompt

> For the complete documentation index, see [llms.txt](https://docs.redpanda.com/llms.txt). Component-specific: [streaming-full.txt](https://docs.redpanda.com/streaming-full.txt)

---
title: rpk profile prompt
latest-redpanda-tag: v26.2.1
latest-console-tag: v3.10.0
latest-operator-version: v26.2.1
# EOL = End-of-Life (support lifecycle status)
page-is-nearing-eol: "false"
page-is-past-eol: "false"
page-eol-date: July 28, 2027
latest-connect-version: 4.105.0
docname: rpk/rpk-profile/rpk-profile-prompt
page-component-name: streaming
page-version: "26.2"
page-component-version: "26.2"
page-component-title: Streaming
page-relative-src-path: rpk/rpk-profile/rpk-profile-prompt.adoc
page-edit-url: https://github.com/redpanda-data/docs/edit/main/modules/reference/pages/rpk/rpk-profile/rpk-profile-prompt.adoc
description: Prompt a profile name formatted for a PS1 prompt. This command prints ANSI-escaped text per your current profile's <code>prompt</code> field.
page-git-created-date: "2023-08-04"
page-git-modified-date: "2026-08-03"
support-status: supported
---

<!-- Source: https://docs.redpanda.com/streaming/current/reference/rpk/rpk-profile/rpk-profile-prompt.md -->

Prompt 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.

To use this in zsh, be sure to add setopt PROMPT\_SUBST to your .zshrc. To edit your PS1, use something like PS1='$(`rpk profile prompt`)' in your shell rc file.

## [](#usage)Usage

```bash
rpk profile prompt [flags]
```

### [](#format)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:

```text
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.

```text
prompt: ("--") (hi-white bg-red bold "[%p]")
```

### [](#colors)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`, etc. The `bg-` prefix modifies the background color: `bg-black`, `bg-hi-red`, etc.

### [](#modifiers)Modifiers

Four modifiers are supported, `bold`, `faint`, `underline`, and `invert`.

### [](#raw-mode)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.

```text
prompt: raw, "%n"
prompt: raw, "[%p]"
```

## [](#flags)Flags

| Value | Type | Description |
| --- | --- | --- |
| --validate | bool | Exit with an error message if the prompt is invalid. |

## [](#global-flags)Global flags

| Value | Type | Description |
| --- | --- | --- |
| --config | string | Redpanda or rpk config file; default search paths are ~/.config/rpk/rpk.yaml, $PWD/redpanda.yaml, and /etc/redpanda/redpanda.yaml. |
| -X, --config-opt | stringArray | Override rpk configuration settings; -X help for detail or -X list for terser detail. |
| --ignore-profile | bool | Ignore rpk.yaml and redpanda.yaml; use default settings. |
| --profile | string | rpk profile to use. |
| -v, --verbose | bool | Enable verbose logging. |