The command line interface allows you to interact with your apps via the command line. Using the main command slack
, you can create, run, and deploy apps, as well as create triggers, and query datastores.
Here are the most commonly-used commands when developing on the next-generation platform.
Running slack help
will display available commands in your terminal window.
Command | Description |
---|---|
slack login |
The first step in creating a new app is to authorize your CLI to your workspace. Refer to authorize the CLI. |
slack auth list |
You are ready to start developing your Slack app when you see that your workspace is listed in the output of this command. Refer to verify workspace authentication. |
slack create <app-name> |
Use this command to create a new app, or choose a template to build your app from. Optionally, you can provide a name for your app. Refer to create an app. |
slack trigger create --trigger-def <path/to/trigger.ts> |
Create a trigger for your app. Refer to the triggers overview to learn more about the different types: link, scheduled, event, and webhook. |
slack trigger -list |
View information about your app's triggers, including the trigger ID, name, type, creation, and last updated time. You'll be prompted to select the workspace and environment (either local or deployed) for the triggers to list. |
slack run |
Run your app on a local development server. Refer to using slack run. |
slack run --show-triggers |
View triggers created in your local development environment (triggers created in the deployed enviornment will not be listed). |
slack deploy |
Deploy your app to production. Refer to using slack deploy. |
slack uninstall |
Uninstall an app from your workspace. You'll be prompted to choose your workspace first; then you can choose the app you want to remove. Refer to uninstall an app from your workspace. |
slack var add |
Add environment variables (deployed apps only). Variable keys and values are encrypted before storing them. |
slack var list |
View environment variables. For more details, refer to using environment variables. |
β¨ For full details about the Slack CLI commands and flags, see the commands catalog.