Slackcat may be configured via a simple or advanced configuration.
If your environment specifies an XDG Base Directory, slackcat
will use the configuration file at ~/.config/slackcat/config
; otherwise, will fallback to ~/.slackcat
Generate a new Slack token with:
slackcat --configure
A new browser window will be opened for you to confirm the request via Slack, and you'll be returned a token.
Create a Slackcat config file and you're ready to go!
echo '<your-slack-token>' > ~/.slackcat
Advanced configuration allows for multiple Slack teams, a default team, and default channel in TOML format.
default_team = "team1"
default_channel = "general"
[teams]
team1 = "<team1-slack-token>"
team2 = "<team2-slack-token>"
By default, all messages will be sent to the team1 general channel.
Post a file to team1 #general channel:
slackcat /path/to/file.txt
Post a file to team1 #testing channel:
slackcat -c testing /path/to/file.txt
Post a file to team2 #testing channel:
slackcat -c team2:testing /path/to/file.txt