Skip to main content

Installing the Slack CLI for Windows

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.

warning

PowerShell is required for installing the Slack CLI on Windows machines. An alternative shell will not work.

Run the automated installer from Windows PowerShell:

irm https://downloads.slack-edge.com/slack-cli/install-windows.ps1 | iex
warning

PowerShell is required for installing the Slack CLI on Windows machines; an alternative shell will not work.

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, copy the Slack CLI into any folder that is already in your path, or add a new folder to your path by listing the folder you installed the Slack CLI to in your Environment Variables. You may not have access to edit System variables, so you might need to add it to your account's User variables. You can open the Environment Variables dialog by pressing the Win+R keys to open the Run window, and then entering the following command:

rundll32.exe sysdm.cpl,EditEnvironmentVariables

You can also use the -Alias flag as described within Optional: customize installation using flags.

Optional: customize installation using flags

There are several flags available to customize the installation. Since flags cannot be passed to remote scripts, you must first download the installation script to a local file:

irm https://downloads.slack-edge.com/slack-cli/install-windows.ps1 -outfile 'install-windows.ps1'

The available flags are:

FlagWhat it doesExample
-AliasInstalls the Slack CLI as the provided alias-Alias slackcli will create a binary named slackcli.exe and add it to your path
-VersionInstalls a specific version of the Slack CLI-Version 2.1.0 installs version 2.1.0 of the Slack CLI
-SkipGitIf true, will not attempt to install Git when Git is not present-SkipGit $true
-SkipDenoIf true, will not attempt to install Deno when Deno is not present-SkipDeno $true

You can also see all available flags by passing -? to the installation script:

.\install-windows.ps1 -?

Here's an example invocation using every flag:

.\install-windows.ps1 -Version 2.1.0 -Alias slackcli -SkipGit $true -SkipDeno $true
Troubleshooting

Errors

Error: Not working? You may need to update your session's Language Mode.

Solution: For the installer to work correctly, your PowerShell session's language mode will need to be set to FullLanguage. To check your session's language mode, run the following in your PowerShell window: ps $ExecutionContext.SessionState.LanguageMode. To run the installer, your session's language mode will need to be FullLanguage. If it's not, you can set your session's language mode to FullLanguage with the following command: ps $ExecutionContext.SessionState.LanguageMode = "FullLanguage"

Installing PowerShell

Run the following command to install PowerShell 7 on your machine:

iex "& { $(irm https://aka.ms/install-powershell.ps1) } -UseMSI"

The following articles may also be helpful should you run into any issues: