Clerks New CLI: Add Auth to Next.js Without Leaving Your Terminal @hamedbahram
Clerks New CLI: Add Auth to Next.js Without Leaving Your Terminal  @hamedbahram
Uploaded July 2026 | Updated December 2026, 3 hours ago
Clerk just shipped a CLI, and it changes how you wire up auth in a Next.js app — no dashboard round-trips, no copy-pasting API keys, and no ngrok for webhooks.

In this video I run clerk init to detect the framework, link (or create) an app, install the right SDK, add the ClerkProvider and middleware, and pull my keys straight into .env. Then I install the agent skills and hand things over to Claude Code to set up a webhook endpoint — using clerk webhooks listen to spin up a relay tunnel with a stable token instead of reaching for ngrok. I also cover the other commands (impersonate, deploy, MCP) and I'm honest about what the CLI doesn't do yet: you still wire the endpoint up in the Clerk dashboard yourself, and production deploys with DNS + social logins are their own tedious story (one I want to test the CLI against in a future video).

If you're building with an AI coding agent, this is worth a look — it's as much a tool for your agent as it is for you.

⏱️ Chapters
00:00 – What we're building with the Clerk CLI
00:35 – Spinning up the Next.js app
01:45 – Installing the CLI + running clerk init
03:15 – Installing agent skills (Claude Code)
04:00 – What init actually set up (provider, middleware, env keys)
06:00 – Setting up a webhook with Claude Code
07:20 – How clerk webhooks listen replaces ngrok
08:20 – Other commands: impersonate, deploy, MCP
10:37 – Webhook handler + relay running
12:51 – Wiring the endpoint in the Clerk dashboard
14:49 – Running the listen command with a stable token
16:10 – Testing it end to end (user.created fires)

🔗 Links
Clerk CLI → clerk.com/cli
CLI docs → clerk.com/docs/cli
Announcement → clerk.com/changelog/2026-04-22-clerk-cli

Questions? Drop them in the comments and I'll jump in. Cheers 👋
Clerks New CLI: Add Auth to Next.js Without Leaving Your TerminalStatic vs Dynamic Rendering in NextJs 13The easiest way to add videos in NextJsUsing TypeScript in NextJs 13Blurred placeholder for dynamic images in NextJsNextJs 13 Deep dive - Suspense, error boundaries, static vs dynamic rendering and moreThe easiest way to build an AI chatbot in NextJsSend Newsletter Emails Using Resend BroadcastsSync Clerk data to your app with webhooks [S2 E4]Stop Shipping AI Slop: CodeRabbit Reviews Your PRs Before You MergeStreamline design to code with RewebMaster nuqs in 1 hour — URL state in NextJs with creator François Best
Hamed Bahram |

Clerk's New CLI: Add Auth to Next.js Without Leaving Your Terminal

SHARE TO X SHARE TO REDDIT SHARE TO FACEBOOK WALLPAPER