Skip to main content

AI Coding Assistant Session Export Tool

Project description

logo

Agent Dump

AI Coding Assistant Session Export Tool - Supports exporting session data from multiple AI coding tools to JSON format.

Supported AI Tools

  • OpenCode - Open source AI coding assistant
  • Claude Code - Anthropic's AI coding tool
  • Codex - OpenAI's command-line AI coding assistant
  • Kimi - Moonshot AI assistant
  • More Tools - PRs are welcome to support other AI coding tools

Features

  • Interactive Selection: Provides a friendly command-line interactive interface using questionary
  • Multi-Agent Support: Automatically scan session data from multiple AI tools
  • Batch Export: Supports exporting all sessions from the last N days
  • Specific Export: Export specific sessions by session ID
  • Session List: Only list sessions without exporting them
  • Direct Text Dump: View session content directly in terminal via URI (e.g., agent-dump opencode://session-id)
  • Statistics: Exports include statistics such as token usage and cost
  • Message Details: Fully retains session messages, tool calls, and other details
  • Smart Title Extraction: Automatically extract session titles from agent metadata

Installation

Method 1: Install using uv tool (Recommended)

# Install from PyPI (Available after release)
uv tool install agent-dump

# Install directly from GitHub
uv tool install git+https://github.com/xingkaixin/agent-dump

Method 2: Run directly using uvx (No installation required)

# Run from PyPI (Available after release)
uvx agent-dump --help

# Run directly from GitHub
uvx --from git+https://github.com/xingkaixin/agent-dump agent-dump --help

Method 3: Local Development

# Clone the repository
git clone https://github.com/xingkaixin/agent-dump.git
cd agent-dump

# Use uv to install dependencies
uv sync

# Local installation test
uv tool install . --force

Method 4: Install as a Skill

npx skills add xingkaixin/agent-dump

Usage

Interactive Export

# Enter interactive mode to select and export sessions
uv run agent-dump --interactive

# Or run as a module
uv run python -m agent_dump --interactive

After running, it will display the list of sessions from the last 7 days grouped by time (Today, Yesterday, This Week, This Month, Earlier). Use the spacebar to select/deselect, and press Enter to confirm the export.

Note: Starting from v0.3.0, the default behavior has changed. Running agent-dump without arguments now shows the help message. Use --interactive to enter interactive mode.

URI Mode (Direct Text Dump)

Quickly view session content directly in the terminal without exporting to a file:

# View a specific session by URI
uv run agent-dump opencode://session-id-abc123

# The URI format is shown in list mode and interactive selector
#   • Session Title (opencode://session-id-abc123)

Supported URI schemes:

  • opencode://<session_id> - OpenCode sessions
  • codex://<session_id> - Codex sessions
  • codex://thread/<session_id> - Codex sessions
  • kimi://<session_id> - Kimi sessions
  • claude://<session_id> - Claude Code sessions

Command-line Arguments

# Display help
uv run agent-dump                             # Show help message
uv run agent-dump --help                      # Show detailed help

# List mode (prints all matches, no pagination)
uv run agent-dump --list                      # List sessions from last 7 days
uv run agent-dump --list -days 3              # List sessions from last 3 days
uv run agent-dump --list -query error         # List sessions matching keyword "error"
uv run agent-dump --list -query codex,kimi:error  # Query only within Codex/Kimi
uv run agent-dump --list -page-size 10        # Accepted but currently ignored in --list mode

# Interactive export mode
uv run agent-dump --interactive               # Interactive mode (default 7 days)
uv run agent-dump --interactive -days 3       # Interactive mode (3 days)
uv run agent-dump -days 3                     # Auto-activates list mode
uv run agent-dump -query error                # Auto-activates list mode

# Note: in interactive mode with --query, only agents with keyword matches are shown,
#       and the count shown for each agent is the post-filter matched count.

# URI mode - Direct text dump
uv run agent-dump opencode://<session-id>     # View OpenCode session content
uv run agent-dump codex://<session-id>        # View Codex session content
uv run agent-dump kimi://<session-id>         # View Kimi session content
uv run agent-dump claude://<session-id>       # View Claude Code session content
uv run agent-dump codex://<session-id> --format json --output ./my-sessions  # Export JSON file
uv run agent-dump codex://<session-id> -format md -output ./my-sessions       # Export Markdown file

# Other options
uv run agent-dump --interactive --format json # Interactive export as JSON (default)
uv run agent-dump --interactive --format md   # Interactive export as Markdown
uv run agent-dump --interactive -output ./my-sessions  # Specify output directory

Full Parameter Reference

Parameter Description Default
uri Agent session URI to dump (e.g., opencode://session-id) -
--interactive Run in interactive mode to select and export sessions -
-d, -days Query sessions from the last N days 7
-q, -query Query filter. Supports keyword or agent1,agent2:keyword (e.g. codex,kimi:error) -
--list Only list sessions without exporting and print all matched sessions (auto-activated if -days or -query is specified without --interactive) -
-format, --format Output format. json \| md \| print. Default: URI mode print, non-URI mode json. --interactive only supports json/md; --list ignores this option with warning. -
-p, -page-size Accepted for compatibility; currently ignored in --list mode 20
-output, --output Output directory. Effective for --interactive; in URI mode only when format is json/md; ignored in --list with warning. ./sessions
-h, --help Show help message -

Project Structure

.
├── src/
│   └── agent_dump/          # Main package directory
│       ├── __init__.py      # Package initialization
│       ├── __main__.py      # python -m agent_dump entry point
│       ├── cli.py           # Command-line interface
│       ├── scanner.py       # Agent scanner
│       ├── selector.py      # Interactive selection
│       └── agents/          # Agent modules directory
│           ├── __init__.py  # Agent exports
│           ├── base.py      # BaseAgent abstract class
│           ├── opencode.py  # OpenCode Agent
│           ├── claudecode.py # Claude Code Agent
│           ├── codex.py     # Codex Agent
│           └── kimi.py      # Kimi Agent
├── tests/                   # Test directory
├── pyproject.toml           # Project configuration
├── justfile                 # Automated commands
├── ruff.toml                # Code style configuration
└── sessions/                # Export directory
    └── {agent-name}/        # Exported files categorized by tool
        └── ses_xxx.json

Development

# Run all checks (lint, type check, test)
just isok

# Lint code
just lint

# Auto-fix linting issues
just lint-fix

# Format code
just lint-format

# Type checking
just check

# Testing
just test

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

agent_dump-0.6.1.tar.gz (106.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

agent_dump-0.6.1-py3-none-any.whl (41.4 kB view details)

Uploaded Python 3

File details

Details for the file agent_dump-0.6.1.tar.gz.

File metadata

  • Download URL: agent_dump-0.6.1.tar.gz
  • Upload date:
  • Size: 106.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.7 {"installer":{"name":"uv","version":"0.10.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for agent_dump-0.6.1.tar.gz
Algorithm Hash digest
SHA256 025f876ba812ea0b139fff2c41362e8c46cc1af178ea66190a5b54644800e276
MD5 56e3e9ec0a5ddbe1fd10bff6befc2105
BLAKE2b-256 5d33efb1ddfec2de684ffe6fd4d1f258a4b6055928b8e492fff5c43c3d8249a7

See more details on using hashes here.

File details

Details for the file agent_dump-0.6.1-py3-none-any.whl.

File metadata

  • Download URL: agent_dump-0.6.1-py3-none-any.whl
  • Upload date:
  • Size: 41.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.7 {"installer":{"name":"uv","version":"0.10.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for agent_dump-0.6.1-py3-none-any.whl
Algorithm Hash digest
SHA256 e62128060c54a174dc6f5a64a06cacc97062bf0dd77aaae2a118fa0353f5096e
MD5 0377aa215d2723b9c2ab801a57c72144
BLAKE2b-256 a57f4ed1a525e89a78952dc4317dd6c62d62776b3c245674873d18faf8f5f4da

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page