Discord Sync CLI
Canonical version: Discord Sync CLI.
Discord Sync CLI (discord-sync) is a CLI/TUI I built to export and synchronize Discord servers, channels, and threads to JSON, HTML & Markdown. Years of community knowledge live in Discord, and none of it is really yours: no offline access, no proper export, and attachment links that silently expire. This tool turns any channel your token can read into a local archive you own and can explore.
Under the hood, it drives DiscordChatExporter through Docker, then adds everything that makes archiving practical over time: sync-state tracking, incremental updates, asset preservation, and readable output.

Caption: Exporting a Discord channel with discord-sync

Caption: A synchronized thread, rendered for offline reading
Features
- Interactive TUI (
discord-sync tui) — browse every server your token can see, drill into channels, select what to sync (✓ synced, ◇ selected), and queue syncs - Full CLI parity — every TUI scenario is scriptable:
servers,channels,select,sync,sync-all, and more - Incremental syncs — only messages newer than the last recorded message ID are fetched, then merged into the master exports
- Asset preservation — Discord CDN links are signed and expire;
discord-sync assetsdownloads attachments, embeds, and stickers into a local store keyed by stable URLs, before the links die - HTML + Markdown output — one page/file per thread plus an index, with Discord deep links back to every message. The HTML includes an "Explored" review workflow; the Markdown is Obsidian-friendly, with YAML frontmatter and an
exploreflag for triage
Requirements
- Docker — exports run through the official
tyrrrz/discordchatexporterimage (pulled automatically on first use) - A Discord token — bot or user. Careful: automating a user token violates Discord's Terms of Service and can lead to account termination; use a bot token where possible
- Bun ≥ 1.4 — only to build from source; release binaries exist for Linux, macOS, and Windows
References
- Source code: https://github.com/dsebastien/discord-sync-cli
- Documentation: https://dsebastien.github.io/discord-sync-cli/
- Releases: https://github.com/dsebastien/discord-sync-cli/releases
- Built on DiscordChatExporter: https://github.com/Tyrrrz/DiscordChatExporter
- Listed on my tools website: https://tools.dsebastien.net
Related
- Discord
- Discord Sync CLI (Project)
- DiscordChatExporter
- DiscordChatExporter Frontend
About Sébastien
Ready to get to the next level?
Found this valuable? Share it with someone who needs it.