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 devDatabase Connection String
The database URL format depends on your database provider:
PostgreSQL:
postgresql://USER:PASSWORD@HOST:PORT/DATABASE
postgresql://postgres:mypassword@localhost:5432/myappMySQL:
mysql://USER:PASSWORD@HOST:PORT/DATABASE
mysql://root:mypassword@localhost:3306/myappMongoDB:
mongodb://USER:PASSWORD@HOST:PORT/DATABASE
mongodb://user:mypassword@localhost:27017/myappSQLite (for development):
file:./dev.dbOptions
| Option | Alias | Default | Description |
|---|---|---|---|
--template | -t | default | Project template to use |
--install | -i | true | Install dependencies |
--git | true | Initialize git repository | |
--db-url | Skip database prompt, use provided URL | ||
--admin-email | Skip email prompt, use provided email | ||
--yes | -y | false | Skip 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 --yesWhat Happens During Creation
-
Project Setup
- Creates project directory
- Copies template files
- Initializes package.json
-
Database Configuration
- Stores database URL in
.env.local - Creates Prisma schema
- Generates Prisma client
- Stores database URL in
-
Admin User Creation
- Hashes admin password with bcrypt
- Creates user in database
- Assigns admin role
-
Dependencies Installation
- Installs npm packages
- Sets up TypeScript
- Configures Next.js
-
Git Initialization
- Initializes git repository
- Creates initial commit
Available Templates
default- Standard DeesseJS setupblog- Blog starter with markdown supportecommerce- E-commerce template with products and paymentssaas- SaaS starter with subscriptions and authenticationminimal- Minimal configurationtypescript- TypeScript-first setup
init
Initialize DeesseJS in an existing Next.js project.
deessejs init [options]Options
| Option | Description |
|---|---|
--yes | Skip confirmation prompts |
What it does
- Creates
deesse.config.ts - Sets up the database schema
- Installs required dependencies
- Creates admin dashboard structure
- Generates TypeScript types
Example
# In an existing Next.js project
deessejs initdev
Start the development server.
deessejs dev [options]Options
| Option | Alias | Default | Description |
|---|---|---|---|
--port | -p | 3000 | Port number |
--turbo | false | Enable Turbopack | |
--inspect | Enable 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 --inspectbuild
Build the application for production.
deessejs build [options]Options
| Option | Description |
|---|---|
--debug | Enable debug mode |
--profile | Generate build profile |
Examples
# Standard build
deessejs build
# Build with profiling
deessejs build --profilestart
Start the production server.
deessejs start [options]Options
| Option | Alias | Default | Description |
|---|---|---|---|
--port | -p | 3000 | Port number |
Example
# Start production server
deessejs build
deessejs startDatabase Commands
db:push
Push schema changes to the database without creating a migration.
deessejs db:push [options]Options
| Option | Description |
|---|---|
--skip-generate | Skip TypeScript type generation |
--force-reset | Force reset the database |
Example
# Push schema changes
deessejs db:pushdb:pull
Pull the schema from the database.
deessejs db:pulldb:migrate
Create and apply database migrations.
deessejs db:migrate [options]Options
| Option | Description |
|---|---|
--name | Name of the migration |
--create-only | Create 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:migratedb:seed
Seed the database with sample data.
deessejs db:seed [options]Options
| Option | Description |
|---|---|
--file | Path to seed file |
Example
# Seed with default data
deessejs db:seed
# Seed with custom file
deessejs db:seed --file ./custom-seed.tsdb:studio
Open Prisma Studio to browse and edit your database.
deessejs db:studio [options]Options
| Option | Alias | Default | Description |
|---|---|---|---|
--port | -p | 5555 | Port for Prisma Studio |
Example
# Open Prisma Studio
deessejs db:studio
# Open on specific port
deessejs db:studio --port 6000db:reset
Reset the database (WARNING: This deletes all data).
deessejs db:reset [options]Options
| Option | Description |
|---|---|
--force | Skip confirmation |
--seed | Run seed after reset |
Examples
# Reset database
deessejs db:reset
# Reset and reseed
deessejs db:reset --seed
# Force reset without confirmation
deessejs db:reset --forcePlugin Commands
plugin:add
Add a plugin to your project.
deessejs plugin:add <plugin-name> [options]Options
| Option | Description |
|---|---|
--version | Specific 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-analyticsplugin:remove
Remove a plugin from your project.
deessejs plugin:remove <plugin-name>Example
deessejs plugin:remove @deessejs/plugin-seoplugin:list
List all installed plugins.
deessejs plugin:listExample 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
| Type | Alias | Description |
|---|---|---|
collection | col | Generate a collection |
component | comp | Generate a React component |
page | Generate a page | |
api | Generate an API route | |
hook | Generate a React hook | |
plugin | Generate 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-pluginCollection Generation
deessejs g collection <name> [options]Options:
--fields- Define fields (comma-separated)
Example:
deessejs g collection posts --fields title:string,content:text,published:booleanComponent Generation
deessejs g component <name> [options]Options:
--type- Component type (client|server)--path- Output path
Example:
deessejs g component Button --type clientUtility Commands
login
Login to your DeesseJS account.
deessejs loginExample Output
Press Enter to open the browser for authentication...
Waiting for authentication...
✓ Successfully authenticated as user@example.comlogout
Logout from your DeesseJS account.
deessejs logoutinfo
Display system information for debugging.
deessejs infoExample 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.tsversion
Show CLI version.
deessejs version
deessejs --version
deessejs -vExample Output
DeesseJS CLI v1.5.2
Core v1.3.0Advanced Options
Verbose Mode
Enable detailed logging for debugging:
deessejs <command> --verboseDebug Mode
Enable debug mode with extra logging:
deessejs <command> --debugAuto-Confirmation
Skip all confirmation prompts:
deessejs <command> --yes
deessejs <command> -yConfiguration 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
| Variable | Description |
|---|---|
DEESSEJS_API_URL | API URL for cloud features |
DEESSEJS_TOKEN | Authentication token |
DEESSEJS_TELEMETRY | Enable/disable telemetry (disabled or enabled) |
DATABASE_URL | Database connection string |
NEXT_PUBLIC_DEESSEJS_URL | Public URL for the app |
Exit Codes
| Code | Meaning |
|---|---|
0 | Success |
1 | General error |
2 | Command not found |
126 | Permission denied |
127 | Command not executable |
Troubleshooting
Command Not Found
If you get command not found:
# Use npx
npx deessejs <command>
# Or install globally
npm install -g @deessejs/cliPermission Errors
On Unix systems, you might need to use sudo:
sudo npm install -g @deessejs/cliCache Issues
Clear the CLI cache if you encounter issues:
rm -rf ~/.deessejsNext Steps
- Learn about CLI Overview
- Explore Admin Dashboard
- Discover Plugins