> ## Documentation Index
> Fetch the complete documentation index at: https://chatcli.edilsonfreitas.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Recipe: Generating Release Notes with @git

> Learn how to use the @git command to automatically generate a clear and concise changelog for your new releases.

Keeping a `CHANGELOG.md` up to date is crucial, but it can be a tedious task. This recipe will show you how to use ChatCLI's `@git` command to analyze your recent changes and generate a release notes proposal in seconds.

## The Problem

After completing a series of commits for a new version, you need to summarize what was done. The manual process usually involves:

1. Running `git log --oneline` to see the commits.
2. Analyzing each commit message.
3. Grouping changes by type (New Features, Bug Fixes, etc.).
4. Writing a summary in Markdown.

Let's automate this.

***

## Ingredients

For this recipe, you will need:

* To be in the root folder of a Git repository.
* To have some committed changes since the last tag/version.

***

## Step by Step

<Steps>
  <Step title="Start ChatCLI and Use the @git Command">
    The `@git` command automatically collects crucial information from your repository: the current branch, file status, diffs, and most importantly, recent commits.

    Let's combine this with a clear prompt, instructing the AI on the format we want.

    ```bash theme={"system"}
    @git > Analyze the commits and code changes and generate a release notes proposal for version v1.2.0. Group the changes into sections such as "New Features", "Bug Fixes", and "Internal Improvements". Use Markdown format.
    ```

    <Info>
      **Deconstructing the Prompt:**

      * **`@git >`**: The command injects all Git context. The `>` operator separates the context from our instruction.
      * **"Analyze the commits and changes..."**: We ask the AI to not only read the commit messages but also correlate them with the code diffs provided.
      * **"generate a release notes proposal..."**: We make the final goal clear.
      * **"Group the changes into sections..."**: We give the AI a clear structure to follow, ensuring a consistent result.
    </Info>
  </Step>

  <Step title="Analyze and Refine the AI Response">
    ChatCLI will send the context to the AI, which will process the information and return a formatted response.

    **Example AI Response:**

    ```markdown theme={"system"}
    Sure! Based on the commits and code changes, here is a release notes proposal for **v1.2.0**.

    ---

    ### Release Notes - v1.2.0

    This release introduces the powerful persistent context management system and improves Agent Mode performance.

    #### New Features

    -   **Persistent Context Management (`/context`)**: It is now possible to create, save, attach, and manage project "snapshots" for reuse across different sessions. This includes the `create`, `attach`, `list`, and `delete` subcommands.
    -   **Smart File Mode (`@file --mode=smart`)**: A new mode that allows the AI to select the most relevant files for the user's question, ideal for large codebases.

    #### Bug Fixes

    -   Fixed a bug in Agent Mode where the `p` key to toggle the view did not work correctly on Windows.
    -   Resolved a concurrency issue that could cause a panic when canceling a request (`Ctrl+C`) during file processing.

    #### Internal Improvements

    -   Optimized file processing in the `@file` command, resulting in up to 30% faster reading in directories with many small files.
    -   Refactored `LLMManager` to allow more flexible configuration of retry policies (attempts and backoff).

    ---
    ```
  </Step>

  <Step title="Use the Result">
    Now you have a high-quality draft for your release notes. Simply copy the text, paste it into your `CHANGELOG.md` or your GitHub release description, make any fine-tuning adjustments you see fit, and you are done!

    <Tip>
      You turned a 15-minute task into a single 15-second command.
    </Tip>
  </Step>
</Steps>

***

## Next Steps

<CardGroup cols={2}>
  <Card title="Debug Logs with Pipes" icon="bug" href="/cookbook/debugging-logs-with-pipes">
    Use pipes and `@command` to analyze error logs quickly
  </Card>

  <Card title="Understand a New Project" icon="rocket" href="/cookbook/onboarding-new-project">
    Use `@file --mode=summary` to explore unfamiliar codebases
  </Card>
</CardGroup>
