How to save, export and share a chat from Gemini CLI

Gemini CLI is a powerful AI coding assistant built on Google’s Gemini models. While Gemini CLI is great for interactive development sessions, it doesn’t have a built-in way to export chat history or share conversations. If you’ve ever wanted to export a Gemini CLI chat, save a session for later reference, or share an AI-assisted coding session with a teammate — this guide is for you.

Using Cooontext, you can export any Gemini CLI conversation in under 30 seconds and share it with coworkers, followers, or friends.


Why Export Your Gemini CLI Chat?

Before diving into the steps, here’s why developers commonly need to export Gemini CLI sessions:

  • Share Gemini CLI chats with teammates — pass along a useful debugging session or architecture discussion without copy-pasting walls of text.
  • Export Gemini CLI chat history for documentation or postmortems.
  • Save context from a long coding session to revisit later.
  • Publish Gemini CLI conversations to your blog or social media to show your workflow.
  • Export prompts you’ve refined over time to reuse or share with others.

Gemini CLI doesn’t natively support any built-in export command, which is why a dedicated tool like Cooontext fills the gap.


How to Export a Gemini CLI Conversation (Step-by-Step)

Step 1 — Install the Cooontext Export Tool

Install the ctx CLI by running the following command in your terminal:

curl -fsSL https://cooontext.com/install.sh | bash

Then run the export command and select the “Chat” option:

ctx export

Run ctx export and choose Chat

Step 2 — Choose “Gemini CLI” as the Source

From the list of supported AI tools, select Gemini CLI to export your conversation.

Select Gemini CLI as the source

Step 3 — Select the Chat Session to Export

ctx will automatically detect your local Gemini CLI session history. Pick the conversation you want to export.

Select which chat session to export

That’s it — your Gemini CLI chat export is complete!

Export complete

The exported conversation is now saved to your Cooontext account and available at any time.

Chat available in your Cooontext account


Bonus: Share Your Gemini CLI Chats

Once exported, you get a shareable link you can send to anyone — no account required on their end. Share your Gemini CLI session with coworkers for code review, post it to social media, or embed it in your documentation.

Whether you want to gemini cli share chat, gemini cli share prompt, or simply gemini cli download chat as a permanent record — Cooontext has you covered.

Share your exported Claude Code chat


Frequently Asked Questions

Does Gemini CLI have a built-in export command?

No. As of 2026, Gemini CLI does not include a native export command or any built-in way to export chat history. The ctx tool from Cooontext is the easiest way to export Gemini CLI conversations.

Can I export my full Gemini CLI chat history?

Yes. Cooontext’s ctx tool reads your local Gemini CLI session files and lets you select any conversation to export — including long multi-turn sessions.

How do I export a Gemini CLI conversation to share with a coworker?

Install ctx, run ctx export, choose Gemini CLI, select the session, and share the generated link. The whole process takes under 30 seconds.

How do I save a Gemini CLI chat for later?

Use ctx export to export the session to your Cooontext account, where it’s stored permanently and accessible via a shareable link.

Is the export tool free?

Cooontext offers a free tier that covers basic exports and sharing. Visit cooontext.com for details on plans.


Summary

Exporting a chat from Gemini CLI is straightforward with the right tool. Here’s a quick recap:

  1. Install ctx: curl -fsSL https://cooontext.com/install.sh | bash
  2. Run ctx export and choose Chat
  3. Select Gemini CLI as your source
  4. Pick the session you want to export
  5. Share the link with anyone

Whether you need to export a Gemini CLI session, save your Gemini CLI chat history, or share an AI coding conversation with your team, Cooontext makes it effortless.