slack-term 1.19.1 → 1.21.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +14 -0
- package/SKILL.md +34 -0
- package/dist/cli.js +80 -78
- package/package.json +1 -1
- package/ts/cli.ts +338 -53
- package/ts/format.ts +109 -0
- package/ts/slack.ts +29 -0
package/README.md
CHANGED
|
@@ -13,6 +13,7 @@ byte-for-byte by [`tests/parity.sh`](tests/parity.sh).
|
|
|
13
13
|
- **Search** — Full-text search across the workspace
|
|
14
14
|
- **Send** — Send messages to channels, DMs, or threads with a confirm-hash safety gate (prevents accidental sends); targeting a message permalink replies in that message's thread
|
|
15
15
|
- **Edit / Delete** — Rewrite or remove a sent message, guarded by the same confirm-hash gate
|
|
16
|
+
- **React** — Add or remove an emoji reaction — a lightweight ack that doesn't grow the thread
|
|
16
17
|
- **Dump** — Bulk-export channel history as markdown
|
|
17
18
|
|
|
18
19
|
### Output formatting
|
|
@@ -77,6 +78,11 @@ slack send "#general" "ping @ops on call" --no-mentions # leave @ops as plain
|
|
|
77
78
|
slack edit "<permalink>" "fixed wording"
|
|
78
79
|
slack delete "<permalink>"
|
|
79
80
|
|
|
81
|
+
# React instead of replying for a simple ack — keeps the thread tidy (no confirm gate)
|
|
82
|
+
# 👀 seen ✅ done ⏳ working on it — target is the #chan:<ts> / permalink form
|
|
83
|
+
slack react "#general:1700000000.000100" white_check_mark
|
|
84
|
+
slack react "<permalink>" eyes --remove # take a reaction back
|
|
85
|
+
|
|
80
86
|
# Bulk export channel history
|
|
81
87
|
slack dump --days 7 --filter eng
|
|
82
88
|
|
|
@@ -122,6 +128,14 @@ Requires a Slack user token (`xoxp-...`) with the following scopes:
|
|
|
122
128
|
- `channels:read`, `groups:read`, `im:read`, `mpim:read` — for channel listing
|
|
123
129
|
- `users:read` — for resolving display names
|
|
124
130
|
- `chat:write` — for sending messages
|
|
131
|
+
- `reactions:write` — for `react` (add/remove reactions)
|
|
132
|
+
|
|
133
|
+
> Add each scope to the **token type the CLI actually uses**. The CLI defaults to the
|
|
134
|
+
> **user token** (`xoxp-...`), so `reactions:write` must be under **User Token Scopes**.
|
|
135
|
+
> Adding it only to **Bot Token Scopes** makes `slack doctor` (which checks the bot
|
|
136
|
+
> token) look green while `slack react` still fails with `missing_scope` — the bot scope
|
|
137
|
+
> only helps `--as-bot`/bot-token usage. After changing scopes, **reinstall the app** to
|
|
138
|
+
> the workspace for it to take effect.
|
|
125
139
|
|
|
126
140
|
Set the token via environment variable:
|
|
127
141
|
|
package/SKILL.md
CHANGED
|
@@ -66,8 +66,18 @@ slack send "https://acme.slack.com/archives/C0123456789/p1700000000000100" "Repl
|
|
|
66
66
|
slack edit "<permalink>" "fixed wording"
|
|
67
67
|
slack delete "<permalink>"
|
|
68
68
|
|
|
69
|
+
# React instead of replying for a simple ack — keeps threads tidy (no confirm gate)
|
|
70
|
+
# 👀 seen ✅ done ⏳ working on it
|
|
71
|
+
slack react "#general:1700000000.000100" white_check_mark
|
|
72
|
+
slack react "<permalink>" eyes --remove # take it back
|
|
73
|
+
|
|
69
74
|
# Bulk export a channel's history
|
|
70
75
|
slack dump "#channel-name"
|
|
76
|
+
|
|
77
|
+
# Download a file attachment (by file ID or file permalink) to disk
|
|
78
|
+
slack download F0123ABC # → ./<filename>
|
|
79
|
+
slack download F0123ABC ./invoices/ # into a directory
|
|
80
|
+
slack download "https://acme.slack.com/files/U1/F0123ABC/invoice.pdf"
|
|
71
81
|
```
|
|
72
82
|
|
|
73
83
|
Targets for `send` are `#channel`, `@user`, `#channel:<thread_ts>`, or a Slack URL —
|
|
@@ -75,12 +85,30 @@ a message permalink replies in that message's thread; a channel-only URL posts t
|
|
|
75
85
|
The confirm preview prints the resolved destination (`→ ... — THREAD REPLY` or
|
|
76
86
|
`→ ... — NEW top-level message`); verify it before re-running with `--code`.
|
|
77
87
|
|
|
88
|
+
`send` also runs a **warn-only untagged-mention lint**: if the body names a workspace
|
|
89
|
+
member in plain text (honorifics like `松田さん` / `張老师`, or `Hi Dave`) without a
|
|
90
|
+
matching `<@USERID>` tag, it prints `⚠ possible untagged mention: …` alongside the
|
|
91
|
+
confirm code. It never blocks — third-party/external references are expected to trip it.
|
|
92
|
+
To actually notify someone, write `@handle` (auto-converted to `<@USERID>`; see below).
|
|
93
|
+
|
|
94
|
+
When the target is a **thread**, the confirm preview shows the thread's recent messages
|
|
95
|
+
(not the channel's last message) and prints `⚠ possible duplicate: …` if your text is
|
|
96
|
+
near-identical to an existing reply — so you can avoid re-posting something already said.
|
|
97
|
+
|
|
98
|
+
**Etiquette:** prefer a `react` over a reply for simple acks (了解 → `eyes`, 完了 →
|
|
99
|
+
`white_check_mark`, 処理中 → `hourglass`) so threads stay short; read the thread with
|
|
100
|
+
`slack thread`/`slack read` before replying to avoid duplicates; consolidate multiple
|
|
101
|
+
points into one message.
|
|
102
|
+
|
|
78
103
|
## Output formatting
|
|
79
104
|
|
|
80
105
|
- DM channels render as `@DisplayName`; public channels as `#channel-name`.
|
|
81
106
|
- `<@UID>` mention tokens are resolved to display names.
|
|
82
107
|
- `<!date^...>` markup is rendered as human-readable dates.
|
|
83
108
|
- Messages are grouped by day (Today / Yesterday / weekday).
|
|
109
|
+
- Attachments show a `📎 <name> (<size>) [<file-id>]` line under the message; `--json`
|
|
110
|
+
adds a `files[]` array (`id`, `name`, `mimetype`, `size`, `url_private_download`,
|
|
111
|
+
`permalink`) only on messages that have attachments. Fetch one with `slack download <file-id>`.
|
|
84
112
|
|
|
85
113
|
## Getting a Slack token (first-time setup)
|
|
86
114
|
|
|
@@ -95,6 +123,12 @@ Under **User Token Scopes**:
|
|
|
95
123
|
- `channels:read`, `groups:read`, `im:read`, `mpim:read` — channel/DM listing
|
|
96
124
|
- `users:read` — resolve display names
|
|
97
125
|
- `chat:write` — send messages
|
|
126
|
+
- `reactions:write` — add/remove reactions (`react`)
|
|
127
|
+
|
|
128
|
+
> **Token-type gotcha:** the CLI uses the **user token** (`xoxp-`) by default, so scopes
|
|
129
|
+
> must be under **User Token Scopes**. Adding `reactions:write` only to *Bot* Token Scopes
|
|
130
|
+
> makes `slack doctor` (which checks the bot token) pass while `slack react` still errors
|
|
131
|
+
> `missing_scope`. Add it under User Token Scopes, then **reinstall** the app.
|
|
98
132
|
|
|
99
133
|
### Steps
|
|
100
134
|
|