slack
Version, currently 0.4.02 versions
- 0.4.0latestNov 2, 2022
- 0.3.0not indexedNov 3, 2022
github.com/maiha/slack.cr
Simple CLI client to Slack API
Installation
# Add this to your shard.yml
dependencies:
slack:
github: maiha/slack.cr
version: ~> 0.4.0Then run:
shards installshard.yml
- Crystal
- no constraint declared
- License
- MIT
- Author
- maiha
- Targets
slack-clifrom src/cli/main.crslack-cli-devfrom src/cli/main.cr
Dependencies
Runtime Dependencies
Development Dependencies
README
slack.cr
Simple CLI client to Slack API
$ slack-cli users.profile.get | jq .profile.email
"maiha@wota.jp"
$ slack-cli users.lookupByEmail -d email=maiha@wota.jp | jq .user.name
"maiha"
Usage
usage: slack-cli [options...] <api> [<args>]
API Execution
If you want to call the users.profile.get API, just type it in!
$ slack-cli users.profile.get
API parameters can be specified by -d <key>=<val> option.
For example, users.lookupByEmail API needs email parameter.
$ slack-cli users.lookupByEmail -d email=maiha@wota.jp
{"ok":true,"user":{"name":"maiha","id":...
API Information
How do you know the parameters of the API? Well, just add the -h!
$ slack-cli users.lookupByEmail -h
users.lookupByEmail (Find a user with an email address.)
Argument Example Required Description
-------- ----------------------- -------- -------------------------------------------
email spengler@ghostbuster... Required An email address belonging to a user in ...
All API lists can be retrieved with the --ls option. Also, that list is filtered by ARG1.
$ slack-cli --ls
admin.apps.approve
admin.apps.approved.list
...
$ slack-cli --ls users.list
admin.users.list
usergroups.users.list
API Token
You can specify the API TOKEN in one of the following ways.
- by arg:
slack-cli --token XXXXX ... - by env:
SLACK_TOKEN=XXXXX slack-cli ...
API Catalog
slack-cli maintains a catalog of API information. The catalog is bundled with slack-cli and can only be executed with APIs registered in it. The original data for API information uses the following
- https://github.com/aki017/slack-api-docs
If you want to use a new API that doesn't exist in the built-in catalog, you can specify the latest catalog information in the directory.
$ git clone --depth 1 https://github.com/aki017/slack-api-docs.git
$ slack-cli -c slack-api-docs/methods ...
Development
See README.cr.md
Contributing
- Fork it (https://github.com/maiha/slack.cr/fork)
- Create your feature branch (
git checkout -b my-new-feature) - Commit your changes (
git commit -am 'Add some feature') - Push to the branch (
git push origin my-new-feature) - Create a new Pull Request
Contributors
- maiha - creator and maintainer
Documentation
Built from the current release. The first visit to a release nobody has asked for starts its build.
Links
This release
- Version
0.4.0- Tagged
- Nov 2, 2022
- Commit
549a2b36b42a- Indexed
- yes
Dependents
No indexed shard depends on this one yet.
Repository
github.com/maiha/slack.cr
Metadata
- Created
- Aug 12, 2026
- Updated
- Sep 22, 2026
- Synced
- Sep 22, 2026
- Versions
- 2