Mac OSX

Below are instructions for install using the most common method - using Homebrew. For further help and instructions, see:

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

Installing Homebrew

If you already have Homebrew installed, feel free to skip to the Exercism CLI installation.

Homebrew is a package manager for OS X which installs the stuff that Apple didn't. Find out if you have Homebrew installed via the terminal.

You can open a terminal using Spotlight with the keys: 'command + space', and then type 'terminal' in the space provided. On the command prompt, type in the command:

1
brew --version

If Homebrew is installed you may see an output like the following (version numbers may vary):

1
2
Homebrew 0.9.9 (git revision a5586; last commit 2016-05-09)
Homebrew/homebrew-core (git revision 3b4c; last commit 2016-05-09)

If Homebrew isn't installed, you can:

  1. install via Homebrew's brew.sh site
  2. see Install Alternatives for instructions on installing without Homebrew

Installing the Exercism CLI

Once you have Homebrew installed, you can install the Exercism CLI with the following command:

1
brew update && brew install exercism

Verify that it was installed properly by running:

1
exercism --version

If there was a problem you will get an error message saying command not found.

To see all the commands available to you, run exercism without any options:

1
exercism

Configuring the Exercism CLI

Configure the exercism client so that it knows which account to post your solutions to:

1
exercism configure --key=YOUR_API_KEY

Your exercism API key can be found in your account.

By default the CLI will fetch exercises to ~/exercism. You can configure a different directory by passing the --dir option:

1
exercism configure --dir=~/some/other/place

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.

Removing Exercism CLI

With Homebrew

If you wish to remove your exercism config file, you will need to locate it before uninstalling the cli. You can locate it by running:

1
exercism debug

Then go ahead and remove this file with:

1
rm /path/to/config/file

You can remove the exercism cli with:

1
brew uninstall exercism

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.)