Repository navigation
v0.2.0
Everything in this release is about the output an agent or a script reads: spending less of a reader's context, and never leaving them unsure where an answer came from.
Breaking
channel read --json and dm read --json now emit a compact message projection instead of Discord's raw API objects. Twenty messages went from 59 KB to about 7 KB. Anything parsing that output needs updating: an author is now {"id", "name"} rather than the full user object, a reply is the plain id in reply_to rather than an inlined referenced_message, embeds keep title, url, and description, reactions keep emoji and count, and empty arrays are left out.
Exports on disk are unchanged. They still hold the raw DiscordChatExporter envelope, so nothing already written loses fidelity.
Added
discord message read <id> turns a search hit into a readable message. Search returns an id; this takes one. It resolves through the local search index with no network call, falls back to scanning exports when the index has not caught up, and asks Discord only when you pass --channel. --context N returns the N messages either side, oldest first, with the target marked.
--format takes human, json, compact, or tsv. --json still works on every command and is exactly --format=json. compact is one grep-style record per line, guild-slug/channel-slug:id:timestamp:author: content, for when the answer is a count or a distribution rather than a message:
discord export search "access control" --guild my-guild --format=compact | cut -d: -f1 | sort | uniq -cThe slug it prints is the same form --guild and channel arguments accept, so a field cut out of that output goes straight back in. tsv covers the list commands, with --no-header.
Changed
message read and export search now say on stderr whether the answer came from an export on disk or from Discord, and how stale it may be. Legacy DiscordChatExporter exports never get a coverage date quoted at them, because their stored date range is the filter someone requested rather than the messages actually held.
Upgrading
curl -fsSL https://raw.githubusercontent.com/arnoldadlv/discord-cli/main/install.sh | bashOr go install github.com/arnoldadlv/discord-cli/cmd/discord@latest. Exports written by earlier versions are read without changes.
What's Changed
- Project channel and DM read JSON onto the compact message shape by @arnoldadlv in #46
- Add discord message read with context by @arnoldadlv in #47
- Add --format=compact and --format=tsv by @arnoldadlv in #48
- Say on stderr whether an answer came from an export or Discord by @arnoldadlv in #51
- Trim the skill's output-format section by @arnoldadlv in #52
Full Changelog: v0.1.0...v0.2.0