# Gemini CLI

> Import historical Gemini CLI chats, checkpoints, and prompt logs from saved local stores.

Gemini CLI is a historical import-only source in Hansard. Hansard imports its
saved chats, checkpoints, and prompt logs without setting up integrations. For current Google
agents, use [Antigravity](https://www.hansard.dev/imports/antigravity/).

## Source IDs

| Source       | Use it for                                                                                               |
| ------------ | -------------------------------------------------------------------------------------------------------- |
| `gemini-cli` | Saved Gemini CLI chats, checkpoints, and prompt logs under `~/.gemini/tmp/` and `~/.cache/.gemini/tmp/`. |

## How the import works

Hansard scans Gemini CLI's project folders under `~/.gemini/tmp/<project-id>/`
and the macOS Seatbelt location `~/.cache/.gemini/tmp/<project-id>/`: saved chat JSON and JSONL files, manual
checkpoints, tool checkpoints, prompt logs, and one level of subagent sessions.
It does not import shell history or files you exported yourself. User and model
messages, function calls and results, checkpoints, model details, usage, and
the project are kept when Gemini CLI recorded them.

`HANSARD_GEMINI_HOME_DIR` or `GEMINI_HOME` selects one alternate root and
disables default-root discovery. Each root uses its own `projects.json` and
`.project_root` markers to resolve project identity.

Hansard replays each JSONL file in order before importing it. A repeated
message ID replaces the earlier message, a rewind removes the chosen turn and
everything after it, and a full-history snapshot replaces the current
messages. When both an older hash-named folder and its copied project-name
folder exist, the session ID picks one conversation, and the JSONL file wins
over an older JSON copy.

Only files still in Gemini CLI's folders can be imported, and Gemini CLI may
already have deleted older or temporary files. Subagent sessions stay as
linked conversations instead of being merged into the parent. Run the import
again to pick up changes to the saved files.

## Import and keep current

**Import now**

```sh
hansard import --source gemini-cli --since all
```

You do not need Gemini CLI installed to import its saved history.

**Keep current**

Gemini CLI remains a historical source. Run the import again after copying
additional saved history into the selected store. For current Google agents,
follow the [Antigravity guide](https://www.hansard.dev/imports/antigravity/).

## Review the import in the app

1. When the import finishes, open **Conversations** and select **Filter & sort**.
2. Set **Source** to **Gemini CLI** and set **Time** to the window you imported. Use **Folder** to narrow the list when you use this harness in several projects.
3. Select a conversation to check its messages, tool calls, files, commits, model, and token usage.

To keep archiving new sessions from a local harness, open **Settings → Imports**. **Automatic** follows every supported harness installed on this computer. **Custom** lets you turn individual harnesses on or off. Cloud sources and account exports never run from here; each needs its own import command. If a conversation you expect is missing after you reset the filters, run the import command on this page again with `--explain-skips` where the source supports it.

## What Hansard preserves

- Saved JSON and JSONL chats, manual checkpoints, tool checkpoints, prompt
  logs, and subagent sessions.
- User and model messages, function calls and results, shell and code
  execution, usage, title changes, and session events when recorded.
- Links between each subagent session and the call that started it.
- Gemini CLI's end-of-session summary, stored with the session's details rather
  than as a chat message.

## Known limitations

- Gemini CLI's retention settings may have deleted older files before Hansard
  imported them.
- Hansard does not import files you created with `/chat share` or
  `/export-session`.
- Hansard does not offer a command to resume a Gemini CLI conversation.
- An older session cannot gain details that Gemini CLI never saved.

## Refresh an existing archive

To reread only conversations with an older parser version from available
Gemini CLI files:

```sh
hansard rebuild --stale-parsers --source-type gemini-cli-history --since all
```

To reparse only Hansard's preserved bytes, without reading Gemini CLI's store:

```sh
hansard rebuild --from-raw --source-type gemini-cli-history --since all
```

Neither command needs a complete archive reimport or a separate index rebuild.
Use `hansard import --source gemini-cli --since all` when a previously skipped
provider file has no archived raw copy. Gemini CLI remains historical import-only.
