stack/packages/init-stack
Shridhar Deshmukh 496d3bcf88
fix: --no-browser opening browser (#539)
The additional change [in
commander](007ab2b980)
caused an issue with the `--no-browser` option. Commander negates
boolean options with `--no` prefix -
https://www.npmjs.com/package/commander#other-option-types-negatable-boolean-and-booleanvalue


<!--

Make sure you've read the CONTRIBUTING.md guidelines:
https://github.com/stack-auth/stack-auth/blob/dev/CONTRIBUTING.md

-->

<!-- ELLIPSIS_HIDDEN -->

----

> [!IMPORTANT]
> Fixes `--no-browser` option in `index.ts` to correctly prevent browser
opening by adjusting boolean logic.
> 
>   - **Behavior**:
> - Fixes `--no-browser` option in `index.ts` to prevent browser opening
by setting `noBrowser` to `!options.browser`.
>   - **Misc**:
> - Adds comment explaining Commander negation behavior for boolean
options.
> 
> <sup>This description was created by </sup>[<img alt="Ellipsis"
src="https://img.shields.io/badge/Ellipsis-blue?color=175173">](https://www.ellipsis.dev?ref=stack-auth%2Fstack-auth&utm_source=github&utm_medium=referral)<sup>
for a1a3ba450d. It will automatically
update as commits are pushed.</sup>

<!-- ELLIPSIS_HIDDEN -->

---------

Co-authored-by: Konsti Wohlwend <n2d4xc@gmail.com>
Co-authored-by: Zai Shi <zaishi00@outlook.com>
2025-03-13 17:17:28 +01:00
..
src fix: --no-browser opening browser (#539) 2025-03-13 17:17:28 +01:00
.eslintrc.cjs Convert packages/init-stack to TypeScript (#465) 2025-02-25 23:02:25 +00:00
.gitignore Support create-next-app@15 with the setup wizard (#340) 2024-11-13 13:58:42 +01:00
CHANGELOG.md chore: update package versions 2025-03-12 19:03:12 -07:00
LICENSE Setup wizard 2024-04-24 12:20:31 +02:00
package.json chore: update package versions 2025-03-12 19:03:12 -07:00
README.md Allows for --no-browser in Stack Auth init command (#521) 2025-03-10 04:53:36 +01:00
tsconfig.json Convert packages/init-stack to TypeScript (#465) 2025-02-25 23:02:25 +00:00
tsup.config.ts Convert packages/init-stack to TypeScript (#465) 2025-02-25 23:02:25 +00:00
vitest.config.ts In-source unit tests (#429) 2025-02-14 11:47:52 -08:00

Stack Auth Initialization Tool

This package provides a command-line tool to initialize Stack Auth in your project.

Usage

npx init-stack [project-path] [options]

Options

  • --help, -h: Show help message
  • --dry-run: Run without making any changes
  • --neon: Use Neon database
  • --js: Initialize for JavaScript project
  • --next: Initialize for Next.js project
  • --npm: Use npm as package manager
  • --yarn: Use yarn as package manager
  • --pnpm: Use pnpm as package manager
  • --bun: Use bun as package manager
  • --client: Initialize client-side only
  • --server: Initialize server-side only
  • --no-browser: Don't open browser for environment variable setup

Environment Variables

  • STACK_DISABLE_INTERACTIVE: Set to any value to disable interactive prompts. Useful for CI/CD environments.

Examples

Initialize Stack Auth in a Next.js project without opening the browser:

npx init-stack --next --no-browser

Initialize Stack Auth in a JavaScript project with npm:

npx init-stack --js --npm

For more information, please visit Stack Auth Documentation.