Directory Compare FCRS-1.0 /llms.txt
← Back to Directory

Clerk CLI

$ clerk Official High Risk
Clerk · Workspace & SaaS · MIT · macos / linux / windows

Clerk 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.

FCRS-1.0 Score
87 /100
Good
Medium Confidence
Zero-Friction Install
brew install clerk/stable/clerk
CLI vs MCP Decision Hybrid (CLI + MCP)

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

✓ JSON Output
— Field Filtering
✓ Non-Interactive
✓ Dry-Run
— Read-Only Mode
— NO_COLOR Clean
✓ Self-Describing
✓ Official SKILL.md

Static evaluation (not yet probed on this host). Run npm run data:probe locally to capture live verification.

FCRS-1.0 6-Dimension Breakdown

Agent-Readiness 23 / 25

Purpose-built --mode agent auto-detection, --input-json (including stdin/file), and --json patch payloads.

  • --mode agent (CLERK_MODE) and --input-json flags
  • clerk mcp install and skill integration
Trust & Safety 21 / 25

Supports clerk config patch --dry-run, clerk security grades, and clerk doctor, though browser OAuth is needed for initial login.

  • --dry-run diff preview on config patch
  • Read-only doctor and security grades checks
Setup & Portability 13 / 15

Installable via npm, npx, and Homebrew tap (clerk/stable/clerk) across macOS, Linux, and Windows.

  • npm clerk, npx clerk, and Homebrew formula
Utility & Efficiency 13 / 15

Combines framework scaffolding, .env key pulling, webhook relaying, impersonation URLs, and config-as-code.

  • Covers init, env pull, config patch, webhooks listen, and doctor
Maintenance & Lineage 9 / 10

Official Clerk CLI (clerk/cli) actively maintained under MIT.

  • Official clerk/cli repository
Docs & Verifiability 8 / 10

Detailed Clerk documentation and structured --help across subcommands.

  • Official Clerk CLI docs and clerk --help

Security, Auth & Guardrails

Auth Modes
OAuth Browser Config File
Credential Storage

Authenticates via browser OAuth (clerk auth login) and stores session state locally, linking project directories to Clerk applications.

Side Effects
Read-Only Local Write Remote Write
Cost & Quotas

MIT open-source CLI; Clerk provides a free tier up to 10,000 monthly active users.

Copyable Guardrail for CLAUDE.md / AGENTS.md
# 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

Check project auth diagnostics
clerk doctor --mode agent

Inspects local SDK versions, middleware, and configuration health without modifying files.

Audit instance security grades
clerk security grades --mode agent

Retrieves Clerk instance security grade checks in agent-friendly output.

Controlled Writes & Previews

Preview an instance security config patch
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 agent and --input-json support tailored specifically for AI coding agents.
  • + clerk config patch --dry-run previews remote auth configuration diffs safely.

Caveats & Pitfalls

  • ! Initial authentication relies on browser OAuth (clerk auth login).
  • ! clerk env pull writes secrets to .env.local unless --print is used.

Tested Agent Hosts

Claude Code Codex CLI Gemini CLI