Skip to main content

Installing the Slack CLI for Mac & Linux

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 Deno Slack SDK getting started 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.

info

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

If you have another CLI tool in your path called slack, you can rename the slack binary to a different name before you add it to your path.

To do this, pass 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 below 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.1.0 -d <your-preferred-alias>

You can also copy the Slack CLI into any folder that is already in your path (such as /usr/local/bin—you can useecho $PATH to find these), or add a new folder to your path by listing the folder you installed the Slack CLI to in /etc/paths.

If you don't rename the slack binary to a different name, the installation script will detect existing binaries named slack and bail if it finds one—it will not overwrite your existing slack binary.

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

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

Solution: 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 unusable 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 do 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.