feat: add a non-interactive seamless init - #156
Merged
Conversation
`--yes` (-y) answers every question with the option the prompt marks as recommended, so a scaffold runs from CI, a Dockerfile, or a script with no terminal attached. Each question also gets its own flag, honored with or without --yes: --web and --api choose the starters (by id or alias), --email sets the owner who becomes the admin, --auth picks how the auth server runs, and --admin picks where the console is hosted. Values are validated against the registry and the known modes in runCLI, before a directory is created. --yes stops rather than guessing in three places. Managed or local needs --app or --local, because that decides where the project's auth lives for good. Scaffolding into a non-empty directory needs --force, because starter files overwrite anything with the same name. Rotating an application's existing service token needs --force, because it breaks whatever is deployed on the old one. init's argument parsing moves into parseInitArgs so the new switches are not mistaken for template flags or for the project name. Closes #152
This was referenced Aug 1, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #152. Part of #154. Stacked on #155, review that first (this PR's diff is only its own commit).
The core item on the feedback list:
inithad no flag form for email, auth mode, or admin mode, so it could not run from CI, a Dockerfile, or a script without allocating a pty. The workaround was anexpectscript, which required knowing the prompt order, which required reading the source.Flags
--yes(-y) answers every remaining question with the option its prompt marks(recommended). Each question also gets its own flag, honored with or without--yes:--yes--web=<id|alias>--api=<id|alias>--email=<address>--auth=<docker|local>docker--admin=<api|image|source|none>apiThe template defaults come from registry order rather than a hardcoded id, so they stay a registry concern. Values are validated in
runCLI(against the registry for--web/--api, against the mode lists for--auth/--admin) before a directory is created, so a bad value never leaves a husk behind.What
--yeswill not decideThree things it stops on instead of guessing:
--localnor--app <id>. That decides where the project's auth lives for good.--force. The comment ininitMode.tsalready said the option hint is not consent, and a blanket "assume yes" is not either.--force.A template that would prompt for OAuth provider credentials is scaffolded with none configured (there is no flag form for a per-provider secret) and says so.
Parsing
init's argument handling moves out of the dispatcher intoparseInitArgs. The old code treated every--argument that was not--localas a template alias, so any new switch would have been read as a template name.Checks
npm run buildandnpm testpass (781 passed, 4 skipped). Smoke-tested end to end with stdin closed: a full scaffold with no prompts, plus each guard rail (missing--email, non-empty directory without--force, bad--adminvalue) failing with the right message and leaving nothing on disk.