> ## Documentation Index
> Fetch the complete documentation index at: https://private-7c7dfe99-revert-104359-revert-104251-parquet-single.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Change the prompt in clickhouse-client

> This article explains how to change the prompt in your Clickhouse client and clickhouse-local terminal window from :) to a prefix followed by :)

export const Image = ({img, alt, size = "lg"}) => {
  const normalizedSize = ["sm", "md", "lg"].includes(size) ? size : "lg";
  return <div className={`ch-image-${normalizedSize}`}>
      <Frame>
        <img src={img} alt={alt} />
      </Frame>
    </div>;
};

If you don't like how `clickhouse client` and clickhouse-local display the prompt in your terminal window, it is possible to change it to add a prefix.
This article explains how to change the prompt to whatever you want.

The default prompt is your local computer name followed by `:) `:

<Image img="https://mintcdn.com/private-7c7dfe99-revert-104359-revert-104251-parquet-single/PFv6BUx0ibY7rkJm/images/knowledgebase/change-the-prompt-in-clickhouse-client/0_prompt.webp?fit=max&auto=format&n=PFv6BUx0ibY7rkJm&q=85&s=ceb8cad8d38a187f714cb939d0814183" size="md" alt="Default ClickHouse client prompt" width="2289" height="411" data-path="images/knowledgebase/change-the-prompt-in-clickhouse-client/0_prompt.webp" />

The following are variables that you can use in a prompt: `{user}`, `{host}`

There are several ways to update the prompt and we'll go through them each.

<h2 id="--prompt-flag">
  \--prompt flag
</h2>

The first way to change the flag is using the `--prompt`:

```bash theme={null}
clickhouse --prompt 👉
```

This will add the finger emoji before the smiley face:

<Image img="https://mintcdn.com/private-7c7dfe99-revert-104359-revert-104251-parquet-single/PFv6BUx0ibY7rkJm/images/knowledgebase/change-the-prompt-in-clickhouse-client/1_prompt.webp?fit=max&auto=format&n=PFv6BUx0ibY7rkJm&q=85&s=f878e1c2062407e13da71c6dc1edc4ee" size="md" alt="ClickHouse client prompt with finger emoji" width="2298" height="386" data-path="images/knowledgebase/change-the-prompt-in-clickhouse-client/1_prompt.webp" />

<h2 id="config-file---top-level">
  Config file - top level
</h2>

Alternatively, you can provide a prompt prefix in a `config.xml` file:

```xml theme={null}
<config>
    <prompt>👉 </prompt>
</config>
```

```
clickhouse
```

<Image img="https://mintcdn.com/private-7c7dfe99-revert-104359-revert-104251-parquet-single/PFv6BUx0ibY7rkJm/images/knowledgebase/change-the-prompt-in-clickhouse-client/2_prompt.webp?fit=max&auto=format&n=PFv6BUx0ibY7rkJm&q=85&s=b6d2f96a5f0a4dff0d2be00921d26fda" size="md" alt="ClickHouse client prompt with config file" width="2307" height="769" data-path="images/knowledgebase/change-the-prompt-in-clickhouse-client/2_prompt.webp" />

We can use a config file with any name we like and pass it in using the `-C` flag:

```xml theme={null}
<config>
    <prompt>🎄 </prompt>
</config>
```

```
clickhouse -C christmas.xml
```

<Image img="https://mintcdn.com/private-7c7dfe99-revert-104359-revert-104251-parquet-single/PFv6BUx0ibY7rkJm/images/knowledgebase/change-the-prompt-in-clickhouse-client/3_prompt.webp?fit=max&auto=format&n=PFv6BUx0ibY7rkJm&q=85&s=b99f32d518adb37f442fd49cce210c40" size="md" alt="ClickHouse client prompt with Christmas tree emoji" width="2314" height="781" data-path="images/knowledgebase/change-the-prompt-in-clickhouse-client/3_prompt.webp" />

Prefer your config files to be in YAML?
That works too:

```yaml theme={null}
prompt: 🟡
```

```bash theme={null}
clickhouse -C christmas.yaml
```

<Image img="https://mintcdn.com/private-7c7dfe99-revert-104359-revert-104251-parquet-single/PFv6BUx0ibY7rkJm/images/knowledgebase/change-the-prompt-in-clickhouse-client/4_prompt.webp?fit=max&auto=format&n=PFv6BUx0ibY7rkJm&q=85&s=afa2bab09446b057bda2e8d4d525fdab" size="md" alt="ClickHouse client prompt with yellow circle emoji" width="2302" height="600" data-path="images/knowledgebase/change-the-prompt-in-clickhouse-client/4_prompt.webp" />

<h2 id="config-file---connections_credentials">
  Config file - connections\_credentials
</h2>

Alternatively, you can specify a prompt per connection credentials.
This only makes sense when using clickhouse-client.

```xml theme={null}
<config>
    <connections_credentials>
        <connection>
            <n>prod<n>
            <hostname>127.0.0.1</hostname>
            <port>9000</port>
            <secure>0</secure>
            <user>default</user>
            <prompt>\e[31m[PRODUCTION]\e[0m {user}@prod</prompt>
        </connection>
        <connection>
            <n>dev<n>
            <hostname>127.0.0.1</hostname>
            <port>9000</port>
            <secure>0</secure>
            <user>default</user>
            <prompt>\e[32m[DEVELOPMENT]\e[0m {user}@dev</prompt>
        </connection>
    </connections_credentials>
</config>
```

We can then try to connect with the `dev` connection:

```bash theme={null}
clickhouse client -C connections.xml --connection dev
```

<Image img="https://mintcdn.com/private-7c7dfe99-revert-104359-revert-104251-parquet-single/PFv6BUx0ibY7rkJm/images/knowledgebase/change-the-prompt-in-clickhouse-client/5_prompt.webp?fit=max&auto=format&n=PFv6BUx0ibY7rkJm&q=85&s=681d5bed3e8fcf669f42a8077c58b511" size="md" alt="ClickHouse client prompt with development connection" width="1310" height="203" data-path="images/knowledgebase/change-the-prompt-in-clickhouse-client/5_prompt.webp" />

Or the `prod` one:

```bash theme={null}
clickhouse client -C connections.xml --connection prod
```

<Image img="https://mintcdn.com/private-7c7dfe99-revert-104359-revert-104251-parquet-single/PFv6BUx0ibY7rkJm/images/knowledgebase/change-the-prompt-in-clickhouse-client/6_prompt.webp?fit=max&auto=format&n=PFv6BUx0ibY7rkJm&q=85&s=3d6cfd5a11881160257def96bb88147c" size="md" alt="ClickHouse client prompt with production connection" width="1297" height="189" data-path="images/knowledgebase/change-the-prompt-in-clickhouse-client/6_prompt.webp" />

And here's a YAML version:

```yaml theme={null}
connections_credentials:
  connection:
    - name: prod
      hostname: 127.0.0.1
      port: 9000
      secure: 0
      user: default
      prompt: "\e[35m[PRODUCTION]\e[0m {user}@{host}"
    - name: dev
      hostname: 127.0.0.1
      port: 9000
      secure: 0
      user: default
      prompt: "\e[34m[DEVELOPMENT]\e[0m {user}@{host}"
```

With the `dev` connnection:

```bash theme={null}
clickhouse client -C connections.yaml --connection dev
```

<Image img="https://mintcdn.com/private-7c7dfe99-revert-104359-revert-104251-parquet-single/PFv6BUx0ibY7rkJm/images/knowledgebase/change-the-prompt-in-clickhouse-client/7_prompt.webp?fit=max&auto=format&n=PFv6BUx0ibY7rkJm&q=85&s=7d3b2619a98c5ad1ecf1b0af1809f3c2" size="md" alt="ClickHouse client prompt with development connection using YAML" width="1581" height="169" data-path="images/knowledgebase/change-the-prompt-in-clickhouse-client/7_prompt.webp" />

And now `prod`:

```bash theme={null}
clickhouse client -C connections.yaml --connection prod
```

<Image img="https://mintcdn.com/private-7c7dfe99-revert-104359-revert-104251-parquet-single/PFv6BUx0ibY7rkJm/images/knowledgebase/change-the-prompt-in-clickhouse-client/8_prompt.webp?fit=max&auto=format&n=PFv6BUx0ibY7rkJm&q=85&s=ff1de0716c50110a304b850c4080c432" size="md" alt="ClickHouse client prompt with production connection using YAML" width="1525" height="187" data-path="images/knowledgebase/change-the-prompt-in-clickhouse-client/8_prompt.webp" />
