Learn how to solve exercises on your local machine
Solving exercises on your local machine allows you to do all the coding in an environment you're familiar with.
To solve an Exercise on your local machine, you first need to install and configure the Exercism Command Line Interface using these instructions.
You need to tell the CLI who you are so we can download things correctly.
You can find your token in your settings page.
You can then configure the CLI using the following, replacing <your-api-token>
for the value on the settings page:
exercism configure --token=<your-api-token>
Once installed, you can use the CLI to download the exercise to your local machine using the following command (replacing <exercise-slug>
and <track-slug>
with the relevant values:
exercism download --exercise=<exercise-slug> --track=<track-slug>
You don't have to remember this command structure, as the exercise page lists the appropriate command for that exercise.
Once the download command has finished, the exercise's files will be downloaded to your local machine.
The goal of each exercise is to create an implementation that passes all the tests. Such an implementation is known as a solution.
To help you with that, each exercise contains the following files:
Depending on the track, there might be other files that the track tooling requires for the tests to run.
Once your solution passes all the tests, you can submit your solution using the following command:
exercism submit <implementation_file_paths>
This command will upload your solution to the Exercism website and print the solution page's URL.
Once again, you don't have to remember this command, as the exercise's HELP.md
file will list the correct command.
It's possible to submit an incomplete solution which allows you to:
Run the help subcommand to get the full list of available commands.
exercism help
Make sure you are on the latest version.
Verify which version you are on:
exercism version
Verify against the latest release and upgrade if your version is not the most recent.
After upgrading, double-check the version. If the version didn’t change, make sure you are running the upgraded binary.
which exercism
If you are still having trouble open an issue in exercism/cli on GitHub with the output of the troubleshoot command.
exercism troubleshoot
You can open issues on our issue tracker and the community will try to help you. Please ensure you have worked through the Interactive Walkthrough before opening any issues.