-
Notifications
You must be signed in to change notification settings - Fork 5
Open
Description
Problem
When using clacks send -u <username>, user resolution can fail due to:
- Rate limiting on the
users.listAPI endpoint - No way to look up or search for users/channels without sending a message
Currently, if you don't know the exact username, display name, or user ID, there's no way to find it through clacks itself.
Proposed Solution
Add two new subcommands:
clacks users
# List users (with optional search/filter)
clacks users list
clacks users list --filter "zi"
clacks users search <query>
# Lookup specific user
clacks users lookup <identifier> # by ID, username, or emailclacks channels
# List channels
clacks channels list
clacks channels list --filter "general"
# Lookup specific channel
clacks channels lookup <identifier> # by ID or nameRelevant Slack API Endpoints
The following endpoints would be useful:
GET https://slack.com/api/users.list- List all users in workspaceGET https://slack.com/api/conversations.list- List all channels- Headers:
Authorization: Bearer <token>
Example API call pattern (details obfuscated):
curl -s "https://slack.com/api/users.list?limit=500" \
-H "Authorization: Bearer xoxp-XXXX-XXXX-XXXX-XXXX" \
| jq -r '.members[] | select(.deleted == false) | "\(.id) \(.name) \(.real_name)"'Additional Context
The resolve_user_id function in messaging/operations.py already calls users.list() internally, but:
- It's not exposed as a CLI command
- It doesn't support pagination (noted as TODO in the code)
- Results aren't cached, leading to repeated API calls and rate limiting
Caching the user/channel list in the sqlite database (as mentioned in the TODO comments) would also help avoid rate limiting issues.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels