clerk-cli
Clerk CLI
The clerk binary is a pre-authenticated gateway to Clerk's Backend API and Platform API, plus project-level tooling (auth, linking, env pulls, instance config). When the user asks anything that touches a Clerk resource, reach for clerk first instead of hand-rolling curl.
For setup or init requests, use the clerk-setup skill as the source of truth. Its package-runner, accountless, migration, and init-first guidance takes precedence over the general operational prerequisites below.
This skill targets clerk
latest. Ifclerk --versiondisagrees with the latest available CLI, refresh it withclerk update, or invoke the latest through a package runner such asbunx clerk@latest. The binary is always the source of truth, so runclerk <command> --helpto verify anything this skill claims.
Execution environment (prefer the host, understand the sandbox warning)
Most AI coding agents default to running shell commands in a sandbox where the user's home directory, OS keychain, browser launch, localhost callback binding, or network access may be blocked. The Clerk CLI depends on all of those host capabilities:
- OS credential store:
clerk auth loginstores the OAuth token in the system keychain. A sandbox without keychain access reports "not logged in" even when the host is authenticated. - Home-directory Clerk state: saved config, cached metadata, and fallback credentials live under the user's Clerk config/data directories.
- Linked project metadata: resolved from the repo's git remote plus Clerk config. Sandboxes with stripped repo state or blocked home-dir reads can misreport "not linked".
- Local
.env*files: publishable and secret keys materialized byclerk env pull. - Outbound network access to Clerk: every Backend and Platform API call.
- Browser + localhost OAuth callback:
clerk auth loginneeds both.