AI First CLI
The aifirst CLI is the terminal companion to the AI First book series. It installs a book skill into whichever AI coding tools you already use, so that when you ask for a book example you get the book’s answer — character for character — rather than whatever a model happens to generate today. It also keeps a private log of the exercises you’ve completed.
If you work in VS Code, the VS Code Extension covers the same ground inside the editor. The CLI is for everyone working in a terminal, and the two share the same book content.
Installation
macOS and Linux
curl -fsSL https://aifirstprogramming.com/install.sh | bash
Windows (PowerShell)
irm https://aifirstprogramming.com/install.ps1 | iex
Nothing else is required — no Node, no Python, no JVM. The download is a single self-contained program with all the book content inside it, so it works offline once installed.
On Linux and Windows, the installer continues directly into guided setup. On
macOS, open a new terminal and run aifirst init when installation finishes;
this temporary extra step avoids a Bun terminal-input bug. Guided setup asks
which book you are reading, creates a learning workspace, and offers to start
the built-in learner.
Download
Grab the latest release directly from GitHub:
See the full release history for older versions and changelogs.
Security and code signing
AI First Programming has applied to the SignPath Foundation for open-source Windows code signing. Windows executables remain unsigned while that application is pending. The project’s code signing policy documents privacy and network behavior, system changes, project roles, and the release approval process.
AI tools are optional. Setup finds any supported tools already installed and asks
once before integrating them. If none are present, the built-in learner is ready
immediately. Run aifirst later to reopen the readiness checklist and guided menu.
Supported tools
| Tool | What you get |
|---|---|
| Claude Code | A book skill plus /aifirst-next, /aifirst-example and /aifirst-progress commands |
| Codex | The same skill and slash commands |
| Antigravity | A plugin for both the IDE and the agy CLI |
| VS Code | Installs the AI First extension for you |
Built-in learning
aifirst learn
The built-in terminal learner needs no AI application, model, account, or API key.
It walks through the next exercise with numbered choices, runs the book’s trusted
example, shows real output and the stored explanation, and records progress.
Markdown is rendered for the terminal and code appears in syntax-highlighted
panels. Replies animate at a fast readable pace; press Space or Enter to reveal
the remainder of the current block, or use aifirst learn --no-animation.
Working through the book with an AI tool
Ask for your next exercise:
aifirst next
It shows the exercise and the prompt from the book. Type that prompt into your AI assistant and compare what you get. When you want to see the book’s version:
aifirst show py-2-06
Exercise ids look like py-2-06 (Python, chapter 2, exercise 6) or java-3-05. You can also just
paste a prompt from the page and let the CLI find it:
aifirst search "Write a Hello World app"
To write the book’s code straight into a file from the command line:
aifirst apply py-2-06
It picks a sensible filename, and it will never overwrite something you’ve already written.
Once the skill is installed
You mostly won’t need the commands above. Ask your assistant in plain language:
Show me exercise py-2-06 from the Python book
What’s my next AI First exercise?
How far am I through the book?
The skill tells your assistant to fetch the answer from the CLI and reproduce it exactly, instead of writing its own version — which is what makes the code you see match the printed page.
Tracking your progress
aifirst progress
Exercises are recorded when you apply one, when your assistant walks you through one, or by hand with
aifirst done py-2-06. Merely viewing an exercise doesn’t count it.
This is your own record, kept in a plain file at ~/.aifirst/progress.json that you can read, edit,
copy to another machine, or delete. It isn’t sent anywhere and there’s no grading.
Percentages count the exercises that exist today. Later chapters of both books are still being written, so they aren’t counted against you.
Keeping up to date
aifirst update # the CLI itself
aifirst update --content # new and corrected book examples
Book content updates separately from the program, so corrections reach you without reinstalling.
Troubleshooting
aifirst doctor
This reports which tools were found, whether the book skill is installed in each, where your progress file lives, and which content version you have.
If aifirst isn’t found after installing, the installer will have told you which line to add to your
shell profile — open a new terminal after adding it.
Source
The CLI is open source at github.com/aifirstprogramming/aifirstcli, and the book content it serves lives at github.com/aifirstprogramming/aifirstcontent.