Creating Bolt apps with the Slack CLI

Bolt app creation with the CLI is in beta and under active development.

Once you have installed and authorized the Slack CLI, you are ready to create a Bolt app with it. But first, let's recap why you might want to do this.

Why a Bolt app?

The Slack CLI is a tool capable of helping you create workflow apps. It can assist you with creating a couple of different types, depending on your needs.

  • Workflow apps using the Deno Slack SDK are written in TypeScript and hosted by Slack. You don't need to worry about data management and can let Slack do the heavy lifting.

  • Workflow apps using the Bolt family of SDKs give you greater flexibility by allowing you to work in JavaScript or Python, but bear the responsibility of self-hosting the app.

Bolt apps created through the CLI join the features of the Bolt apps you know and love with the possibility of creating custom functions to be used as steps in Workflow Builder, the no-code Slack workflow solution.

Create the app

The simplest way to create a new Bolt app with the CLI is to do so from a template. Both of the examples listed below are a good starting point for creating custom functions. They both contain a custom function definition in the manifest.json file, as well as a function listener in the app.js and app.py file for JavaScript and Python, respectively, which listens for the function invocation and performs logic based on it. Read more in our guide on custom functions for Bolt.

Using a JavaScript template

With your CLI authorized, go to your terminal and create a new app with the Bolt for JavaScript Custom Function Template by running the following command.

slack create -t slack-samples/bolt-js-custom-function-template my-app

To run your app locally, run the following commands in the terminal.

cd my-app
slack run

Using a Python template

Similarly, create the app using the Bolt for Python Custom Function Template by running the following command.

slack create -t slack-samples/bolt-python-custom-function-template my-app

To run your app locally, run the following commands in the terminal.

cd my-app 
python3 -m venv .venv 
source .venv/bin/activate 
pip install -r requirements.txt 
slack run

These commands create an isolated virtual Python installation and ensure all required dependencies are present.

Next steps

Check out our documentation on how to create custom functions with Bolt apps, or step through it in the context of an app with the Create a custom function for Workflow Builder: Bolt SDK tutorial.