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

# Gemini CLI

> Integrate Entire with Google's Gemini CLI

Gemini CLI is Google's command-line interface for Gemini AI. Entire supports capturing sessions from Gemini CLI, tracking your AI-assisted coding interactions. The Gemini CLI integration is in preview and may contain bugs.

## Prerequisites

* [Entire CLI installed](/cli/installation)
* [Gemini CLI](https://github.com/google/gemini-cli) installed
* A Git repository with Entire enabled

## Enable

```bash theme={null}
entire agent add gemini
gemini
```

<AccordionGroup>
  <Accordion title="How it works">
    Entire integrates with Gemini CLI through Git hooks. When you start Gemini CLI in an Entire-enabled repository:

    1. **Process Detection** — Entire detects when Gemini CLI is running.
    2. **File Monitoring** — file changes are tracked during the session.
    3. **Checkpoint Creation** — created when you or the agent make a Git commit.
    4. **Session Storage** — data saved to the `entire/checkpoints/v1` branch.

    The session ends when Gemini CLI exits.
  </Accordion>

  <Accordion title="What gets captured">
    | Data               | Description                           |
    | ------------------ | ------------------------------------- |
    | File changes       | All files modified during the session |
    | Timestamps         | Session and checkpoint timing         |
    | Session boundaries | Start and end of Gemini sessions      |
    | Checkpoints        | Rewind points within sessions         |
  </Accordion>

  <Accordion title="Features">
    **Rewind during sessions.** Use `entire checkpoint rewind` to restore to a previous checkpoint during or after a Gemini CLI session. See the [`rewind` command reference](/cli/commands#rewind) for full flag documentation.

    **Resume previous sessions.** Switch to a session's branch with `entire session resume <branch>`. The CLI restores the session log if needed and prints the command to resume the session. See the [`resume` command reference](/cli/commands#resume) for full flag documentation.

    **Explain commits.** Inspect any commit or checkpoint with `entire checkpoint explain`. See the [`explain` command reference](/cli/commands#explain) for full flag documentation.
  </Accordion>

  <Accordion title="Caveats and limitations">
    * Conversation transcripts may not be captured depending on Gemini CLI version.
    * Session detection relies on process monitoring rather than dedicated lifecycle hooks.
    * Token usage is not tracked.
    * Works best when you commit at logical stopping points, or tell the agent to handle committing.
  </Accordion>

  <Accordion title="Best practices">
    **Commit at logical points.** Commit when you've made meaningful progress:

    ```bash theme={null}
    git add .
    git commit -m "Implement feature with Gemini assistance"
    ```

    **Check status regularly.** Monitor your session with `entire status`.
  </Accordion>

  <Accordion title="Example workflow">
    ```bash theme={null}
    # 1. Setup
    cd my-project
    entire agent add gemini

    # 2. Start Gemini CLI
    gemini

    # 3. Work with Gemini
    # Ask it to write code, make changes, etc.

    # 4. Check session (in another terminal)
    entire status

    # 5. Rewind if needed
    entire checkpoint rewind

    # 6. Commit when ready
    git add .
    git commit -m "Add feature with Gemini"

    # 7. Push
    git push
    ```
  </Accordion>
</AccordionGroup>

## Troubleshooting

<AccordionGroup>
  <Accordion title="Session not detected">
    1. Ensure you're in an Entire-enabled repo: `entire status`
    2. Verify Gemini CLI is running from within the repository
    3. Check Git hooks are installed: `ls .git/hooks`
  </Accordion>

  <Accordion title="No checkpoints created">
    1. Checkpoints require file changes
    2. Make sure Gemini is modifying files in the repository
    3. Check your settings in `.entire/settings.json`
  </Accordion>
</AccordionGroup>
