Command-Line Interface (CLI)

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

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