@econneq/auth-cli
v1.0.8
Published
CLI — npx econneq-auth init
Downloads
1,142
Readme
@econneq/auth-cli
Interactive scaffolder for new Econneq Auth integrations. One command, a few prompts, a working auth/ folder.
Position in the install order
auth-cli (independent — no SDK packages required to run it)The CLI is standalone. You don't need auth-core, auth-react, or anything else installed to run it — it just generates files that depend on those packages. You'll install those after the CLI scaffolds your config.
Use without installing
cd project root
pnpm add -D @econneq/auth-cli
pnpm exec econneq-auth initor
npx @econneq/auth-cli init
# or, after global install:
npm install -g @econneq/auth-cli
econneq-auth initThe single command available today is init.
What init asks
| Prompt | Notes |
|---|---|
| Application name | Free text — used in generated comments |
| Auth API base URL | e.g. https://auth.example.com |
| Enable multi-tenant mode? | yes/no |
| Framework | Next.js, Remix, Vite, … |
| Token storage strategy | cookie / localStorage / memory |
| Auth methods | password, otp, oauth, … (multi-select) |
What init creates
src/auth/auth.config.ts # defineAuthConfig(...) populated from your answers
src/auth/provider.tsx # <AuthProvider> wrapper ready to mount
proxy.ts # Next.js middleware (only when Next.js was picked)After the CLI finishes, install the SDK packages it referenced:
npm install @econneq/auth-core @econneq/auth-react
# Next.js apps:
npm install @econneq/auth-nextjs
# If you want the hosted UI screens:
npm install @econneq/auth-uiThen mount the generated Providers component in your root layout and you're done.
Build
npm run build # tsup → dist/bin.js (and dist/index.js)
npm run typecheck
npm run dev # tsup --watchNotes
binis set todist/bin.js, sonpx @econneq/auth-cliand a globaleconneq-authshim both work after publish.- The generator is template-based — edit
src/templates/to change the scaffolded output. - Runs on Node — no React or browser globals required.
