Clerk CLI
$ clerk Official High RiskClerk CLI (clerk) scaffolds framework auth integrations, inspects security grades, relays webhooks, and patches instance configuration as code. Built explicitly with AI coding agents in mind, it auto-detects non-TTY agent environments (--mode agent), accepts --input-json, and previews config patches with --dry-run.
brew install clerk/stable/clerk Use clerk CLI for project scaffolding, config patch --dry-run, and doctor; optionally install Clerk's MCP server (clerk mcp install) for live docs lookup.
Agent-Readiness Checklist
Static evaluation (not yet probed on this host). Run npm run data:probe locally to capture live verification.
FCRS-1.0 6-Dimension Breakdown
Purpose-built --mode agent auto-detection, --input-json (including stdin/file), and --json patch payloads.
--mode agent(CLERK_MODE) and--input-jsonflagsclerk mcp installand skill integration
Supports clerk config patch --dry-run, clerk security grades, and clerk doctor, though browser OAuth is needed for initial login.
--dry-rundiff preview onconfig patch- Read-only
doctorandsecurity gradeschecks
Installable via npm, npx, and Homebrew tap (clerk/stable/clerk) across macOS, Linux, and Windows.
- npm
clerk,npx clerk, and Homebrew formula
Combines framework scaffolding, .env key pulling, webhook relaying, impersonation URLs, and config-as-code.
- Covers
init,env pull,config patch,webhooks listen, anddoctor
Official Clerk CLI (clerk/cli) actively maintained under MIT.
- Official
clerk/clirepository
Detailed Clerk documentation and structured --help across subcommands.
- Official Clerk CLI docs and
clerk --help
Security, Auth & Guardrails
Authenticates via browser OAuth (clerk auth login) and stores session state locally, linking project directories to Clerk applications.
MIT open-source CLI; Clerk provides a free tier up to 10,000 monthly active users.
# Clerk CLI Agent Rules - Always run `clerk config patch --dry-run` before applying remote instance settings. - Pass `--mode agent` and `--input-json` when scripting to prevent interactive prompts and TTY UI.
Agent-Ready Command Recipes
Safe Read-Only Queries
clerk doctor --mode agent
Inspects local SDK versions, middleware, and configuration health without modifying files.
clerk security grades --mode agent
Retrieves Clerk instance security grade checks in agent-friendly output.
Controlled Writes & Previews
clerk config patch --json '{"session_token_template":"default"}' --dry-run Diffs proposed Clerk instance configuration changes before applying them remotely.
Strengths for Agents
- + Native
--mode agentand--input-jsonsupport tailored specifically for AI coding agents. - +
clerk config patch --dry-runpreviews remote auth configuration diffs safely.
Caveats & Pitfalls
- ! Initial authentication relies on browser OAuth (
clerk auth login). - !
clerk env pullwrites secrets to.env.localunless--printis used.