跳转到正文
报告库
用途分类 / 其他用途

Clerk Cli Skill 安全审计

作者说它能做什么(原文)

>-

第三方安全检查结论

先别安装或运行

已检查文件
4
发现的风险
8
会不会运行危险命令?检查是否下载程序后直接运行、让他人远程控制电脑,或藏起要运行的命令。发现 1 项风险
中风险

回退安装路径会直接执行未固定版本的 clerk@latest

原文依据:2 处
发现了什么

当全局 CLI 不可用或不受信任时,Skill 建议通过 bunx、npx、pnpm dlx 或 yarn dlx 获取并执行 latest。latest 会随发布变化,审计过的 Skill 文档无法保证运行时下载的包仍是同一代码。

为什么需要注意

若包供应链、发布账号或最新版本受损,下载的代码会以代理的本机权限运行,并可能接触 Clerk 凭据、项目文件和网络。

当全局二进制不可用或版本不合适时,Skill 指示包运行器下载并执行 `clerk@latest`。该版本未固定,会随未来发布变化,因此当前文档审计不能覆盖实际运行的包。网络安装本身并非恶意,但用户可要求固定已审查版本、校验来源,或仅使用受管的全局安装。

SKILL.md:20来自说明文档打开原文件
> This skill targets clerk `latest`. If `clerk --version` disagrees with the latest available CLI, refresh it with `clerk update`, or invoke the latest through a package runner such as `bunx clerk@latest`. The binary is always the source of truth, so run `clerk <command> --help` to verify anything this skill claims.
查看另外 1 个位置
SKILL.md:76来自说明文档打开原文件
Otherwise fall back to a package runner, in this order (matches the CLI's own `preferredRunner` logic, which prefers the runner that matches the project's lockfile):| Project package manager   | Invocation                       || ------------------------- | -------------------------------- || bun (`bun.lock*`)         | `bunx clerk@latest`     || npm (`package-lock.json`) | `npx -y clerk@latest`   || pnpm (`pnpm-lock.yaml`)   | `pnpm dlx clerk@latest` || yarn >= 2 (`yarn.lock`)   | `yarn dlx clerk@latest` |Yarn Classic (v1) has no `dlx`; treat those projects as "no preferred runner" and fall back to the first runner from the list above that's on PATH.
会不会泄露文件和密钥?检查是否发送含密码或密钥的文件,以及代码里是否直接写了密钥。发现 3 项风险
高风险

环境变量可把携带密钥的 API 或 OAuth 流量重定向到其他服务器

原文依据:3 处
发现了什么

CLI 接受 Backend、Platform 和 OAuth 基础 URL 覆盖,同时请求分别使用实例 secret key、平台 API key 或 OAuth token。若仓库启动环境、CI 或外壳预设了恶意覆盖值,认证材料可能被发送到非 Clerk 端点。

为什么需要注意

攻击者可能获得 Clerk 密钥或 OAuth 令牌,并借此读取或修改用户、组织、会话、配置和计费信息。

文档说明 Backend、Platform 与 OAuth 请求分别使用 secret key、平台密钥或 OAuth token,同时允许环境变量覆盖三个基础 URL。若项目脚本、CI 或 shell 环境预设了不可信 URL,后续认证请求可能把凭据发送到该目标。此处未证明存在恶意值或已经泄露;用户可在运行前核对并清除这些 URL 覆盖。

references/auth.md:9来自说明文档打开原文件
| API                      | Base URL                    | Auth                                                                   | Used for                                                                                           | CLI flag     || ------------------------ | --------------------------- | ---------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | ------------ || **Backend API (BAPI)**   | `https://api.clerk.dev/v1/` | Instance **secret key** (`sk_...`)                                     | Tenant data: users, orgs, sessions, invitations, JWT templates, webhooks.                          | (default)    || **Platform API (PLAPI)** | `https://api.clerk.com/v1/` | **Platform API key** (`ak_...`) or OAuth token from `clerk auth login` | Account-level: listing your applications, fetching app/instance metadata, pulling config, billing. | `--platform` |You override the base URLs via `CLERK_BACKEND_API_URL` and `CLERK_PLATFORM_API_URL` when testing against non-production Clerk environments.
查看另外 2 个位置
references/auth.md:126来自说明文档打开原文件
OAuth 2.0 PKCE flow against the Clerk OAuth system instance (`https://clerk.clerk.com` by default, overridable via `CLERK_OAUTH_BASE_URL`):1. Generates PKCE parameters.2. Starts a local callback server on `127.0.0.1`.3. Opens the browser to `/oauth/authorize`.4. Exchanges the code at `/oauth/token` for an access token.5. Fetches user info from `/oauth/userinfo`.6. Stores the token in the OS credential store.
references/auth.md:159来自说明文档打开原文件
| `CLERK_MODE`             | Force `human` or `agent` mode (overrides TTY detection).        || `CLERK_SECRET_KEY`       | BAPI secret key (bypasses linked project / `--app` resolution). || `CLERK_PLATFORM_API_KEY` | PLAPI bearer key.                                               || `CLERK_BACKEND_API_URL`  | Override Backend API base URL.                                  || `CLERK_PLATFORM_API_URL` | Override Platform API base URL.                                 || `CLERK_OAUTH_BASE_URL`   | Override OAuth base URL (advanced / internal).                  || `CLERK_CONFIG_DIR`       | Override config, cache, and credential directory (advanced).    |
中风险

env pull 会把 Clerk secret key 写入项目环境文件

原文依据:5 处
发现了什么

该命令会把 publishable key 和 secret key 落盘,并允许通过 --file 指向 .env 等文件。虽然说明提醒不要提交秘密,但它仍依赖目标文件确实被忽略且访问权限合适。

为什么需要注意

密钥可能进入版本控制、备份、构建产物、日志或被同机其他进程读取,从而暴露 Clerk 租户权限。生产密钥的影响更大。

`clerk env pull` 的预期功能就是把 publishable key 和 secret key 写入项目环境文件,并可用 `--file` 选择目标。文档提醒 `.env.local` 应被 gitignore,但没有保证目标文件权限或忽略规则已正确配置。若目标被提交、备份或其他本地用户可读,密钥可能暴露;用户可先核对路径、权限和版本控制状态。

SKILL.md:37来自说明文档打开原文件
  misreport "not linked".- **Local `.env*` files**: publishable and secret keys materialized by  `clerk env pull`.- **Outbound network access to Clerk**: every Backend and Platform API call.
查看另外 4 个位置
SKILL.md:221来自说明文档打开原文件
| `clerk link` / `clerk unlink` | Link this repo to a Clerk app, or remove the link. `unlink` requires `--yes` in agent mode.                                                                                                                                                                                                                         | (see `--help`)                                                                                                                                                                   || `clerk env pull`              | Write publishable + secret keys to the framework's env file (merge, not clobber). Resolves `.env.development.local` → framework-preferred file → `.env.local`; override with `--file`.                                                                                                                              | (see `--help`)                                                                                                                                                                   || `clerk config {pull,schema}`  | Fetch instance config JSON, or its JSON Schema.                                                                                                                                                                                                                                                                     | (see `--help`)                                                                                                                                                                   |
references/recipes.md:241来自说明文档打开原文件
```sh# Pull dev keys into .env.local (auto-detects framework and key names)clerk env pull# Pull production keysclerk env pull --instance prod# Target a specific fileclerk env pull --file .env````env pull` merges into the existing file: existing Clerk keys are updated in place; new ones are appended under a `# Clerk` header; everything else is preserved.
SKILL.md:281来自说明文档打开原文件
3. **Target explicitly in production:** pass `--instance prod` rather than relying on defaults, and confirm with the user before any production mutation.4. **Never commit secrets:** `env pull` writes to `.env.local` (which should be gitignored). Don't paste secret keys into code or chat.5. **Use `doctor --json`** to diagnose before assuming the CLI is broken.
references/recipes.md:248来自说明文档打开原文件
# Target a specific fileclerk env pull --file .env````env pull` merges into the existing file: existing Clerk keys are updated in place; new ones are appended under a `# Clerk` header; everything else is preserved.
中风险

本地 webhook 配方会把真实事件写入持久文件

原文依据:3 处
发现了什么

配方让真实 Clerk 事件经中继流向终端,并示范重定向到 events.ndjson。Webhook 内容通常可能包含用户、组织或会话字段;文件不会自动清理。

为什么需要注意

事件数据可能留在项目目录、进入版本控制、备份或被其他本机用户读取。

配方明确说真实 webhook 事件会流向终端,并示范把代理模式的 NDJSON 重定向到工作区中的 `events.ndjson`。这会持久保存事件内容;其敏感程度取决于实际 webhook 负载,源码没有说明自动清理或文件权限。用户可要求仅使用测试事件、写入受限临时位置,并约定删除时间。

references/recipes.md:194来自说明文档打开原文件
`listen` talks only to the Svix relay and `verify` is pure local HMAC - neither needs auth or a linked project.```sh# 1. Mint a token and open a pinned tunnel that forwards deliveries to your handler.#    The command prints a relay inbox URL (https://webhooks.clerk.com/in/c_.../).clerk webhooks listen --token "$(clerk webhooks token)" --forward-to http://localhost:3000/api/webhooks# 2. Add that relay URL as a webhook endpoint in the Clerk Dashboard.#    Real events now stream to your terminal and forward to your local handler.#    svix-* headers are preserved, so verifyWebhook() in your handler still#    verifies against that endpoint's signing secret.# 3. Capture events for replay/verification (agent mode emits NDJSON automatically)clerk webhooks listen --forward-to http://localhost:3000/api/webhooks --json > events.ndjson
查看另外 2 个位置
references/recipes.md:201来自说明文档打开原文件
# 2. Add that relay URL as a webhook endpoint in the Clerk Dashboard.#    Real events now stream to your terminal and forward to your local handler.#    svix-* headers are preserved, so verifyWebhook() in your handler still#    verifies against that endpoint's signing secret.
references/recipes.md:206来自说明文档打开原文件
# 3. Capture events for replay/verification (agent mode emits NDJSON automatically)clerk webhooks listen --forward-to http://localhost:3000/api/webhooks --json > events.ndjson# 4. Verify a saved delivery offline against the endpoint's signing secretclerk webhooks verify --secret whsec_... --delivery @event.json```
会不会删除文件或一直在后台运行?检查是否大范围删除文件、改写磁盘,或设置自动启动。发现 1 项风险
中风险

clerk init --fresh 会无提示覆盖密钥文件并遗弃原应用及用户

原文依据:1 处
发现了什么

Skill 说明 --fresh 会替换临时应用,覆盖环境密钥和 .clerk/keyless.json,而且不提示确认。旧应用和其中用户会变成孤立资源。

为什么需要注意

项目可能立即指向新应用,旧用户无法在当前配置下访问;原密钥和应用关联信息也可能难以恢复。

文档明确将 `--fresh` 标为破坏性:它无提示替换临时应用,并覆盖环境密钥及 `.clerk/keyless.json`,使旧应用和用户失去当前项目的关联。该风险仅在运行 `clerk init --fresh` 时发生;普通 `init` 不等同于此操作。用户可禁止代理使用该参数,除非已明确同意替换。

SKILL.md:257来自说明文档打开原文件
- **`init` needs no login — do not log in first.** An unauthenticated agent run mints an unclaimed accountless app with temporary dev keys: no flag, no account, no browser. `--app <id>` or a pre-link targets a real app instead; `--accountless` forces the temporary-keys path over both a session and an existing link. `--keyless` remains a deprecated compatibility alias. A framework without temporary-key support and no app target prints manual guidance and exits cleanly. Flag exclusivity is in the command table above.- **`--fresh` is destructive.** It replaces the temporary app and overwrites the env keys and `.clerk/keyless.json` breadcrumb with no prompt, orphaning the previous app and its users. Never pass it just to re-run `init`.- **`unlink` requires `--yes` in agent mode.** It gates on `isAgent() && !options.yes` and exits with a usage error without it. This is the exception, not the pattern - see the next bullet.
会不会绕过安全保护?检查是否跳过网站安全验证、开放过多文件权限,或取消操作前的确认。发现 2 项风险
高风险

代理模式绕过大多数变更确认,并可能自动选中生产密钥

原文依据:4 处
发现了什么

代理模式会静默跳过配置、API、用户创建和功能开关的确认。未显式指定应用时,CLI 又会使用本地找到的任何 sk_ 密钥,包括 sk_live_。因此一次遗漏 dry-run 或目标参数的调用即可直接修改生产环境。

为什么需要注意

可能创建或删除用户、封禁账号、撤销会话、改变组织或计费设置,或替换实例配置。

代理模式确实跳过除 unlink 外的大多数确认;如果调用遗漏 `--dry-run`,变更可立即执行。未指定应用或链接时,CLI 还会采用本地找到的任何 `sk_` 密钥,包括生产密钥。因此在本地存在 `sk_live_` 时,错误目标可能导致未经确认的生产修改。用户可限制为显式 `--app`/`--instance` 并要求先展示 dry-run。

references/agent-mode.md:57来自说明文档打开原文件
| `unlink` confirmation                                            | Prompt y/n                                                       | Requires `--yes`; exits with a usage error without it || All other mutation confirmations (`config patch` / `put`, `api -X POST/PATCH/DELETE`, `users create`, `enable` / `disable`) | Prompt y/n | **Silently skipped - the mutation executes.** These gates are `isHuman() && !options.yes`, so agent mode bypasses them entirely: `--yes` is neither required nor meaningful, and nothing errors. `--dry-run` is the only safety net                                                                                                                                                                                                                                                                                                                                                                                                     || `clerk doctor --fix`                                             | Interactively offers fixes                                       | **Ignored**; output the `remedy` field and let the caller act                                                                                                                                                                                                                                                                                                                                                                        |
查看另外 3 个位置
references/auth.md:50来自说明文档打开原文件
**It follows the key, not the app.** No `--app` and no link means the CLI uses whatever local `sk_` key it finds — `sk_live_` included, claimed or not. In an unlinked repo a production key in `.env.local` is what gets mutated, unconfirmed in agent mode. Pass `--app <id>` when you mean a real application.
SKILL.md:257来自说明文档打开原文件
- **`init` needs no login — do not log in first.** An unauthenticated agent run mints an unclaimed accountless app with temporary dev keys: no flag, no account, no browser. `--app <id>` or a pre-link targets a real app instead; `--accountless` forces the temporary-keys path over both a session and an existing link. `--keyless` remains a deprecated compatibility alias. A framework without temporary-key support and no app target prints manual guidance and exits cleanly. Flag exclusivity is in the command table above.- **`--fresh` is destructive.** It replaces the temporary app and overwrites the env keys and `.clerk/keyless.json` breadcrumb with no prompt, orphaning the previous app and its users. Never pass it just to re-run `init`.- **`unlink` requires `--yes` in agent mode.** It gates on `isAgent() && !options.yes` and exits with a usage error without it. This is the exception, not the pattern - see the next bullet.- **Only `unlink` actually requires `--yes`.** Every other confirmation gate is written as `isHuman() && !options.yes`, so agent mode skips it outright: the mutation executes with no prompt and no error. Passing `--yes` is harmless but changes nothing. Do not treat it as a safety gate - `--dry-run` is the real one.- **`impersonate` requires the `[user]` positional in agent mode.** If a search term matches multiple users, it exits `2` listing candidate user IDs — retry with a specific `user_...` ID. Output is a JSON object (`{url, id, userId, actor, ...}`); surface `url` to the user and capture `id` — it is the only chance to record the revoke handle.
SKILL.md:280来自说明文档打开原文件
2. **Preview mutations:** `--dry-run` on every `config patch`, `config put`, `api -X POST/PATCH/PUT/DELETE`.3. **Target explicitly in production:** pass `--instance prod` rather than relying on defaults, and confirm with the user before any production mutation.4. **Never commit secrets:** `env pull` writes to `.env.local` (which should be gitignored). Don't paste secret keys into code or chat.
高风险

模拟登录可绕过用户 MFA,原始 API 还能生成无 actor 审计轨迹的登录令牌

原文依据:3 处
发现了什么

Skill 支持生成模拟登录 URL;生产环境中的该流程绕过用户 MFA。配方还提供 /sign_in_tokens 调用,可在没有 actor 审计轨迹的情况下以目标用户身份登录。

为什么需要注意

任何获得生成 URL 或令牌的人都可能在有效期内进入目标用户账号;使用原始登录令牌时,调查人员还会失去模拟登录提供的 actor 标记。

Skill 明确提供用户模拟登录,生产环境会绕过目标用户 MFA,虽要求先取得用户确认且 actor token 带审计标记。另一个原始 API 配方可生成没有 actor 审计轨迹的一次性登录令牌。若代理被授权过宽或令牌 URL 泄露,可能导致目标账户被接管。用户应限定开发实例、指定用户,并禁止未明确授权的 sign-in token。

SKILL.md:230来自说明文档打开原文件
| `clerk users open [user-id]`  | Open a user's dashboard page. Agent mode requires `user-id` and prints a JSON descriptor instead of launching a browser.                                                                                                                                                                                            | (see `--help`)                                                                                                                                                                   || `clerk impersonate [user]`    | Sign in as a user for debugging: creates a short-lived actor token and prints the sign-in URL. Alias: `clerk imp`. Requires `clerk auth login` (no `--secret-key`-only bypass) — every token is stamped `cli:<email>` for auditability. `[user]` accepts a `user_...` ID, exact email, or fuzzy search term. On production it bypasses the user's MFA and may count against the impersonation quota — confirm with the user first. | `--print`, `--open`, `--yes`, `--expires-in <seconds>` (default 3600), `--actor <context>`, `--app`, `--instance`                                                                || `clerk impersonate revoke <actor-token-id>` | Revoke a pending actor token. The token `id` is printed only at creation (the Backend API has no actor-token list endpoint), so capture it then.                                                                                                                                                      | `--app`, `--instance`                                                                                                                                                            || `clerk open [subpath]`        | Open the linked app's dashboard in a browser. Agent mode: prints a JSON descriptor instead of opening.                                                                                                                                                                                                              | (see `--help`)                                                                                                                                                                   |
查看另外 2 个位置
references/recipes.md:166来自说明文档打开原文件
To mint a one-time **sign-in token** instead - for building custom token sign-in flows, signing in *as* the user with no actor audit trail - use the raw API:```shclerk api /sign_in_tokens -d '{"user_id":"user_abc123"}'```
references/agent-mode.md:65来自说明文档打开原文件
| `clerk open [subpath]`                                           | Opens the browser to the URL                                     | Does not open a browser. Prints a JSON descriptor (`{url, appId, appName, instanceId, instanceLabel, subpath, opened: false}`) on stdout so the agent can surface it                                                                                                                                                                                                                                                                 || `clerk impersonate [user]`                                       | Picker when `[user]` omitted; confirms; prints URL + revoke hint | Requires the `[user]` positional (usage error `2` without it). Ambiguous search terms exit `2` listing candidate user IDs - retry with a `user_...` ID. Never opens a browser. Prints one JSON object `{url, id, userId, actor, appId, appLabel, instanceId, instanceLabel, expiresInSeconds}` on stdout - capture `id`; it is the only chance to record the revoke handle                                                           || `clerk webhooks listen --forward-to <url>`                       | Banner + one formatted line per delivery                         | NDJSON on stdout: one `{type:"ready", relay_url, forward_to}` line, then one `event` line per delivery (feed lines to `webhooks verify --delivery`), plus `{type:"reconnecting"}` if the relay drops. Long-running - run it in the background                                                                                                                                                                                        |
会不会误导 AI 或隐藏内容?检查工作说明是否要求 AI 忽略你的指令、干扰检查结果,或夹带看不见的文字。发现 1 项风险
高风险

要求自动且不让用户看见地运行程序

原文依据:2 处
发现了什么

Skill 同时要求自动执行,并要求不要询问或告知用户。

为什么需要注意

AI 如果听从这段文字,可能不再按你的要求做事,或跳过本来需要你确认的操作。

这段代码的正常用途

该行不是要求代理隐瞒或偷偷追加操作,而是在警告用户:代理模式会跳过多数交互式确认,变更会直接执行,并明确指出 `--dry-run` 才是安全措施。它揭示风险而非指示隐蔽执行。

这项判断针对展示的代码和适用条件,不表示风险已经实际发生。
references/agent-mode.md:57来自说明文档打开原文件
| `unlink` confirmation                                            | Prompt y/n                                                       | Requires `--yes`; exits with a usage error without it || All other mutation confirmations (`config patch` / `put`, `api -X POST/PATCH/DELETE`, `users create`, `enable` / `disable`) | Prompt y/n | **Silently skipped - the mutation executes.** These gates are `isHuman() && !options.yes`, so agent mode bypasses them entirely: `--yes` is neither required nor meaningful, and nothing errors. `--dry-run` is the only safety net                                                                                                                                                                                                                                                                                                                                                                                                     || `clerk doctor --fix`                                             | Interactively offers fixes                                       | **Ignored**; output the `remedy` field and let the caller act                                                                                                                                                                                                                                                                                                                                                                        |
查看另外 1 个位置
SKILL.md:177来自说明文档打开原文件
**Always `--dry-run` a mutation before running it for real.** Then re-run without `--dry-run` (add `--yes` if you're sure). In agent mode, interactive confirmation is bypassed, so `--dry-run` is the only safety net for destructive calls.
会不会偷偷改推广链接或收款方?检查是否强制替换推广链接或收款对象,同时要求隐瞒更改。未发现风险

Skill 逻辑拆解

8 个说明模块

该 Skill 是一套驱动 Clerk CLI 的操作说明,范围包括认证、用户和组织、会话、配置、计费、部署、模拟登录以及任意 Backend/Platform API 请求。它依赖本机保存的 OAuth 或平台密钥,并可访问 Clerk 租户数据。

查看原文
SKILL.md:4来自说明文档打开原文件
description: >-  Operate the Clerk CLI (`clerk` binary) for authentication, user/org/session  management, impersonation, local webhook testing, deploy verification,  instance config, env keys, feature toggles, and any Clerk Backend, Platform,  or Frontend API call. Use when the user mentions Clerk management tasks,  "list clerk users", "impersonate a user", "test webhooks locally",  "enable orgs", "enable billing",  "clerk env pull", "clerk doctor", "clerk deploy", "clerk api", or any ad-hoc  Clerk API request. Prefer the CLI over raw HTTP: it handles auth, key  resolution, app/instance targeting, and formatting automatically.license: MIT
references/auth.md:9来自说明文档打开原文件
| API                      | Base URL                    | Auth                                                                   | Used for                                                                                           | CLI flag     || ------------------------ | --------------------------- | ---------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | ------------ || **Backend API (BAPI)**   | `https://api.clerk.dev/v1/` | Instance **secret key** (`sk_...`)                                     | Tenant data: users, orgs, sessions, invitations, JWT templates, webhooks.                          | (default)    || **Platform API (PLAPI)** | `https://api.clerk.com/v1/` | **Platform API key** (`ak_...`) or OAuth token from `clerk auth login` | Account-level: listing your applications, fetching app/instance metadata, pulling config, billing. | `--platform` |

该 Skill 明确建议变更前使用 dry-run,并要求生产环境显式指定目标且先取得用户确认。这些是说明层面的保护措施;实际 CLI 在代理模式下不会为大多数变更弹出确认。

查看原文
SKILL.md:276来自说明文档打开原文件
## Safety rules for autonomous use1. **Discover before acting:** `clerk api ls <keyword>` before `clerk api <path>`.2. **Preview mutations:** `--dry-run` on every `config patch`, `config put`, `api -X POST/PATCH/PUT/DELETE`.3. **Target explicitly in production:** pass `--instance prod` rather than relying on defaults, and confirm with the user before any production mutation.4. **Never commit secrets:** `env pull` writes to `.env.local` (which should be gitignored). Don't paste secret keys into code or chat.5. **Use `doctor --json`** to diagnose before assuming the CLI is broken.
references/agent-mode.md:56来自说明文档打开原文件
| `clerk link` without `--app`                                     | Interactive picker / create UI                                   | Tries silent autolink from detected publishable keys; if no deterministic match exists, exits with a usage error telling the caller to pass `--app`                                                                                                                                                                                                                                                                                  || `unlink` confirmation                                            | Prompt y/n                                                       | Requires `--yes`; exits with a usage error without it || All other mutation confirmations (`config patch` / `put`, `api -X POST/PATCH/DELETE`, `users create`, `enable` / `disable`) | Prompt y/n | **Silently skipped - the mutation executes.** These gates are `isHuman() && !options.yes`, so agent mode bypasses them entirely: `--yes` is neither required nor meaningful, and nothing errors. `--dry-run` is the only safety net                                                                                                                                                                                                                                                                                                                                                                                                     || `clerk doctor --fix`                                             | Interactively offers fixes                                       | **Ignored**; output the `remedy` field and let the caller act                                                                                                                                                                                                                                                                                                                                                                        || `clerk apps list` default output                                 | Table                                                            | JSON (when piped)                                                                                                                                                                                                                                                                                                                                                                                                                    |

认证和目标选择依赖本机钥匙串、主目录配置、仓库链接及本地环境文件。沙箱缺少这些状态时可能产生误导性失败,因此说明要求在宿主机重新验证。

查看原文
SKILL.md:29来自说明文档打开原文件
- **OS credential store**: `clerk auth login` stores 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 by  `clerk env pull`.- **Outbound network access to Clerk**: every Backend and Platform API call.- **Browser + localhost OAuth callback**: `clerk auth login` needs both.
从这里开始 · 工作说明SKILL.md
clerk-cli
连线表示工作说明包含的模块,不是实际运行顺序。点击模块可查看原文。 另有 5 个章节,可在原文件中查看。

文件引用关系图

4 处引用
哪些文件发起引用引用了什么
连线表示真实的文件引用,不是运行顺序。点击节点可高亮相关连线,并查看具体文件和原文位置。虚线表示还有文件需要定位。
文件与检查记录4 个文件

检查范围与遗漏

逐文件查看涉及的内容

下方列出本次涉及的原文范围;纳入检查不代表已查清所有问题。

  • SKILL.md已纳入全文
  • references/agent-mode.md已纳入全文
  • references/auth.md已纳入全文
  • references/recipes.md已纳入全文

这份报告只针对上方版本。我们看了拿到的代码和说明文件,没有实际运行 Skill,也没有检查它另外安装的软件包。因此,这不是“保证安全”的承诺;换了版本或使用环境,结果也可能不同。

  • SKILL.md工作说明
  • references/agent-mode.md配套文件
  • references/auth.md配套文件
  • references/recipes.md配套文件

代码和说明中提到的操作

连接外部网站
SKILL.md:18来自说明文档打开原文件
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`.
references/agent-mode.md:238来自说明文档打开原文件
  "oauth": { "complete": true, "configured": ["google"], "pending": [], "unsupported": [] },  "nextAction": "SSL still provisioning for example.com. Re-run `clerk deploy status` in a few minutes, DNS propagation can take time. Ask the user to visit the Clerk Dashboard domains page, or offer to open it: https://dashboard.clerk.com/apps/app_.../instances/ins_.../domains"}
references/auth.md:11来自说明文档打开原文件
| ------------------------ | --------------------------- | ---------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | ------- | **Backend API (BAPI)**   | `https://api.clerk.dev/v1/` | Instance **secret key** (`sk_...`)                                     | Tenant data: users, orgs, sessions, invitations, JWT templates, webhooks.                          | (default)    || **Platform API (PLAPI)** | `https://api.clerk.com/v1/` | **Platform API key** (`ak_...`) or OAuth token from `clerk auth login` | Account-level: listing your applications, fetching app/instance metadata, pulling config, billing. | `--plat 
读取密钥或账号配置
SKILL.md:25来自说明文档打开原文件
Most AI coding agents default to running shell commands in a sandbox where theuser's home directory, OS keychain, browser launch, localhost callbackbinding, or network access may be blocked. The Clerk CLI depends on all of
SKILL.md:30来自说明文档打开原文件
- **OS credential store**: `clerk auth login` stores the OAuth token in the  system keychain. A sandbox without keychain access reports "not logged in"  even when the host is authenticated.
SKILL.md:33来自说明文档打开原文件
- **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
安装其他软件包
SKILL.md:81来自说明文档打开原文件
| bun (`bun.lock*`)         | `bunx clerk@latest`     || npm (`package-lock.json`) | `npx -y clerk@latest`   || pnpm (`pnpm-lock.yaml`)   | `pnpm dlx clerk@latest` |
SKILL.md:87来自说明文档打开原文件
The published npm package is **`clerk`**, not `@clerk/cli`. Never teach `npm install -g clerk` as the primary path. If the global CLI is stale or behaves differently from this skill, either upgrade the global install or fall back to the `latest` runner form above.
读取文件
SKILL.md:153来自说明文档打开原文件
clerk api /users --file payload.jsoncat payload.json | clerk api /users
SKILL.md:206来自说明文档打开原文件
```shpython3 -c 'import json; d=json.load(open("/tmp/users.json")); print(len(d["data"]), d["hasMore"])'node -e 'const d=require("/tmp/users.json"); console.log(d.data.length, d.hasMore)'
SKILL.md:266来自说明文档打开原文件
- **`deploy` has an agent handoff plus a verification gate.** In agent mode, bare `clerk deploy` is read-only and emits a JSON handoff. It never drives the interactive wizard. Do not tell Claude or another agent to run `! clerk deploy`, bec - **`--input-json <json|@file|->`** expands JSON into flags on any command (e.g. `clerk init --input-json '{"framework":"next","yes":true}'`). Stdin needs the explicit `-` marker (`echo '{"yes":true}' | clerk init --input-json -`); bare piped stdin is **not** auto-detected, so shell loops and self-reading commands (`cat body.json | clerk api …`) are untouched. Place `--input-json` after the leaf subcommand. Full rules in [references/agent-mode.md](references/agent-mode.md#passing-options-as-json---input-json).
运行命令
SKILL.md:243来自说明文档打开原文件
| `clerk api ls [filter]`       | Discover endpoints from the bundled OpenAPI catalog.                                                                                                                                                           | `clerk completion [shell]`    | Print a shell completion script (`bash`, `zsh`, `fish`, `powershell`).                                                                                                                                                                                                                                              | -                                                                                                                                                                                || `clerk update`                | Update the CLI to the latest version.                                                                                                                                                                          
读取了多少行
1,106
文件校验值(用于核对版本)
228ce464bb4d16cde83901dd6790a94bdee987985848f082d5990c0c6b02fe9d