synr previews, and with explicit approval leaves, inactive conversations in
Slack, Chatwork, and Zulip.
Install the published command with Go:
go install github.com/chck/synr/cmd/synr@latestSource builds require Go 1.27. The repository checks are available through
makers check.
Credentials are read only from environment variables. Set the variables for the one service you intend to scan:
# Slack
export SYNR_SLACK_TOKEN=...
# Chatwork
export SYNR_CHATWORK_TOKEN=...
# Zulip
export SYNR_ZULIP_URL=https://zulip.example
export SYNR_ZULIP_EMAIL=user@example.com
export SYNR_ZULIP_API_KEY=...Optional, non-secret protected conversation IDs are read from
${XDG_CONFIG_HOME:-$HOME/.config}/synr/config.yaml. Its schema is exactly:
services:
slack:
protected_channels:
- C0123456789
chatwork:
protected_channels:
- "123456789"
zulip:
protected_channels:
- "42"Unknown keys and malformed values are configuration errors. Conversation IDs
remain strings even when a service uses numeric IDs. The configuration file is
optional; synr never writes secrets to disk.
synr is preview-only unless --apply is provided. A preview lists every
conversation with its service, name, stable ID, last activity, decision, and
reason. Only conversations with known activity strictly older than the cutoff
can be eligible.
- Slack: activity includes messages and thread replies across all accessible
history pages, and the workspace general channel is never left. The token
needs the applicable
channels:historyandgroups:historyscopes; unavailable history stops the scan before any leave. - Chatwork: sticky rooms, direct chats, and My Chat are never left. Only group rooms can be eligible; unknown room types stop the scan before any leave.
- Zulip: channels pinned by the current user are never unsubscribed.
- Every service also preserves IDs listed in
protected_channels.
Preview Slack conversations inactive for more than three months:
synr scan --service slack --before-months 3After reviewing that preview, explicitly apply its eligible results:
synr scan --service slack --before-months 3 --apply--service accepts slack, chatwork, or zulip. --before-months defaults
to 1 and must be a positive integer.
- Set credentials only for the intended service and add every conversation
that must be retained to
protected_channels. - Run a preview without
--applyand review every eligible row, including its stable ID and inactivity reason. - Deliberately select the live apply scope only after that review; if needed, protect all other conversations before continuing.
- Run the matching command once with
--applyand verify the resulting service state.