@chaprola/cli
v1.0.0
Published
Command-line tool for bootstrapping Chaprola apps. `chaprola init <app>` clones the starter template, wires your credentials into .env, and commits a safe-by-default initial repo state where .env is gitignored from the first commit.
Maintainers
Readme
@chaprola/cli
Command-line tool for scaffolding Chaprola apps.
Install
npx @chaprola/cli init my-appOr globally:
npm install -g @chaprola/cli
chaprola init my-appUsage
chaprola init <app-name> [--template vanilla|react-auth]Templates
- vanilla (default) — minimal HTML/JS shell + HELLO.CS program.
- react-auth — Vite + React + TypeScript with
chaprola-authpre-wired (useAuth()hook,<AuthGate>,<LoginCard>, typed API client).
What init does
- Clones the selected template from
github.com/cletcher/chaprola-app-starterinto./<app-name>/. - Prompts interactively for your Chaprola username and API key (
chp_…). - Verifies the key against
GET /hellobefore writing anything sensitive to disk. - Copies
.env.example → .envwith your credentials filled in (mode 0600). - Sanity-checks that
.gitignoreactually excludes.env. - Runs
git init+ stages everything + creates the first commit. - Double-checks that
.envis NOT staged before committing. Bails loudly if anything went wrong.
By the time init finishes, your project state makes it structurally harder to leak an API key by accident. .env is gitignored from the first commit; it cannot appear in history.
Why this exists
On 2026-04-20 a user forgot to add .env to .gitignore and pushed two live chp_ keys to public GitHub. No amount of documentation prevents the next one. chaprola init starts every project in a safe-by-default state.
Requirements
- Node.js ≥ 18 (for built-in
fetch). giton PATH.
Future subcommands (not v1)
chaprola deploy <app-name>— wraps/app/deploy.chaprola logs— recent audit trail for your key.chaprola rotate— self-service key rotation.
License
MIT.
