Skip to content

llama-farm/corral

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

36 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ¦™ Corral

You don't add auth to your app. Your agent does.

npm License: MIT


⚑ Get Started in 10 Seconds

Copy this into your AI coding agent (Claude Code, Cursor, Codex, OpenClaw, Windsurf β€” anything):

Read: https://llama-farm.github.io/corral/llms.txt

Add auth and Stripe billing to my app. Free tier + Pro
at $29/mo with 14-day trial. Wire up everything: login,
signup, profile page, admin dashboard, upgrade banners,
and feature gating.

That's it. Your agent reads the spec, runs the CLI, wires the UI. You ship.


πŸ€” What Just Happened?

Your agent ran npx create-corral init, which:

  1. Detected your framework β€” Express, Next.js, Hono, Fastify, Koa, Vite+React, FastAPI, and 13+ more
  2. Embedded auth into your existing server β€” no new services, no Docker, same database
  3. Generated everything:
What File
Auth setup (Better Auth + your DB) src/lib/corral.ts
Login, signup, sessions, OAuth /api/auth/* routes
Profile page (edit name, password, delete account) src/components/ProfilePage.tsx
Admin dashboard (users, roles, plan overrides) src/components/AdminPanel.tsx
Account menu (dropdown for navbar) src/components/AccountMenu.tsx
Plan gating (<PlanGate>, <FeatureGate>, blur/block) src/gates.tsx
Auth hook + provider src/auth-context.tsx
Stripe checkout, billing portal, webhooks /api/corral/* routes
Agent integration guide CORRAL.md
Config (plans, features, meters, auth) corral.yaml
  1. Showed your agent the full feature list β€” so it proactively wires up profile pages, upgrade banners, and admin dashboards without you asking

🎁 Everything You Get

Ready to use (works immediately)

  • βœ… Email/password sign-up & sign-in
  • βœ… Social login (Google, GitHub, Apple, Discord + 6 more)
  • βœ… Magic link & email OTP (passwordless)
  • βœ… Session management, password reset, email verification

Generated components (your agent wires them up)

  • πŸ”Œ Account Menu β€” navbar dropdown: profile, settings, upgrade, admin, sign out
  • πŸ”Œ Profile Page β€” edit name, change password, manage email, delete account
  • πŸ”Œ Admin Dashboard β€” user list, role management, plan overrides, usage stats
  • πŸ”Œ Sign-in / Sign-up Pages β€” social buttons, magic link, OTP tabs
  • πŸ”Œ Upgrade Banner β€” shows free users what they're missing

Billing & monetization (Stripe-powered)

  • πŸ”Œ Pricing Table β€” auto-generated from corral.yaml, monthly/annual toggle
  • πŸ”Œ One-click upgrade β†’ Stripe Checkout β†’ back to your app
  • πŸ”Œ Billing Portal β€” manage subscription, invoices, payment method
  • πŸ”Œ Plan Gating β€” <PlanGate plan="pro"> with blur/skeleton/block modes
  • πŸ”Œ Usage Metering β€” track API calls, storage, etc. with per-plan limits
  • πŸ”Œ Free Trials β€” configurable per plan (default 14 days)

Developer & admin tools

  • πŸ”Œ Feature Flags β€” <FeatureGate feature="ai-chat"> per-plan toggling
  • πŸ”Œ CLI Auth β€” device authorization flow (like gh auth login)
  • πŸ”Œ API Keys β€” programmatic access for integrations
  • πŸ”Œ Deploy β€” corral deploy docker|fly|railway|render

πŸ”§ The 9-Command Workflow

Your agent runs these. You don't have to.

corral analyze --json          # 1. understand the project
corral init --yes --json       # 2. scaffold everything
corral add provider google     # 3. add OAuth
corral add plan pro --price 29 # 4. add paid plan
corral add feature ai --plans pro --gate blur  # 5. gate a feature
corral add meter api_calls --limit 10000       # 6. add usage meter
corral stripe sync --json      # 7. sync to Stripe
corral validate --json         # 8. verify everything
corral seed --env test --json  # 9. seed test users

Every command supports --json. Errors include a "fix" field. Exit 0 = deploy-ready.


πŸ“‹ More Prompts to Try

Just auth, no billing:

Read: https://llama-farm.github.io/corral/llms.txt
Add authentication to my app with email + Google login.

Add to existing project:

Read: https://llama-farm.github.io/corral/llms.txt
Add Corral auth + billing to this project. Detect my
framework and embed into my existing server.

Deploy:

Read: https://llama-farm.github.io/corral/llms.txt
Generate Docker + Railway deployment configs for this app.

πŸ—οΈ How It Works

Corral is not a hosted service. It's a CLI that generates code into your project.

  • One YAML config (corral.yaml) β€” plans, features, meters, auth providers
  • Embedded, not hosted β€” mounts as route handlers in your app, same DB, same process
  • Built on Better Auth + Stripe
  • Agent-native β€” llms.txt spec, CORRAL.md guide, --json everywhere, .corral/agent-checklist.json

Supported frameworks

Express Β· Hono Β· Fastify Β· Koa Β· Hapi Β· NestJS Β· Polka Β· Restify Β· AdonisJS Β· Elysia Β· H3/Nitro Β· Next.js Β· Vite+React Β· CRA Β· FastAPI Β· Django Β· Flask

Supported databases

SQLite (default) Β· PostgreSQL Β· MySQL Β· Turso/libSQL Β· Cloudflare D1


πŸ“– Docs

llama-farm.github.io/corral


License

MIT Β© LlamaFarm

Built for agents, works for humans too πŸ¦™

About

🐴 Auth + Billing + Gating in one YAML file. Embedded library, not a service.

Resources

License

Stars

Watchers

Forks

Sponsor this project

Packages

 
 
 

Contributors