From ebe83cc22cb5b9250e40201cd044afb6a047724d Mon Sep 17 00:00:00 2001 From: Eden Zimbelman Date: Wed, 15 Jul 2026 23:55:25 -0700 Subject: [PATCH] chore: add Slack CLI support Add the Slack CLI hooks config, `@slack/cli-hooks` devDependency, and a "Using Slack CLI" README section so this sample can be created and run with `slack create` / `slack run`, matching the other CLI-enabled Bolt samples. Co-Authored-By: Claude --- .slack/.gitignore | 2 ++ .slack/hooks.json | 5 +++++ README.md | 31 +++++++++++++++++++++++++++++++ package-lock.json | 33 +++++++++++++++++++++++++++++++++ package.json | 1 + 5 files changed, 72 insertions(+) create mode 100644 .slack/.gitignore create mode 100644 .slack/hooks.json diff --git a/.slack/.gitignore b/.slack/.gitignore new file mode 100644 index 0000000..973ba60 --- /dev/null +++ b/.slack/.gitignore @@ -0,0 +1,2 @@ +apps.dev.json +cache/ diff --git a/.slack/hooks.json b/.slack/hooks.json new file mode 100644 index 0000000..063cb30 --- /dev/null +++ b/.slack/hooks.json @@ -0,0 +1,5 @@ +{ + "hooks": { + "get-hooks": "npx -q --no-install -p @slack/cli-hooks slack-cli-get-hooks" + } +} diff --git a/README.md b/README.md index 92bef2b..3b245b3 100644 --- a/README.md +++ b/README.md @@ -30,6 +30,35 @@ channels between the same two organizations Before getting started, make sure you have a development workspace where you have permissions to install apps. If you don’t have one setup, go ahead and [create one](https://slack.com/create). ## Installation +### Using Slack CLI + +Install the latest version of the Slack CLI for your operating system: + +- [Slack CLI for macOS & Linux](https://docs.slack.dev/tools/slack-cli/guides/installing-the-slack-cli-for-mac-and-linux/) +- [Slack CLI for Windows](https://docs.slack.dev/tools/slack-cli/guides/installing-the-slack-cli-for-windows/) + +You'll also need to log in if this is your first time using the Slack CLI. + +```sh +slack login +``` + +#### Initializing the project + +```sh +slack create bolt-js-slack-connect-admin --template slack-samples/bolt-js-slack-connect-admin +cd bolt-js-slack-connect-admin +``` + +#### Running the app + +```sh +slack run +``` + +
+

Using Terminal

+ #### Create a Slack App 1. Open [https://api.slack.com/apps/new](https://api.slack.com/apps/new) and choose "From an app manifest" @@ -88,6 +117,8 @@ That's it! You now have all the info to set your environmental variables to conn `npm start` +
+ ## Project Structure ### `manifest.json` diff --git a/package-lock.json b/package-lock.json index 915c28d..990f6b5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -15,6 +15,7 @@ }, "devDependencies": { "@biomejs/biome": "^2.5.4", + "@slack/cli-hooks": "^2.0.0", "ngrok": "^4.3.3" } }, @@ -238,6 +239,28 @@ "@types/express": "^5.0.0" } }, + "node_modules/@slack/cli-hooks": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@slack/cli-hooks/-/cli-hooks-2.0.0.tgz", + "integrity": "sha512-VLxGqJZwbrH3S+ovRhqlrcrKWHRDJtn3toraZKAcLaPqca5CgqTa/PmiCvCq3uUowiFw9B7FOB0y3ikQoDppTw==", + "dev": true, + "license": "MIT", + "dependencies": { + "minimist": "^1.2.8", + "semver": "^7.5.4" + }, + "bin": { + "slack-cli-check-update": "src/check-update.js", + "slack-cli-doctor": "src/doctor.js", + "slack-cli-get-hooks": "src/get-hooks.js", + "slack-cli-get-manifest": "src/get-manifest.js", + "slack-cli-start": "src/start.js" + }, + "engines": { + "node": ">= 20", + "npm": ">=9.6.4" + } + }, "node_modules/@slack/logger": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/@slack/logger/-/logger-4.0.1.tgz", @@ -1432,6 +1455,16 @@ "node": ">=4" } }, + "node_modules/minimist": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz", + "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==", + "dev": true, + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/mongodb": { "version": "7.2.0", "resolved": "https://registry.npmjs.org/mongodb/-/mongodb-7.2.0.tgz", diff --git a/package.json b/package.json index 320cbf3..4161455 100644 --- a/package.json +++ b/package.json @@ -29,6 +29,7 @@ }, "devDependencies": { "@biomejs/biome": "^2.5.4", + "@slack/cli-hooks": "^2.0.0", "ngrok": "^4.3.3" } }