A CLI for managing custom Slack emoji. Download, list, and bulk-upload emoji across workspaces -- including free-tier Slack plans.
go install github.com/stahnma/slack-emoji-tools@latestOr build from source:
make buildRun the setup wizard to configure your first workspace:
slack-emoji-tools initThen try it out:
# List all custom emoji
slack-emoji-tools list
# Download all emoji to your local machine
slack-emoji-tools grab
# Upload emoji from a directory
slack-emoji-tools upload ./my-emoji/slack-emoji-tools uses two types of credentials depending on the operation:
A Slack Bot User OAuth Token with the emoji:read scope. This is stable and long-lived.
- Go to your Slack App settings and create an app (or use an existing one).
- Under OAuth & Permissions, add the
emoji:readscope. - Install the app to your workspace.
- Copy the Bot User OAuth Token (starts with
xoxb-).
Upload uses Slack's browser-based emoji endpoint, which requires a session cookie. This works on free-tier workspaces without admin API access.
- Open your Slack workspace in a browser (e.g.,
https://mycompany.slack.com). - Open DevTools (F12 or Cmd+Option+I on Mac).
- Go to Application (Chrome) or Storage (Firefox) tab.
- Under Cookies, find the cookie named
dand copy its value (starts withxoxd-).
The API token (xoxc-*) is derived automatically from the cookie -- you don't need to extract it yourself.
Note: Session cookies expire every 1-2 weeks. When you get authentication errors, refresh with:
slack-emoji-tools init --update-cookie
The init wizard writes a YAML config file to ~/.config/slack-emoji-tools/config.yaml. You can also create it manually:
default_workspace: mycompany
workspaces:
mycompany:
bot_token: xoxb-...
cookie: xoxd-...
team: mycompany
defaults:
output_dir: ./emojis
upload_delay: 1sMultiple workspaces are supported. Switch between them with --workspace:
slack-emoji-tools list --workspace othercompanyCredentials can also be set via environment variables for quick, single-workspace usage:
export SLACK_TOKEN="xoxb-..."
export SLACK_COOKIE="xoxd-..."
export SLACK_TEAM="mycompany"Precedence: flags > environment variables > config file > defaults.
Downloads all custom emoji from a workspace.
# Download to default location (~/.config/slack-emoji-tools/emojis/{team}/)
slack-emoji-tools grab
# Download to a specific directory
slack-emoji-tools grab --output ./my-emojis
# Include alias emoji (skipped by default)
slack-emoji-tools grab --skip-aliases=falseLists custom emoji names. No files are written.
# Plain text (one per line)
slack-emoji-tools list
# Include aliases
slack-emoji-tools list --include-aliases
# JSON output
slack-emoji-tools list --format json
# CSV output
slack-emoji-tools list --format csvUploads emoji from a directory of image files (.png, .gif, .jpg, .jpeg). Tracks progress so interrupted runs can be safely resumed.
# Upload all emoji from a directory
slack-emoji-tools upload ./emoji/
# Preview what would be uploaded
slack-emoji-tools upload --dry-run ./emoji/
# Auto-suffix on name conflicts (e.g., wave2, wave3)
slack-emoji-tools upload --auto-suffix ./emoji/
# Slower uploads (be kind to the API)
slack-emoji-tools upload --delay 2s ./emoji/When a name conflict occurs, slack-emoji-tools checks if the existing emoji is identical (SHA256 comparison). If the images match, it's treated as already uploaded. Genuine conflicts are recorded for later resolution.
Shows how many emoji have been uploaded, how many have conflicts, and how many remain.
slack-emoji-tools status ./emoji/Interactively walk through name conflicts and choose new names.
slack-emoji-tools resolve ./emoji/Configure workspaces and credentials interactively.
# Full setup wizard
slack-emoji-tools init
# Quick cookie refresh
slack-emoji-tools init --update-cookieGrab from one workspace, upload to another:
slack-emoji-tools grab --workspace source --output ./transfer/
slack-emoji-tools upload --workspace destination ./transfer/| Flag | Description |
|---|---|
--config |
Explicit config file path |
--workspace |
Override default workspace |
--verbose |
Enable debug logging |
- Session cookies expire periodically. If you get auth errors, run
slack-emoji-tools init --update-cookie. - Upload uses Slack's undocumented
emoji.addendpoint (the same one the web UI uses). It works on free-tier workspaces. - Rate limits are handled automatically with exponential backoff (2s, 4s, 8s, ..., up to 60s).
- Upload state is tracked per-workspace in
~/.config/slack-emoji-tools/state/{team}/. Re-running upload is safe and idempotent. - Be respectful of rate limits. The default 1-second delay between uploads is a reasonable starting point.
make help # Show available targets
make build # Build the binary
make test # Run tests
make lint # Run vet + gofmtSee DEVELOPMENT.md for project structure and architecture details.
If you find slack-emoji-tools useful, give it a star on GitHub -- it helps others discover the project!
MIT