add
Add a database, authentication, UI library, or other module to an existing project.
The add command lets you integrate a new module into a project you've already started — whether it was created with StackKit or not.
Usage
npx stackkit@latest add [module] [options]Run it without arguments for interactive mode. StackKit will automatically detect your framework and show only the modules that are compatible with your project.
npx stackkit@latest addWhat happens when you run add
- StackKit reads your
package.jsonto detect whether you're working in a Next.js, Express, or React project. - You're shown a list of modules that are compatible with your framework.
- You select a module (and a provider, if applicable).
- StackKit writes the integration files into your project using the same paths as if you'd started with that module.
- Required packages are added and installed.
- New environment variables are appended to
.env.example.
Running add never overwrites existing files unless you pass --force. Your current code is safe.
Options
| Flag | Description |
|---|---|
--provider <value> | Specify a database provider (e.g., prisma-postgresql) |
--force | Overwrite existing files if there are conflicts |
--dry-run | Show what would be generated without writing any files |
--no-install | Skip running the package manager after generating files |
--yes, -y | Skip confirmation prompts (module name must be provided) |
Examples
Interactive setup (recommended):
npx stackkit@latest addAdd Prisma with PostgreSQL directly:
npx stackkit@latest add database --provider prisma-postgresqlAdd Better Auth:
npx stackkit@latest add auth --provider better-authPreview changes without applying them:
npx stackkit@latest add --dry-runAdd files without installing packages:
npx stackkit@latest add --no-installAvailable modules
Authentication
| Module | Compatible Frameworks |
|---|---|
| Better Auth | Next.js, Express, React |
Database
| Module | Compatible Frameworks | Notes |
|---|---|---|
| Prisma | Express | Supports PostgreSQL, MySQL, SQLite, MongoDB |
| Mongoose | Express | MongoDB only |
UI
| Module | Compatible Frameworks |
|---|---|
| Shadcn UI | Next.js, React |
Storage
| Module | Compatible Frameworks |
|---|---|
| Cloudinary | Express |
Components
| Module | Compatible Frameworks | Notes |
|---|---|---|
| Components | Next.js, React | TypeScript only |
What gets generated
The exact output depends on the module, but every add operation:
- Writes configuration and client files to the correct locations
- Appends new variables to
.env.examplewith descriptions - Updates
package.jsonwith required dependencies - Installs packages with your detected package manager
For module-specific details, see the Modules section.
After adding a module
Run doctor to verify everything is configured correctly:
npx stackkit doctorThen update your .env file with any new variables that were added to .env.example.