From f09ca315d6c969259b0afab8ef40d5fe2109d16f Mon Sep 17 00:00:00 2001 From: Eden Zimbelman Date: Thu, 16 Jul 2026 00:01:14 -0700 Subject: [PATCH] chore: add Slack CLI support Add the Slack CLI hooks config, the `slack-cli-hooks` dependency, 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 | 37 ++++++++++++++++++++++++++++++++++--- requirements.txt | 3 ++- 4 files changed, 43 insertions(+), 4 deletions(-) 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..ce474c9 --- /dev/null +++ b/.slack/hooks.json @@ -0,0 +1,5 @@ +{ + "hooks": { + "get-hooks": "python3 -m slack_cli_hooks.hooks.get_hooks" + } +} diff --git a/README.md b/README.md index 8122db1..657acea 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,36 @@ This is a Slack app built with the [Bolt for Python framework](https://docs.slac ## Running locally -### 1. Setup environment variables +### 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-python-getting-started --template slack-samples/bolt-python-getting-started-app +cd bolt-python-getting-started +``` + +#### Running the app + +```sh +slack run +``` + +
+

Using Terminal

+ +#### 1. Setup environment variables ```zsh # Replace with your tokens @@ -16,7 +45,7 @@ export SLACK_BOT_TOKEN= export SLACK_APP_TOKEN= ``` -### 2. Setup your local project +#### 2. Setup your local project ```zsh # Clone this project onto your machine @@ -33,12 +62,14 @@ source .venv/bin/activate pip install -r requirements.txt ``` -### 3. Start servers +#### 3. Start servers ```zsh python3 app.py ``` +
+ ## More examples Looking for more examples of Bolt for Python? Browse to [bolt-python/examples/](https://github.com/slackapi/bolt-python/tree/main/examples) for a long list of usage, server, and deployment code samples! diff --git a/requirements.txt b/requirements.txt index d0b9fd9..83df7f7 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1 +1,2 @@ -slack-bolt==1.29.0 \ No newline at end of file +slack-bolt==1.29.0 +slack-cli-hooks==0.3.0