Skip to content

CLI

The Dolph CLI is an essential tool for initializing, developing, and maintaining DolphJS applications. Now completely rewritten in Rust for blazing-fast performance, it automates repetitive tasks such as generating boilerplate code for controllers, services, and components instantly.

You can install the Dolph CLI globally using your preferred package manager. pnpm is highly recommended.

Terminal window
pnpm add -g @dolphjs/cli

Scaffolds a new DolphJS project. It sets up the directory structure, handles package manager integrations, and generates a base dolph_config.yaml and entry point based on interactive prompts.

Terminal window
dolph new my-app

You can also use . to generate the project in your current directory:

Terminal window
dolph new .

Generates new files based on specific options. This is incredibly useful for maintaining a consistent architecture without manually creating and wiring classes.

Terminal window
dolph generate [OPTIONS]
Flag Full Option Description
-a --all <NAME> Generates all DolphJS files for the named parameter (Controller, Service, Model, etc.)
-c --controller <NAME> Generates a DolphJS controller file
-d --dto <NAME> Generates a DolphJS dto file
-e --entity <NAME> Generates a DolphJS entity file
-i --input <NAME> Generates a DolphJS input file
-k --socket <NAME> Generate a DolphJS socket service and component
-m --model <NAME> Generates a DolphJS models file
-r --route <NAME> Generates a DolphJS routes file
-s --service <NAME> Generates a DolphJS service file
-v --resolver <NAME> Generates a DolphJS resolver file
-y --component <NAME> Generates a DolphJS spring component file

Instead of generating individual files, you can generate everything required for a domain feature at once.

Terminal window
dolph generate --all users
# or
dolph generate -a users

This typically generates a bundled controller, service, model, and routes file for that specific domain depending on your architectural choice.

If you only need a specific file:

Terminal window
dolph generate --controller auth
dolph generate --service auth

The CLI also comes packed with native commands to run and build your DolphJS projects!

Starts the DolphJS server in development mode with hot-reloading enabled.

Terminal window
dolph watch

Builds your DolphJS TypeScript project into a JavaScript project optimized for production.

Terminal window
dolph build

Starts the compiled DolphJS server in production mode.

Terminal window
dolph start