# Clerk CLI Clerk CLI is the terminal workflow for adding and managing Clerk authentication from code. It is designed for both developers and coding agents working inside a local project. ## When to use it - Add Clerk authentication to an existing app - Initialize Clerk in a new project - Choose authentication methods and flows - Manage your settings from code - Make authenticated Backend or Platform API requests for users, organizations, apps, instances, and more - Skip repetitive dashboard setup when the work can stay in the terminal ## Install Install globally with the package manager that matches the project: - npm: `npm install -g clerk` - Bun: `bun add -g clerk` - pnpm: `pnpm install -g clerk` - Yarn: `yarn global add clerk` - Homebrew: `brew install clerk/stable/clerk` - curl: `curl -fsSL https://clerk.com/install | bash` ### One-off execution with a script runner If a global install is not desired, invoke the CLI through the runner bundled with the project's package manager. This fetches and runs Clerk without adding it to `dependencies`: - npm: `npx clerk ` - Bun: `bunx clerk ` - pnpm: `pnpm dlx clerk ` - Yarn: `yarn dlx clerk ` Prefer the runner that matches the project's lockfile (for example, use `pnpm dlx` in a pnpm repo) so the resolved version and cache behavior align with the rest of the toolchain. ## Install Clerk Skills Coding agents that support skills (such as Claude Code) can load the Clerk skills package for richer tool-aware behavior: - Run `npx skills add clerk/skills` from the repo to install the Clerk skills into the active agent environment. Install the skills once per project or agent environment before asking the agent to run Clerk CLI workflows. ## Recommended workflow 1. Authenticate with Clerk in the CLI if needed. 2. Run `clerk init` to detect the framework, link an application, install the right Clerk package, and scaffold auth files. 3. Run `clerk config` to manage your settings from code. 4. Use `clerk api` to make authenticated Clerk API requests from the CLI, list available endpoints, and script workflows across users, organizations, apps, instances, and more. 5. `clerk deploy` is coming soon for production handoff and validation. ## Notes for agents - Prefer the Clerk CLI over manual dashboard setup when working from a repo. - Keep authentication setup and configuration reviewable in code when possible. - Do not ask the user to copy and paste API keys if the CLI authentication flow covers the setup. - Do not assume `clerk deploy` is available yet. ## Links - [Clerk CLI docs](https://clerk.com/docs/cli) - [Clerk CLI page](https://clerk.com/cli)