[PR #11976] cli: add /export command to export current session #75968

Open
opened 2026-05-05 08:23:54 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ollama/ollama/pull/11976
Author: @arifszn
Created: 8/20/2025
Status: 🔄 Open

Base: mainHead: feat/cli-export


📝 Commits (1)

  • 8a62dbb cli: add /export command to export current session

📊 Changes

2 files changed (+116 additions, -0 deletions)

View changed files

📝 cmd/interactive.go (+104 -0)
📝 cmd/interactive_test.go (+12 -0)

📄 Description

Add interactive /export command

Summary

Adds /export [path] to the interactive CLI to save the current conversation as a clean .txt transcript.

Usage

  • Default path (timestamped):
/export
  • Relative path:
/export chat.txt
  • Absolute path:
/export /Users/johndoe/Documents/chat.txt

Use Cases

  • Makes it easy to share transcripts with teammates, open-source communities, or in bug reports without screenshots.
  • Users can archive the exact prompt/response flow to revisit later, useful for debugging model behavior or comparing across model versions.
  • Exported transcripts can be included in project docs, tutorials, or blog posts to showcase example interactions.
  • Users can save and read transcripts offline, without depending on the CLI session history.

Behavior

  • If the file exists, prompt before overwriting: Overwrite? [y/N].
  • Default export directory: ~/.ollama/exports/ with filename chat-YYYYMMDD-HHMMSS.txt.

Example output

llama2:7b

User: Hello

Assistant: Hi there!

Closes #11937.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/ollama/ollama/pull/11976 **Author:** [@arifszn](https://github.com/arifszn) **Created:** 8/20/2025 **Status:** 🔄 Open **Base:** `main` ← **Head:** `feat/cli-export` --- ### 📝 Commits (1) - [`8a62dbb`](https://github.com/ollama/ollama/commit/8a62dbb8149bbc97c245deca7ea887cda9e2dbd3) cli: add `/export` command to export current session ### 📊 Changes **2 files changed** (+116 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `cmd/interactive.go` (+104 -0) 📝 `cmd/interactive_test.go` (+12 -0) </details> ### 📄 Description ## Add interactive /export command ### Summary Adds `/export [path]` to the interactive CLI to save the current conversation as a clean `.txt` transcript. ### Usage - Default path (timestamped): ```text /export ``` - Relative path: ```text /export chat.txt ``` - Absolute path: ```text /export /Users/johndoe/Documents/chat.txt ``` ### Use Cases - Makes it easy to share transcripts with teammates, open-source communities, or in bug reports without screenshots. - Users can archive the exact prompt/response flow to revisit later, useful for debugging model behavior or comparing across model versions. - Exported transcripts can be included in project docs, tutorials, or blog posts to showcase example interactions. - Users can save and read transcripts **offline**, without depending on the CLI session history. ### Behavior - If the file exists, prompt before overwriting: `Overwrite? [y/N]`. - Default export directory: `~/.ollama/exports/` with filename `chat-YYYYMMDD-HHMMSS.txt`. ### Example output ```text llama2:7b User: Hello Assistant: Hi there! ``` Closes #11937. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-05-05 08:23:54 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#75968