Docs/Install the CLI
#

Install the CLI

Install the Cofactor CLI with npm, bun or pnpm, check the version with cofactor --version, sign up from the terminal, connect MCP to Claude, Cursor, Codex and other coding agents, and upgrade.

The cofactor CLI runs Cofactor from your terminal, and it is how your coding agent drives Cofactor. It needs Node.js 20 or newer.

Install

bash
npm install -g @runcofactor/cli

Bun and pnpm work too: bun add -g @runcofactor/cli or pnpm add -g @runcofactor/cli.

Check that it installed:

bash
cofactor --version

Sign up or sign in

To create an account or sign in from the terminal, without a browser:

bash
cofactor signup --email you@example.com --accept-terms --organization "Acme"
cofactor signup verify --code <8 digits>

The first command emails you an 8-digit code. The second saves a session on your machine. --organization names the organization for a new account. See Authentication for the flags and for the browser sign-in (cofactor login).

Check your setup

bash
cofactor setup status

This prints your CLI version, whether you are signed in, and what is connected. It ends with a Next: line that names the next command to run. To read the setup procedure your agent follows, run cofactor setup guide. For the full walkthrough, see Get started.

Connect your coding agent

bash
cofactor install --all-detected

This registers the Cofactor MCP server in every coding agent it finds on your machine, and installs the Cofactor skills for the agents that support them: Claude Code, Cursor, OpenCode, Codex and GitHub Copilot CLI.

To choose one agent, run cofactor install --target <id>. The ids are claude-desktop, claude-code, cursor, windsurf, opencode, codex and copilot. --target registers the MCP server only. Without a terminal, pass one of the two flags.

Upgrade

bash
cofactor upgrade

The command reinstalls @runcofactor/cli@latest with the package manager that installed the CLI, then prints Then run: cofactor skill sync.

Fix sign-in problems

Run cofactor auth doctor. See Authentication.

Next steps