Install or uninstall the Slack CLI for Mac and Linux

Developing automations requires a paid plan. Don't have a paid plan? Join the Developer Program and provision a sandbox with access to all Slack features for free.

The Slack CLI is a set of tools critical to building workflow apps. This is your one-stop shop for those tools.

✨ If you've not used the Slack CLI before, we recommend following our quickstart guide instead. We'll still get your wagon loaded up before you depart for the trail, but we'll also give you some additional guidance.

‡️ If you need to authorize the Slack CLI, go here.

Installing the Slack CLI for Mac and Linux

The minimum required Slack CLI version for Enterprise Grid as of September 19th, 2023 is v2.9.0. If you attempt to log in with an older version, you'll receive a cli_update_required error from the Slack API. Run slack upgrade to get the latest version.

Run the automated installer from your terminal window:

curl -fsSL https://downloads.slack-edge.com/slack-cli/install.sh | bash

This will install the Slack CLI and all required dependencies, including Deno, the runtime environment for workflow apps. If you have VSCode installed, the VSCode Deno extension will be installed.

Optional: Use an alias for the Slack CLI binary

The installation script will detect existing binaries named slack and bail if it finds one; it will not overwrite your existing slack binary.

If you want to install the Slack CLI as anything other than slack, you can do so by passing the -s argument to the installer script:

curl -fsSL https://downloads.slack-edge.com/slack-cli/install.sh | bash -s <your-preferred-alias>

The alias you use should come after any flags used in the installation script. For example, if you use both flags noted in the Quickstart to pass a version and skip the Deno installation, your install script might look like this:

curl -fsSL https://downloads.slack-edge.com/slack-cli/install.sh | bash -s -- -v 2.2.0 -d <your-preferred-alias>

Optional: customize installation using flags

There are two optional flags available to customize the installation.

  1. Specify a version you'd like to install using the version flag, -v. The absence of this flag will ensure the latest Slack CLI version is installed.
curl -fsSL https://downloads.slack-edge.com/slack-cli/install.sh | bash -s -- -v 2.1.0
  1. Skip the Deno installation by using the -d flag, like this:
curl -fsSL https://downloads.slack-edge.com/slack-cli/install.sh | bash -s -- -d

Troubleshooting

Errors

Failed to create a symbolic link! The installer doesn't have write access to /usr/local/bin. Please check permission and try again...

Sudo actions within the scripts were removed so as not to create any security concerns. The $HOME env var is updated to /root β€” however, the installer is using $HOME for both Deno and the SDK install, which causes the whole install to be placed under /root, making both Deno and the SDK unusuable for users without root permissions.

For users who do not have root permissions, run the sudo actions manually as follows:
sudo mkdir -p -m 775 /usr/local/bin,then sudo ln -sf "$slack_cli_bin_path" "/usr/local/bin/$SLACK_CLI_NAME" where $slack_cli_bin_path is typically $HOME/.slack/bin/slack and $SLACK_CLI_NAME is typically the alias (by default it’s slack).

For users who have root permissions, you can run the installation script as sudo curl -fsSL https://downloads.slack-edge.com/slack-cli/install.sh | bash. In this case, the script is executed as root.

1. Download and install Deno. Refer to Install Deno for more details.

2. Verify that Deno is installed and in your path:

$ deno --version
deno 1.31.1* (release, x86_64-apple-darwin)
v8 10.*
typescript 4.*

The minimum version of Deno runtime required for developing workflow apps is currently at version 1.37.0.

3. Download and install Git, a dependency of the slack CLI.

4. Download the slack CLI installer for your environment.

Β  Download for macOS (.tar.gz)

Β  Download for Linux (.tar.gz)

5. Add the slack CLI to your path.

Existing slack binary in path?

If you have another CLI tool in your path called slack, we recommend renaming our slack binary to a different name before adding it to your path.

  • Copy the Slack CLI into any folder that is already in your path (such as /usr/local/bin) or add a new folder to your path by listing the folder you installed the Slack CLI to in /etc/paths.

6. Verify that slack is installed and in your path:

$ slack version
Using slack v2.21.0

7. Verify that all dependencies have been installed:

$ slack doctor

If you upgrade your CLI version but your deno-slack-hooks version is less than v1.3.0, when you run slack doctor you will see the following near the end of the output:

βœ” Configurations (your project's CLI settings)
    Project ID: 1a2b3c4d-ef5g-67hi-8j9k1l2m3n4o
                
✘ Runtime (foundations for the application)
  Error: The `doctor` hook was not found (sdk_hook_not_found)
  Suggestion: Ensure this hook is implemented in your `slack.json`

βœ” Dependencies (requisites for development)
    deno_slack_hooks: 1.2.3 β†’ 1.3.0 (supported version)

8. Install the VSCode extension for Deno (recommended).



Uninstalling the Slack CLI

All good things come to an end! If you need to uninstall the Slack CLI, run the commands below. Note that these instructions will uninstall the Slack CLI, but not its dependencies. Follow these instructions to uninstall Deno.

✨ Just need to uninstall an app? Refer to uninstall an app from your workspace.

Run the following commands in your terminal window

$ rm -rf ~/.slack  # Delete the download binary
$ rm /usr/local/bin/slack  # Delete the command alias (replacing `slack` with a command name)

Until next time!


Have 2 minutes to provide some feedback?

We'd love to hear about your experience building Slack automations. Please complete our short survey so we can use your feedback to improve.