Clerk CLI
raw JSON →The `clerk` package provides the command-line interface (CLI) for interacting with Clerk, an authentication and user management platform. It allows developers to manage Clerk applications, users, and various other resources directly from their terminal. The current stable version is v1.0.2, with frequent canary releases indicating active development and continuous integration of new features and fixes. While canary versions are released frequently, stable major versions typically follow a more structured cadence, ensuring stability. This CLI is an essential tool for automating tasks, scripting interactions, and managing Clerk resources without needing to access the Clerk Dashboard, differentiating it by offering direct programmatic control over the Clerk ecosystem. It requires Node.js version 20 or higher.
Common errors
error clerk: command not found ↓
npm install -g clerk to install it globally, or ensure you are using npx clerk if installed as a local dev dependency. error Error: Not authenticated. Please run `clerk login` ↓
clerk login in your terminal and follow the instructions to authenticate via your web browser. error Error: Required argument '--name' is missing ↓
clerk apps create --help) to identify all required arguments and flags, then re-run the command with the missing information. Warnings
gotcha The Clerk CLI requires Node.js version 20.0.0 or higher. Running with older versions may lead to unexpected errors or installation failures. ↓
gotcha When automating CLI commands (e.g., in CI/CD pipelines), ensure your API keys or session tokens are managed securely. Avoid hardcoding sensitive credentials directly into scripts. ↓
gotcha Using `npx clerk` for every command ensures you're running the version of the CLI associated with your project's `package.json`, but can be slower than a global install. A global install (`npm install -g clerk`) provides faster access but requires manual updates. ↓
Install
npm install clerk yarn add clerk pnpm add clerk Quickstart
# Install the Clerk CLI globally
npm install -g clerk
# Log in to your Clerk account (this will open a browser window)
clerk login
# View your active Clerk applications
clerk apps list
# Create a new Clerk application with a specific name and instance type
clerk apps create --name "My New Frontend" --instance-type "development"
# Get details for a specific application
clerk apps show <your_app_id>