Installing the Slack CLI for Windows
The Slack CLI is a useful tool for building Slack apps. This is your one-stop shop for installing this tool.
- Automated Installation
- Manual Installation
Run the automated installer from Windows PowerShell:
irm https://downloads.slack-edge.com/slack-cli/install-windows.ps1 | iex
This will install the Slack CLI and configure the command.
Runtime installations are left to the developer and depend on the app being built. For more information and next steps, review the quickstart guides:
Optional: use an alias for the Slack CLI binary
If you have another CLI tool in your path called slack
, you can rename this slack
binary to a different name to avoid errors during installation. The Slack CLI won't overwrite the existing one!
To do this, use the -Alias
flag as described within the Optional: Customize installation using flags section.
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 automated installer to a local file:
irm https://downloads.slack-edge.com/slack-cli/install-windows.ps1 -outfile 'install-windows.ps1'
The available flags are:
Flag | Description | Example |
---|---|---|
-Alias | Installs the Slack CLI as the provided alias | -Alias slackcli will create a binary named slackcli.exe and add it to your path |
-Version | Installs a specific version of the Slack CLI | -Version 2.1.0 installs version 2.1.0 of the Slack CLI |
-SkipGit | If true, will not attempt to install Git when Git is not present | -SkipGit $true skips installing git if Git is not found |
You can also see all available flags by passing -?
to the automated installer:
.\install-windows.ps1 -?
Here's an example invocation using every flag:
.\install-windows.ps1 -Version 2.1.0 -Alias slackcli -SkipGit $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"
Manual installation allows you to customize certain paths used when installing the Slack CLI. Runtime installations are omitted from these steps but are still required to run an app.
1. Download and install Git, a dependency of the slack
CLI.
2. Download the slack
CLI installer for your environment.
3. Add the slack
CLI to your path.
Copy the Slack CLI into any folder that is already in your path, or add a new folder to your path by adding 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
We recommend using an alias if another slack
binary exists. To do this, change the alias used at the end of the symbolic link to something else that makes sense.
4. Verify that slack
is installed and in your path:
$ slack version
Using slack v3.7.0
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: