DeesseJS

CLI Commands

Complete reference for all DeesseJS CLI commands

CLI Commands

Complete reference for all DeesseJS CLI commands.

create

Create a new DeesseJS project with interactive setup.

deessejs create <project-name> [options]

Interactive Prompts

The command will guide you through the setup process:

npx create-deesse-app my-app

# Step-by-step prompts:
? Enter your database connection string: postgresql://user:password@localhost:5432/mydb
? Create first admin user
? Admin email: admin@example.com
? Admin password: ********
? Confirm password: ********

 Database configured
 Admin user created
 Project created successfully

cd my-app
npm run dev

Database Connection String

The database URL format depends on your database provider:

PostgreSQL:

postgresql://USER:PASSWORD@HOST:PORT/DATABASE
postgresql://postgres:mypassword@localhost:5432/myapp

MySQL:

mysql://USER:PASSWORD@HOST:PORT/DATABASE
mysql://root:mypassword@localhost:3306/myapp

MongoDB:

mongodb://USER:PASSWORD@HOST:PORT/DATABASE
mongodb://user:mypassword@localhost:27017/myapp

SQLite (for development):

file:./dev.db

Options

OptionAliasDefaultDescription
--template-tdefaultProject template to use
--install-itrueInstall dependencies
--gittrueInitialize git repository
--db-urlSkip database prompt, use provided URL
--admin-emailSkip email prompt, use provided email
--yes-yfalseSkip prompts (use defaults)

Examples

# Create with interactive prompts
deessejs create my-app

# Create with database URL (skip prompt)
deessejs create my-app --db-url "postgresql://user:pass@localhost:5432/mydb"

# Create with admin email
deessejs create my-app --admin-email "admin@example.com"

# Create with specific template
deessejs create my-app --template blog

# Create without installing dependencies
deessejs create my-app --no-install

# Create and skip all prompts (not recommended - you'll need to configure manually)
deessejs create my-app --yes

What Happens During Creation

  1. Project Setup

    • Creates project directory
    • Copies template files
    • Initializes package.json
  2. Database Configuration

    • Stores database URL in .env.local
    • Creates Prisma schema
    • Generates Prisma client
  3. Admin User Creation

    • Hashes admin password with bcrypt
    • Creates user in database
    • Assigns admin role
  4. Dependencies Installation

    • Installs npm packages
    • Sets up TypeScript
    • Configures Next.js
  5. Git Initialization

    • Initializes git repository
    • Creates initial commit

Available Templates

  • default - Standard DeesseJS setup
  • blog - Blog starter with markdown support
  • ecommerce - E-commerce template with products and payments
  • saas - SaaS starter with subscriptions and authentication
  • minimal - Minimal configuration
  • typescript - TypeScript-first setup

init

Initialize DeesseJS in an existing Next.js project.

deessejs init [options]

Options

OptionDescription
--yesSkip confirmation prompts

What it does

  1. Creates deesse.config.ts
  2. Sets up the database schema
  3. Installs required dependencies
  4. Creates admin dashboard structure
  5. Generates TypeScript types

Example

# In an existing Next.js project
deessejs init

dev

Start the development server.

deessejs dev [options]

Options

OptionAliasDefaultDescription
--port-p3000Port number
--turbofalseEnable Turbopack
--inspectEnable Node inspector

Examples

# Start on default port
deessejs dev

# Start on specific port
deessejs dev --port 4000

# Start with Turbopack
deessejs dev --turbo

# Start with inspector
deessejs dev --inspect

build

Build the application for production.

deessejs build [options]

Options

OptionDescription
--debugEnable debug mode
--profileGenerate build profile

Examples

# Standard build
deessejs build

# Build with profiling
deessejs build --profile

start

Start the production server.

deessejs start [options]

Options

OptionAliasDefaultDescription
--port-p3000Port number

Example

# Start production server
deessejs build
deessejs start

Database Commands

db:push

Push schema changes to the database without creating a migration.

deessejs db:push [options]

Options

OptionDescription
--skip-generateSkip TypeScript type generation
--force-resetForce reset the database

Example

# Push schema changes
deessejs db:push

db:pull

Pull the schema from the database.

deessejs db:pull

db:migrate

Create and apply database migrations.

deessejs db:migrate [options]

Options

OptionDescription
--nameName of the migration
--create-onlyCreate migration without applying

Examples

# Create and apply migration
deessejs db:migrate --name add_user_table

# Create migration only
deessejs db:migrate --name add_posts --create-only

# Apply pending migrations
deessejs db:migrate

db:seed

Seed the database with sample data.

deessejs db:seed [options]

Options

OptionDescription
--filePath to seed file

Example

# Seed with default data
deessejs db:seed

# Seed with custom file
deessejs db:seed --file ./custom-seed.ts

db:studio

Open Prisma Studio to browse and edit your database.

deessejs db:studio [options]

Options

OptionAliasDefaultDescription
--port-p5555Port for Prisma Studio

Example

# Open Prisma Studio
deessejs db:studio

# Open on specific port
deessejs db:studio --port 6000

db:reset

Reset the database (WARNING: This deletes all data).

deessejs db:reset [options]

Options

OptionDescription
--forceSkip confirmation
--seedRun seed after reset

Examples

# Reset database
deessejs db:reset

# Reset and reseed
deessejs db:reset --seed

# Force reset without confirmation
deessejs db:reset --force

Plugin Commands

plugin:add

Add a plugin to your project.

deessejs plugin:add <plugin-name> [options]

Options

OptionDescription
--versionSpecific version to install

Examples

# Install official plugin
deessejs plugin:add @deessejs/plugin-seo

# Install with specific version
deessejs plugin:add @deessejs/plugin-seo --version ^1.0.0

# Install community plugin
deessejs plugin:add deessejs-plugin-analytics

plugin:remove

Remove a plugin from your project.

deessejs plugin:remove <plugin-name>

Example

deessejs plugin:remove @deessejs/plugin-seo

plugin:list

List all installed plugins.

deessejs plugin:list

Example Output

Installed Plugins:
├── @deessejs/plugin-seo (1.2.0)
├── @deessejs/plugin-media (2.0.1)
└── @deessejs-plugin-analytics (0.5.0)

Generation Commands

generate

Generate code for collections, components, and more.

deessejs generate <type> <name> [options]
deessejs g <type> <name> [options]

Types

TypeAliasDescription
collectioncolGenerate a collection
componentcompGenerate a React component
pageGenerate a page
apiGenerate an API route
hookGenerate a React hook
pluginGenerate a plugin

Examples

# Generate a collection
deessejs g collection posts

# Generate a component
deessejs g component Button

# Generate an API route
deessejs g api webhooks

# Generate a plugin
deessejs g plugin my-plugin

Collection Generation

deessejs g collection <name> [options]

Options:

  • --fields - Define fields (comma-separated)

Example:

deessejs g collection posts --fields title:string,content:text,published:boolean

Component Generation

deessejs g component <name> [options]

Options:

  • --type - Component type (client | server)
  • --path - Output path

Example:

deessejs g component Button --type client

Utility Commands

login

Login to your DeesseJS account.

deessejs login

Example Output

Press Enter to open the browser for authentication...
Waiting for authentication...
✓ Successfully authenticated as user@example.com

logout

Logout from your DeesseJS account.

deessejs logout

info

Display system information for debugging.

deessejs info

Example Output

System:
  OS: Windows 10 10.0.19045
  CPU: (12) x64 Intel(R) Core(TM) i7-9750H
  Memory: 15.9 GB / 31.9 GB
Binaries:
  Node: 20.11.0
  npm: 10.2.4
  pnpm: 8.15.0
  yarn: 1.22.19
DeesseJS:
  CLI: 1.5.2
  Core: 1.3.0
  Config: ./deesse.config.ts

version

Show CLI version.

deessejs version
deessejs --version
deessejs -v

Example Output

DeesseJS CLI v1.5.2
Core v1.3.0

Advanced Options

Verbose Mode

Enable detailed logging for debugging:

deessejs <command> --verbose

Debug Mode

Enable debug mode with extra logging:

deessejs <command> --debug

Auto-Confirmation

Skip all confirmation prompts:

deessejs <command> --yes
deessejs <command> -y

Configuration Files

deesse.config.ts

Main configuration file for your DeesseJS application.

import { defineConfig } from '@deessejs/core'

export const config = defineConfig({
  // Configuration options
})

.deessejsrc

CLI-specific configuration (in project root).

{
  "defaultCommand": "dev",
  "port": 3000,
  "turbo": false
}

Environment Variables

VariableDescription
DEESSEJS_API_URLAPI URL for cloud features
DEESSEJS_TOKENAuthentication token
DEESSEJS_TELEMETRYEnable/disable telemetry (disabled or enabled)
DATABASE_URLDatabase connection string
NEXT_PUBLIC_DEESSEJS_URLPublic URL for the app

Exit Codes

CodeMeaning
0Success
1General error
2Command not found
126Permission denied
127Command not executable

Troubleshooting

Command Not Found

If you get command not found:

# Use npx
npx deessejs <command>

# Or install globally
npm install -g @deessejs/cli

Permission Errors

On Unix systems, you might need to use sudo:

sudo npm install -g @deessejs/cli

Cache Issues

Clear the CLI cache if you encounter issues:

rm -rf ~/.deessejs

Next Steps

On this page