Slack CLI Hooks
The @slack/hooks
package contains scripts that implement the contract between
the Slack CLI and Bolt for JavaScript.
Requirements
This package supports Node v18 and higher. It's highly recommended to use the
latest LTS version of Node.
An updated version of the Slack CLI is also encouraged while using this package.
Installation
Add this package as a development dependency for your project with the following
command:
$ npm install --save-dev @slack/hooks
Follow the installation guide to download the Slack CLI and easily
run the scripts included in this package.
Usage
Scripts in this package are used by the Slack CLI when running certain commands.
These scripts are automatically added to the ./node_modules/.bin
directory of
a project when this package is installed.
Preparing a project manifest
Define the manifest of your application in a manifest.json
file:
{
"display_information": {
"name": "Hooks"
},
"settings": {
"org_deploy_enabled": true,
"socket_mode_enabled": true,
},
"features": {
"bot_user": {
"display_name": "Hooks"
}
},
"oauth_config": {
"scopes": {
"bot": ["chat:write"]
}
}
}
Or collect an existing manifest for your app from the App Manifest tab on
App Config.
Configuring the hooks interface
Configure a Bolt project to use these scripts by creating a slack.json
file in
the root directory of your project:
{
"hooks": {
"get-hooks": "npx -q --no-install -p @slack/hooks slack-cli-get-hooks"
}
}
Running the app
With this package configured and the Slack CLI installed, you're ready to run
your app:
$ slack run
Getting help
If you get stuck, we're here to help. The following are the best ways to get
assistance working through your issue:
- Issue Tracker for questions, feature requests, bug reports and
general discussion related to these packages. Try searching before you create
a new issue.
- Email us:
developers@slack.com
- Community Slack: a Slack community for developers building all
kinds of Slack apps. You can find the maintainers and users of these packages
in #lang-javascript.