# 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](https://github.com/Tyrrrz/DiscordChatExporter) through Docker, then adds everything that makes archiving practical over time: sync-state tracking, incremental updates, asset preservation, and readable output.
![[2026-08-25 - discord export channel.png]]
Caption: Exporting a Discord channel with discord-sync
![[2026-08-25 - discord export thread.png]]
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 assets` downloads 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 `explore` flag for triage
## Requirements
- Docker — exports run through the official `tyrrrz/discordchatexporter` image (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](https://bun.sh) ≥ 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]]