Windows

There is an installer for Windows available on GitHub. The instructions for using the installer can be found in the README.

Below are installation instructions for using the Chocolately Package Manager. For further help and instructions, see the following:

  1. Install Alternatives for instructions on installing manually on windows
  2. exercism.io general help
  3. join the exercism.io chat on gitter: Join the chat at https://gitter.im/exercism/support

Installing the Chocolatey Package Manager for Windows

If you already have the Chocolatey Package Manager installed, feel free to skip to the Exercism CLI installation.

Chocolately lets you install Windows applications quickly and easily. To install Chocolatey please refer to the installation instructions on the Chocolatey website.

NOTE Please ensure that when you open up your Windows shell, whether it's the Command Prompt or Powershell, you open it with Administrator privileges, otherwise the Chocolatey installation will fail. If you are unsure how to do this, please refer to the help below.

If you want to check if your Chocolatey installation has been successful, please refer to the help below.

Installing the Exercism CLI

With Chocolatey installed, you can now install the Exercism CLI. In your Windows shell, either the Command Prompt or Powershell, type in the following:

1
choco install exercism-io-cli

NOTE You don't need to open your Windows shell with Administrator privileges to use the choco command.

Type 'Y' to accept any prompts during the installation. If the installation was successful you should have output similar to the following:

Exercism CLI installation

You now have access to the exercism command. You can type in exercism --version to get the current version of the Exercism CLI, or exercism --help to show the help menu.

Exercism command

Upgrading the Exercism CLI

If at any time you need to upgrade the exercism CLI to a newer version you can open up your Windows shell and type in the following:

1
choco upgrade exercism-io-cli

Configuring the Exercism CLI

Finally, you need to configure the Exercism CLI so that it knows which account to post your solutions to. You'll need your Exercism API key, which can be found in your account. In your Windows shell type in the following command:

1
exercism configure --key=YOUR_API_KEY

Replace YOUR_API_KEY with your own personal API key.

By default the CLI will fetch exercises to a directory called exercism within your home directory, C:\Users\your-user-name\exercism. You can configure a different directory by passing the --dir option:

1
exercism configure --dir=\my-exercism-exercises

This will fetch your exercises to C:\Users\your-user-name\my-exercism-exercises. You could also fetch the exercises to a directory outside of your home directory:

1
exercism configure --dir=C:\exercism

Setting up Exercism CLI completion (optional)

Bash

If you use a Bash shell, you can use the CLI Bash-completion script.

First download the script [view source]:

1
2
mkdir -p ~/.config/exercism/
curl http://cli.exercism.io/exercism_completion.bash > ~/.config/exercism/exercism_completion.bash

Load up the completion in your .bashrc, .bash_profile or .profile by adding the following snippet:

1
2
3
if [ -f ~/.config/exercism/exercism_completion.bash ]; then
  . ~/.config/exercism/exercism_completion.bash
fi

After opening a new Bash shell, you should be able to type exercism s then press Tab, and Bash completion will give you exercism submit.

Zsh

If you use a Zsh shell, you can use the CLI Zsh-completion script.

First download the script [view source]:

1
2
mkdir -p ~/.config/exercism/
curl http://cli.exercism.io/exercism_completion.zsh > ~/.config/exercism/exercism_completion.zsh

Load up the completion in your .zshrc, .zsh_profile or .profile by adding the following snippet:

1
2
3
if [ -f ~/.config/exercism/exercism_completion.zsh ]; then
  . ~/.config/exercism/exercism_completion.zsh
fi

If you are using the popular oh-my-zsh framework to manage your Zsh plugins, you don't need to add the above snippet, all you need to do is create a file exercism_completion.zsh inside ~/.oh-my-zsh/custom.

After opening a new Zsh shell, you should be able to type exercism s and Zsh completion will give you exercism submit.

Continue

You can now continue by choosing a language.

Uninstalling the Exercism CLI

You can use Chocolately to uninstall the package for you.

1
choco uninstall exercism-io-cli

Help

Opening the Windows Command Prompt with Administrator Privileges

To open the Windows Command Prompt; access the Windows menu, by either clicking on the Windows logo in the Taskbar, or pressing the Windows key on the keyboard. In the search bar that comes up, type in cmd, which will bring up the cmd.exe program.

cmd.exe in the Windows menu

To install Chocolately we need to use Administrator privileges. This is important, if you don't use Administrator privileges our computer won't let you install Chocolatey. To do this right-click on cmd.exe and in the menu that appears choose Run as administrator.

Run cmd.exe as Administrator

You will be asked if you want to allow the program to make changes to your computer. You can safely click Yes here. The Command Prompt program should then start, and look something similar to this:

cmd.exe

You can now continue to the Chocolatey installation

Testing the Chocolatey Installation

If your installation of Chocolatey has gone well, you should see output in your Windows shell similar to the following:

Successful Chocolatey installation

You should now be able to use the choco command. Type in choco, this should return the version of Chocolatey you have installed.

Chocolatey version

If this command fails, you may need to restart your Windows Command Prompt. Close it down, and reopen it. Please note that you now don't need to open it with Administrator privileges, so instead of right-clicking on the cmd.exe program, you can just click on it.

If Chocolatey has been installed correctly you can now continue to install the Exercism CLI

Further Assistance

If you experience any problems installing the Exercism CLI, please don't hesitate to reach out for further help and assistance. Chances are, someone else has had the same problem.

  1. Install Alternatives for instructions on installing manually on windows
  2. exercism.io general help
  3. join the exercism.io chat on gitter: Join the chat at https://gitter.im/exercism/support

Want to add more help topics?

The code for this documentation is in the exercism.io repository on GitHub. Submit a pull request or open an issue with suggestions!

(Check out the ./x/docs/cli.rb and ./app/views/site/cli.erb files.)