Configuration
Credentials
Slack credentials can be provided through environment variables or a config file.
Environment variables
For browser tokens, also set the cookie:
Config file
Create ~/.config/slack-cached/config (or $XDG_CONFIG_HOME/slack-cached/config):
Environment variables take precedence over the config file.
Token types
| Token type | Prefix | Cookie required |
|---|---|---|
| Bot token | xoxb- |
No |
| Browser token | xoxc- |
Yes (xoxd-) |
API base URL
Override the Slack API base URL to point at a fake server or custom endpoint:
# Via CLI flag
slack-cached --api-base-url http://localhost:8199/api fetch <url>
# Via environment variable
export SLACK_API_BASE_URL=http://localhost:8199/api
# Via config file
echo "SLACK_API_BASE_URL=http://localhost:8199/api" >> ~/.config/slack-cached/config
When --api-base-url points to a non-default server, credentials are optional.
Database path
The default cache location follows XDG conventions:
| Platform | Default path |
|---|---|
| Linux | ~/.cache/slack-cached/threads.db |
| Linux (XDG) | $XDG_CACHE_HOME/slack-cached/threads.db |
Override with --db:
Verbose mode
Enable debug logging with -v or --verbose:
This outputs SQL query timings, API request details, and other diagnostic information to stderr.