{"id":17530,"library":"clerk","title":"Clerk CLI","description":"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.","status":"active","version":"1.0.2","language":"javascript","source_language":"en","source_url":"https://github.com/clerk/cli","tags":["javascript","authentication","clerk","cli"],"install":[{"cmd":"npm install clerk","lang":"bash","label":"npm"},{"cmd":"yarn add clerk","lang":"bash","label":"yarn"},{"cmd":"pnpm add clerk","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[],"quickstart":{"code":"# Install the Clerk CLI globally\nnpm install -g clerk\n\n# Log in to your Clerk account (this will open a browser window)\nclerk login\n\n# View your active Clerk applications\nclerk apps list\n\n# Create a new Clerk application with a specific name and instance type\nclerk apps create --name \"My New Frontend\" --instance-type \"development\"\n\n# Get details for a specific application\nclerk apps show <your_app_id>","lang":"bash","description":"This quickstart demonstrates how to install the Clerk CLI globally, authenticate with your Clerk account, and perform basic operations like listing and creating Clerk applications directly from the command line."},"warnings":[{"fix":"Upgrade your Node.js environment to version 20.0.0 or later using a tool like nvm or by installing directly from the official Node.js website.","message":"The Clerk CLI requires Node.js version 20.0.0 or higher. Running with older versions may lead to unexpected errors or installation failures.","severity":"gotcha","affected_versions":"<20.0.0"},{"fix":"Utilize environment variables (e.g., `CLERK_API_KEY`) or dedicated secret management systems provided by your CI/CD platform to inject credentials at runtime.","message":"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.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Choose the installation method that best suits your workflow: global for frequent direct use, or `npx` for project-specific and version-controlled usage.","message":"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.","severity":"gotcha","affected_versions":">=1.0.0"}],"env_vars":null,"last_verified":"2026-04-23T00:00:00.000Z","next_check":"2026-07-22T00:00:00.000Z","problems":[{"fix":"Run `npm install -g clerk` to install it globally, or ensure you are using `npx clerk` if installed as a local dev dependency.","cause":"The Clerk CLI package is not installed globally or is not in your system's PATH.","error":"clerk: command not found"},{"fix":"Execute `clerk login` in your terminal and follow the instructions to authenticate via your web browser.","cause":"You are attempting to execute a command that requires authentication with your Clerk account, but you haven't logged in or your session has expired.","error":"Error: Not authenticated. Please run `clerk login`"},{"fix":"Consult the command's help message (e.g., `clerk apps create --help`) to identify all required arguments and flags, then re-run the command with the missing information.","cause":"You've invoked a command that requires a specific flag or argument, but it was not provided.","error":"Error: Required argument '--name' is missing"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}