You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Adds the clerk-cli skill at <repo-root>/skills/clerk-cli/ as a sibling
to the CLI source, distributed alongside the CLI but not bundled into
the binary. The skill is installed at clerk init time via the same
`npx skills add` mechanism as the upstream framework-pattern skills.
The clerk-cli source URL is constructed from CLI_VERSION:
https://github.com/clerk/cli/tree/v${CLI_VERSION}/skills/clerk-cli
Every published release (stable, canary, snapshot) tags as v${version}
per release.yml/snapshot.ts, so the same template works for all of
them. Dev builds (CLI_VERSION undefined or "0.0.0-dev") fall back to
the main branch.
The two installer calls (clerk-cli + upstream framework skills) share
one runner detection and fail independently, a problem with one
source doesn't block the other.
Copy file name to clipboardExpand all lines: packages/cli-core/src/commands/init/README.md
+27-5Lines changed: 27 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -153,12 +153,28 @@ Nuxt's module system auto-configures middleware and auto-imports components.
153
153
154
154
## Agent skills install
155
155
156
-
After scaffolding (and after env keys are pulled or keyless instructions are printed), `clerk init` offers to install Clerk's framework-specific agent skills from[`clerk/skills`](https://github.com/clerk/skills) via `npx skills add`. This step is optional and non-fatal: if `npx`is missing or the install command exits non-zero, init prints a yellow warning with the manual install command and still exits successfully.
156
+
After scaffolding (and after env keys are pulled or keyless instructions are printed), `clerk init` offers to install Clerk's agent skills via[`npx skills add`](https://www.npmjs.com/package/skills). This step is optional and non-fatal: if no package runner is available or an install command exits non-zero, init prints a yellow warning and still exits successfully.
157
157
158
-
-**Human mode**: prompts `Install agent skills? (...)` defaulting to yes. Pass `--no-skills` to suppress the prompt entirely, or `-y/--yes` to accept it without confirmation.
159
-
-**Agent mode / `--prompt`**: `clerk init` exits early before the skills step runs (see the `if (options.prompt || isAgent()) { ... return }` branch in [`index.ts`](./index.ts)), so nothing is installed. Agent users should run `npx skills add clerk/skills` manually, or have their agent do it.
158
+
-**Human mode**: prompts `Install agent skills? (...)` defaulting to yes. Pass `--no-skills` to suppress the prompt entirely, or `-y/--yes` to accept it without confirmation. When more than one runner (`bunx`, `npx`, `pnpm dlx`, `yarn dlx`) is available, a second prompt picks the runner; the project's package manager is the default choice.
159
+
-**Agent mode / `--prompt`**: `clerk init` exits early before the skills step runs (see the `if (options.prompt || isAgent()) { ... return }` branch in [`index.ts`](./index.ts)), so nothing is installed. Agent users should run `npx skills add clerk/skills`(and the version-pinned `clerk-cli` skill URL) manually, or have their agent do it.
160
160
161
-
The base skills `clerk` and `clerk-setup` are always included. The detected framework dependency adds a matching skill:
161
+
Two install commands run, sharing one runner:
162
+
163
+
### 1. The version-pinned `clerk-cli` skill
164
+
165
+
The `clerk-cli` skill ships **from this repo** at [`<repo-root>/skills/clerk-cli/`](../../../../../skills/clerk-cli/). It is **not** bundled into the binary, it's fetched at install time by the `skills` CLI, the same way any other skill would be.
166
+
167
+
The source URL is constructed from `CLI_VERSION` (the compile-time global injected by `scripts/build.ts`):
Every published release (stable, canary, and snapshot) tags as `v${CLI_VERSION}` (see `.github/workflows/release.yml`), so the same `tree/v<version>/skills/clerk-cli` URL works for all of them. The only case without a matching tag is the local-dev sentinel `0.0.0-dev` (set by `scripts/build.ts` when no `--version` is passed), which falls back to `main`.
174
+
175
+
### 2. The upstream framework-pattern skills
176
+
177
+
The base skills `clerk` and `clerk-setup` are always included from [`clerk/skills`](https://github.com/clerk/skills). The detected framework dependency adds a matching skill:
@@ -173,7 +189,13 @@ The base skills `clerk` and `clerk-setup` are always included. The detected fram
173
189
|`express`|`clerk-backend-api`|
174
190
|`fastify`|`clerk-backend-api`|
175
191
176
-
Implementation lives in [`skills.ts`](./skills.ts). Note that the E2E fixture setup runs `clerk init --yes --no-skills` because the skill templates reference framework-generated types (e.g. React Router's `./+types/root`) that don't exist outside a real app directory and would break the fixture's `tsc` step.
192
+
These skills version independently of the CLI, so no pin is applied.
193
+
194
+
### Failure handling
195
+
196
+
The two install commands fail independently, a problem fetching the version-pinned `clerk-cli` skill (e.g. tag doesn't exist yet, network error) does not block the upstream skills install, and vice versa. Each failure prints its own yellow warning with a manual install command. Init continues and exits successfully either way.
197
+
198
+
Implementation lives in [`skills.ts`](./skills.ts). Note that the E2E fixture setup runs `clerk init --yes --no-skills` because the framework template skills reference auto-generated types (e.g. React Router's `./+types/root`) that don't exist outside a real app directory and would break the fixture's `tsc` step.
0 commit comments