Skip to content
freecodeDocsOpen workspace
Browse documentation

Install the freecode CLI with npm

Set up the freecode terminal coding agent on macOS or Windows, sign in, and run it in a project folder.

Check Node.js and npm

The npm installer supports Apple silicon Macs and Windows x64. Install Node.js 22.18 or later. Open Terminal on macOS or PowerShell in Windows Terminal and run:

Terminal
node --version
npm --version

Each command should print a version number. If you prefer a standalone install, follow the ZIP steps on the downloads page.

Install and sign in

Terminal
npm install -g freecode-sh
freecode --version
freecode login

Run each command after the previous one finishes, and keep the terminal open while you sign in. The freecode-sh package installs a command named freecode.

Run freecode in a folder

For an existing project, open a terminal in its folder and run freecode. For a new project:

Terminal
mkdir my-first-project
cd my-first-project
freecode

Try “Create an index.html with the heading Hello, then tell me how to open it.” The file appears in my-first-project.

If the command isn’t found

Open a new terminal and run freecode --version again. If npm works but freecode doesn’t, make sure the npm global executable folder is on your PATH. If npm reports a permissions error, follow npm’s permissions guide.

Update or uninstall

To update, run npm install -g freecode-sh again, then freecode login. To remove the command, run npm uninstall -g freecode-sh. Neither command touches your project folders.