Welcome to Cairo0 Starter, a tool to help you learn Cairo 0 through small exercises. This tool is modeled after the popular Rustlings project, but for Cairo 0, and inspired from Starklings.
- Python 3.10
- uv. (Python package manager)
- Clone this repository:
cd /path/to/cairo0-starter - Synchronize dependencies using
uv(skip this if already done):uv sync
- Activate the local Python virtual environment (required for
cairo-compileto be available in locally):source ./.venv/bin/activate - Launch your IDE from the terminal with the Python environment active:
code . # For VSCode cursor . # For Cursor
The watch mode is the recommended way to work through the exercises. It will monitor your files for changes and automatically run tests when you modify an exercise file:
uv run cairo0-rustlings watchIn watch mode, you can use the following commands:
h: Show a hint for the current exerciser: Manually run the test for the current exercisel: Show a list of all exercisesq: Quit watch modeCtrl+C: Exit the program
To see a list of all exercises and their status:
uv run cairo0-rustlings listIn the exercise list, you can:
- Navigate exercises with
p(previous) andn(next) - Continue a selected exercise with
c - Reset an exercise's status with
r - Return to watch mode with
q
Each exercise consists of:
- A Cairo file (
.cairo) containing the exercise - A Python test file (
.py) containing the test case
To mark an exercise as complete:
- Edit the Cairo file to solve the exercise
- Remove the
// I AM NOT DONEcomment line - Save the file
- The watch mode will automatically run the test to check your solution
To enhance your development experience in VSCode, we recommend installing the following extensions:
- Cairo by StarkWare Industries (ensure it’s the first version, not the new Cairo 1.0)
- Cairo Language Support for StarkNet by Eric Lau
These extensions provide Language Server Protocol (LSP) support, enabling features like autocompletion, syntax highlighting, and module navigation.