惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Vercel News
Vercel News
B
Blog
Y
Y Combinator Blog
Recent Announcements
Recent Announcements
GbyAI
GbyAI
IT之家
IT之家
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
T
Tailwind CSS Blog
博客园_首页
C
Check Point Blog
博客园 - 【当耐特】
美团技术团队
Last Week in AI
Last Week in AI
A
About on SuperTechFans
雷峰网
雷峰网
MongoDB | Blog
MongoDB | Blog
Microsoft Azure Blog
Microsoft Azure Blog
M
MIT News - Artificial intelligence
Martin Fowler
Martin Fowler
J
Java Code Geeks
B
Blog RSS Feed
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
G
Google Developers Blog
F
Fortinet All Blogs

Clerk Blog

Going to production with Clerk Deploy Introducing Clerk CLI Middleware-based route protection bypass Postmortem: Clerk System Outage (March 10, 2026) Clerk for the AI era Add API Key support to your SaaS in minutes Postmortem: Clerk System Outage (February 19, 2026) Using Clerk in a React Native app Postmortem: DNS Provider Outage (February 10, 2026) How do I implement passkeys in Next.js? Clerk ranked #4 fastest-growing software vendor on Ramp’s December 2025 list How do I handle JWT verification in Next.js? Committing to Agent Identity: Clerk raises $50m Series C from Menlo and Anthropic’s Anthology Fund What is the best way to handle authentication in Next.js App Router? Postmortem: Database Incident (September 14–18, 2025) How do I add authentication to a Next.js app? Introducing Free Trials in Clerk Billing Postmortem: August 28, 2025 - elevated API latency and errors Introducing Mosaic: Bring Your Brand to Every Authentication Flow Multi-tenant authentication: What you need to know (and how Clerk helps) What are the risks and challenges of multi-tenancy? Resilience in Practice: Regional Failover at Clerk Build a Cross-Platform B2B App with Clerk, Expo, and Supabase Highlights from the MiduDev/Clerk Hackathon Add multi-tenancy to an app built with Clerk, Lovable, and Supabase How to build an AI coding rules app with Clerk, Lovable, and Supabase How to Build Multi-Tenant Authentication with Clerk Choosing the right SaaS architecture: Multi-Tenant vs. Single-Tenant Postmortem: June 26, 2025 service outage How to Design a Multi-Tenant SaaS Architecture
Clerk Init: The fastest way to start a new project
Nicolas Angelo · 2026-05-11 · via Clerk Blog

Clerk's been quietly building toward a moment where you can start a new app in a single command. That command is clerk init.

Shipped with the Clerk CLI, clerk init covers the essential scaffolding for some of the most popular frameworks. Run this command in an empty directory and Clerk delivers a fully bootstrapped project with auth pages and route protection ready to go.

This post demonstrates how quick and easy it is to get a fully working app with auth, organizations, and billing configured - all without leaving your terminal or agent.

Break out your terminal and follow along.

Starting from zero

From an empty directory, run:

Follow the interactive prompts for project name, framework, and package manager. Choose "Next.js" and Bun for this example.

Clerk scaffolds a new Next.js project with batteries included. Before init completes, the CLI offers to install agent skills like clerk, clerk-setup, and clerk-nextjs-patterns. You accept, pick your agent, and select "Project" for the installation scope.

A few seconds later, the terminal prints the next steps:

localhost loads. There's a sign-in page. There's a sign-up page. They just work. No Clerk account created, no API keys copied, no dashboard opened. Clerk development keys are generated on-the-fly so you can start building right away.

Going beyond the bootstrap

Building a SaaS product with Clerk means tapping into some of our other key products like Organizations and Billing. The bootstrapped app gets you started, but you'll want to link your new project to your account for greater flexibility and control. Once your project is linked, you can configure your instance straight from the terminal.

Run clerk link from the project root:

If you're not already authenticated, the CLI opens a browser tab for sign-in. From there, clerk link claims the app you've been building.

Next, pull the credentials from the dashboard into your local environment:

Restart the dev server (if it doesn't auto-refresh), and you're connected to your Clerk instance.

Enabling features

This used to be the part where you'd context-switch in and out of the dashboard to turn features on. With your project linked, that same workflow gets reduced to a single step: clerk enable.

Start with Organizations:

Done. Organizations are now enabled. You didn't leave your terminal.

Want to get paid? Turn on Billing:

The CLI offers to install the clerk-billing skill. You accept, and now your favorite coding agent just got more superpowers.

clerk enable is designed for incremental opt-in to Clerk's core services. Each feature you turn on ships with a matching skill, and that pairing wasn't an afterthought, it was the point. Enabling a feature on your instance should also enable your agent's understanding of how to use it.

Organizations and Billing are the start. Expect more features to land behind clerk enable over time.

Pairing with your agent

Stacked on the init skills, the clerk-billing skill rounds out your agent's Clerk context. One prompt:

"Add three subscription tiers to my clerk app: Free, Pro, and Enterprise."

Or:

"Add a /pricing page where users can compare plans and subscribe."

Seconds later, your app has plans configured, a pricing table on the page, and a working checkout your customers can use.

If you're using shadcn/ui, you can now prompt the agent to build out your dashboard:

"Build a /dashboard layout using a collapsible shadcn sidebar with an inset. The sidebar header should include clerk's org switcher and the footer should have the user button."

It scaffolds the layout, then drops in the right Clerk components for account management and organization switching. You follow up:

"Add a /developers page where users can create and manage api keys using clerk's api keys component."

Done. Want to add a new login provider? No problem:

"Add GitHub as a login option for my app."

The agent calls the CLI, runs clerk config patch and enables the GitHub provider on your instance.

This is the moment the rhythm starts to emerge. When the agent has the right tools and reference, the friction between what you ask for and what comes back keeps shrinking. There's still tuning - there always will be - but the corrections get smaller, and the loop starts moving with you instead of against you.

Adopting Clerk mid-project

Not every project starts with Clerk; init is built for those too. Run it inside an existing codebase and Clerk adapts. It detects your setup, installs the SDK, and scaffolds only what's missing. If you're migrating from NextAuth, Auth0, or Supabase Auth, the CLI detects that and links you to the relevant migration guide.

If you already have middleware, Clerk composes with it rather than overwriting it. After scaffolding, it scans for hardcoded keys and leftover imports from previous auth libraries, so you know exactly what to clean up.

That flexibility is the real benefit of the init workflow. It meets a project at whatever stage it's in.

The sky's the limit

clerk init. clerk link. clerk enable. Three commands lay the foundation. Agent skills take you further so you can ship faster. Some of the most tedious parts of setting up a SaaS application? Gone. Now you can focus on the parts that matter.

This is how getting started should feel.

Get started with Clerk CLI