---
metadata:
  - name: generator
    content: Diplodoc Platform v5.63.0
alternate:
  - https://vibe.sourcecraft.dev/portal/docs/en/code-assistant/operations/chat.md
  - https://vibe.sourcecraft.dev/portal/docs/ru/code-assistant/operations/chat.md
  - href: https://vibe.sourcecraft.dev/portal/docs/en/code-assistant/operations/chat.md
    type: text/markdown
    title: Markdown version
  - href: https://vibe.sourcecraft.dev/portal/docs/en/code-assistant/llms.txt
    rel: describedby
title: Running SourceCraft Code Assistant in chat mode
description: How to use Code Assistant in chat mode in the JetBrains IDE to send messages, view chat history, and work with code blocks.
---
> **Documentation Index:** Fetch the complete configuration index at https://vibe.sourcecraft.dev/portal/docs/en/llms.txt


# SourceCraft Code Assistant chat interface in the JetBrains IDE

{% note warning %}

This page describes the chat features in the JetBrains IDE. To learn about the chat features in Visual Studio Code, see [SourceCraft Code Assistant chat interface in Visual Studio Code](https://vibe.sourcecraft.dev/portal/docs/en/code-assistant/operations/agent/chat-interface.md).

{% endnote %}

<!-- source: en/_includes/code-assistant/chat-description.md -->
The Code Assistant plugin has a built-in chat you can use to interact with the AI assistant right from the IDE interface. 

The following scenarios are supported:
* Generating code snippets.
* Explaining code in project files or individual file sections, including code in [markdown](https://en.wikipedia.org/wiki/Markdown) syntax intended for documentation.
* Help with debugging and troubleshooting.
* [Generating tests for your code](https://vibe.sourcecraft.dev/portal/docs/en/code-assistant/operations/quick-actions.md#test).
* [Generating documentation](https://vibe.sourcecraft.dev/portal/docs/en/code-assistant/operations/quick-actions.md#docs).
* Scanning code for potential issues.
* Generating charts.

The chat supports [context](https://vibe.sourcecraft.dev/portal/docs/en/code-assistant/operations/chat-context.md) management.
<!-- endsource: en/_includes/code-assistant/chat-description.md -->

{% note tip %}

There is also the [agent mode](https://vibe.sourcecraft.dev/portal/docs/en/code-assistant/operations/jb-agent.md) based on the [SourceCraft CLI](https://vibe.sourcecraft.dev/portal/docs/en/sourcecraft/operations/cli-quickstart.md) with editor integration, available at the _Preview stage_.

{% endnote %}

## Sending messages {#sending}

### Opening a chat {#open-chat-jb}

<!-- source: en/_includes/code-assistant/open-chat-jb.md -->
In the editor's right-hand panel, click ![image](../../_assets/code-assistant/chat-logo.svg) **SourceCraft Code Assistant Chat**.
<!-- endsource: en/_includes/code-assistant/open-chat-jb.md -->

### Sending a message {#send-message-jb}

Write your request to the AI assistant in the message input window and click ![image](../../_assets/code-assistant/jb-icon-send.svg) or press **Enter**.

For a line break in the message, press **Shift** + **Enter**. 

<!-- source: en/_includes/code-assistant/context-chat.md -->
You can ask questions in any language.

{% note info %}

The AI assistant uses the open editor tab or selected code block for context.

[Learn more about context](https://vibe.sourcecraft.dev/portal/docs/en/code-assistant/operations/chat-context.md)

{% endnote %}
<!-- endsource: en/_includes/code-assistant/context-chat.md -->

### Stopping response generation {#stop-generation-jb}

<!-- source: en/_includes/code-assistant/stop-generating.md -->
If, for example, you change your mind and want to rephrase your question, click ![image](../../_assets/console-icons/stop.svg) in the message input window.
<!-- endsource: en/_includes/code-assistant/stop-generating.md -->

### Rating the response {#rate-answer-jb}

<!-- source: en/_includes/code-assistant/thumbs-up-down.md -->
Click ![image](../../_assets/console-icons/thumbs-up.svg) or ![image](../../_assets/console-icons/thumbs-down.svg) in the bottom-right corner of the AI assistant's response.
<!-- endsource: en/_includes/code-assistant/thumbs-up-down.md -->

## Chat history {#chat-history}

Click ![image](../../_assets/code-assistant/jb-icon-clean-chat.svg) **Clean Chat** in the chat's top panel to clear your chat.

## Code blocks {#codeblocks}

Click ![image](../../_assets/code-assistant/jb-icon-copy.svg) in the top-right corner of the code block to copy the code from your chat.

#### Useful links {#see-also}

* [Getting started with SourceCraft Code Assistant](https://vibe.sourcecraft.dev/portal/docs/en/code-assistant/index.md)
* [SourceCraft Code Assistant overview](https://vibe.sourcecraft.dev/portal/docs/en/code-assistant/concepts/index.md)
* [Managing SourceCraft Code Assistant chat context in the JetBrains IDE](https://vibe.sourcecraft.dev/portal/docs/en/code-assistant/operations/chat-context.md)
* [Quick actions in SourceCraft Code Assistant](https://vibe.sourcecraft.dev/portal/docs/en/code-assistant/operations/quick-actions.md)