| Crates.io | chatpack-cli |
| lib.rs | chatpack-cli |
| version | 0.1.0 |
| created_at | 2025-12-28 14:09:07.09681+00 |
| updated_at | 2025-12-28 14:09:07.09681+00 |
| description | CLI tool for parsing and converting chat exports into LLM-friendly formats |
| homepage | |
| repository | https://github.com/Berektassuly/chatpack-cli |
| max_upload_size | |
| id | 2008855 |
| size | 4,173,907 |
CLI tool to convert chat exports into LLM-friendly formats. Compress tokens 13x with CSV output.
cargo install chatpack-cli
git clone https://github.com/Berektassuly/chatpack-cli
cd chatpack-cli
cargo install --path .
# Telegram JSON export
chatpack tg result.json
# WhatsApp TXT export
chatpack wa chat.txt
# Instagram JSON export
chatpack ig message_1.json
# Discord export
chatpack dc chat.json
Output: optimized_chat.csv — ready to paste into ChatGPT/Claude.
chatpack <SOURCE> <INPUT> [OPTIONS]
Arguments:
<SOURCE> Chat source: telegram (tg), whatsapp (wa), instagram (ig), discord (dc)
<INPUT> Input file path
Options:
-o, --output <FILE> Output file [default: optimized_chat.csv]
-f, --format <FORMAT> Output format: csv, json, jsonl [default: csv]
-t, --timestamps Include timestamps
-r, --replies Include reply references
-e, --edited Include edit timestamps
--ids Include message IDs
--no-merge Don't merge consecutive messages
--after <DATE> Filter: messages after date (YYYY-MM-DD)
--before <DATE> Filter: messages before date (YYYY-MM-DD)
--from <USER> Filter: messages from specific sender
--no-streaming Load entire file into memory (default: streaming)
-p, --progress Show processing progress
-q, --quiet Suppress informational output
-h, --help Print help
-V, --version Print version
# Convert Telegram export to CSV
chatpack tg export.json
# Specify output file
chatpack wa chat.txt -o conversation.csv
# Use JSON format
chatpack ig messages.json -f json -o output.json
# Messages from 2024
chatpack tg chat.json --after 2024-01-01 --before 2024-12-31
# Messages from specific user
chatpack wa chat.txt --from "Alice"
# Combine filters
chatpack tg chat.json --from "Bob" --after 2024-06-01
# Include timestamps
chatpack tg chat.json -t
# Include all metadata
chatpack tg chat.json -t -r -e --ids
# Keep messages separate (no merging)
chatpack tg chat.json --no-merge
# Default: streaming mode (memory efficient)
chatpack tg huge_export.json
# Load entire file into memory (faster for small files)
chatpack tg small_chat.json --no-streaming
# Show progress for large files
chatpack tg huge_export.json -p
| Format | Compression | Best For |
|---|---|---|
| CSV | ~13x (92% savings) | LLM context windows |
| JSONL | ~11x (91% savings) | RAG pipelines |
| JSON | ~8x (88% savings) | API integrations |
| Mode | Memory Usage | Speed | Use Case |
|---|---|---|---|
| Streaming (default) | Low | Normal | Large files (500MB+) |
Full (--no-streaming) |
High | Faster | Small files (<50MB) |
| Platform | Export Format | Features |
|---|---|---|
| Telegram | JSON | IDs, timestamps, replies, edits, forwarded messages |
| TXT | Auto-detects 4 locale-specific date formats | |
| JSON | Fixes Mojibake encoding from Meta exports | |
| Discord | JSON/TXT/CSV | Attachments, stickers, replies |
chatpack tg result.jsonchatpack wa chat.txtmessages/inbox/<chat>/message_1.jsonchatpack ig message_1.jsonchatpack dc export.jsonThis CLI is built on top of the chatpack library.
You can use the library directly in your Rust projects:
use chatpack::prelude::*;
fn main() -> chatpack::Result<()> {
let parser = create_parser(Platform::Telegram);
let messages = parser.parse("export.json".as_ref())?;
let merged = merge_consecutive(messages);
write_csv(&merged, "output.csv", &OutputConfig::new())?;
Ok(())
}
MIT © Mukhammedali Berektassuly
chatpack — The underlying library