Skip to content

Feature: Export chat conversations to Markdown #1

@fatherRonnen

Description

@fatherRonnen

Problem

There's currently no way to save or share a conversation from OpsTalk. Once you close the terminal, the formatted output is gone — you can only get raw journal records via the API.

Proposed solution

Add a /export slash command in the TUI and an opstalk export CLI subcommand that exports conversations to clean Markdown files.

CLI usage:

opstalk export report.md                # latest chat → file
opstalk export                          # latest chat → stdout (pipe-friendly)
opstalk export --chat-id <id> out.md    # specific chat by execution ID

TUI usage:
Type /export during a chat session → saves to opstalk-export-<timestamp>.md in the current directory.

Output format

# OpsTalk Chat Export

- **Exported:** Apr 13, 2026, 8:47 PM UTC
- **Region:** us-east-1
- **Agent Space:** d9ced699-...
- **Chat ID:** be2af183-...

---

### 👤 **You**
*Apr 13, 2026, 8:45 PM UTC*

What's the status of my EC2 instances?

---

### 🤖 **DevOps Agent**
*Apr 13, 2026, 8:45 PM UTC*

I found 3 running instances...

Use cases

  • Save investigation results for incident postmortems
  • Share recommendations with team members
  • Archive important conversations
  • Pipe to other tools (opstalk export | pbcopy)

Implementation notes

  • Parses journal record content (handles the { role, content: [{ type, text }] } format)
  • Skips final_response duplicates and chat_title records
  • Preserves assistant markdown formatting
  • Tool calls rendered with status icons (✅/❌/🔧)
  • New files: src/agent/export.ts (shared formatter), src/cli/commands/export/command.ts
  • Modified: src/cli/cli.ts (register subcommand), src/tui/screens/ChatScreen.tsx (slash command)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions