StackKit LogoStackKit
CLI

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 add

What happens when you run add

  1. StackKit reads your package.json to detect whether you're working in a Next.js, Express, or React project.
  2. You're shown a list of modules that are compatible with your framework.
  3. You select a module (and a provider, if applicable).
  4. StackKit writes the integration files into your project using the same paths as if you'd started with that module.
  5. Required packages are added and installed.
  6. New environment variables are appended to .env.example.

Running add never overwrites existing files unless you pass --force. Your current code is safe.

Options

FlagDescription
--provider <value>Specify a database provider (e.g., prisma-postgresql)
--forceOverwrite existing files if there are conflicts
--dry-runShow what would be generated without writing any files
--no-installSkip running the package manager after generating files
--yes, -ySkip confirmation prompts (module name must be provided)

Examples

Interactive setup (recommended):

npx stackkit@latest add

Add Prisma with PostgreSQL directly:

npx stackkit@latest add database --provider prisma-postgresql

Add Better Auth:

npx stackkit@latest add auth --provider better-auth

Preview changes without applying them:

npx stackkit@latest add --dry-run

Add files without installing packages:

npx stackkit@latest add --no-install

Available modules

Authentication

ModuleCompatible Frameworks
Better AuthNext.js, Express, React

Database

ModuleCompatible FrameworksNotes
PrismaExpressSupports PostgreSQL, MySQL, SQLite, MongoDB
MongooseExpressMongoDB only

UI

ModuleCompatible Frameworks
Shadcn UINext.js, React

Storage

ModuleCompatible Frameworks
CloudinaryExpress

Components

ModuleCompatible FrameworksNotes
ComponentsNext.js, ReactTypeScript 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.example with descriptions
  • Updates package.json with 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 doctor

Then update your .env file with any new variables that were added to .env.example.

On this page