Skip to main content

Command Line

Pashmak provides a CLI with commands for starting your application and scaffolding new features.


start

Starts one or more application services.

pashmak start [options]

At least one option must be provided. If none are given, the CLI will print a usage hint.

Options

OptionDescription
--httpStart the HTTP server
--schedulerStart the cron/task scheduler
--cronAlias for --scheduler
--queueStart all configured queue workers
--allStart all services (HTTP, scheduler, and queues)

Examples

# Start only the HTTP server
pashmak start --http

# Start the HTTP server and queue workers
pashmak start --http --queue

# Start everything
pashmak start --all

create feature

Scaffolds a new feature folder under src/app/features/<name>/.

Aliases: make feature

pashmak create feature [options] [FeatureName]

If FeatureName is omitted you will be prompted to enter it. If no flags are provided, an interactive checkbox lets you pick which parts to generate.

Options

OptionDescription
--allGenerate all feature files
--controllerCreate a controller
--serviceCreate a service
--repositoryCreate a repository
--modelCreate a model
--query-scopesCreate query scopes
--validationsCreate controller validations
--queueCreate a queue handler
--cronCreate a cron job
--migrationCreate a database migration file

Generated files

Depending on the flags used, the following files are created inside src/app/features/<featureName>/:

FileFlag
index.tsalways
<Name>Controller.ts--controller
<Name>Service.ts--service
<Name>Repository.ts--repository
<Name>Model.ts--model
<Name>QueryScopes.ts--query-scopes
<Name>Validations.ts--validations
<Name>Queue.ts--queue
<Name>Cron.ts--cron
src/database/migrations/...--migration

Post-generation, the command automatically:

  • Registers the controller route in src/routes.ts (if --controller)
  • Exports the model in src/app/models/index.ts (if --model)
  • Adds the queue listener (if --queue)
  • Adds the cron entry to src/schedules.ts (if --cron)

Examples

# Scaffold everything for a new "BlogPost" feature
pashmak create feature --all BlogPost

# Scaffold only a controller and service
pashmak create feature --controller --service Product

# Interactive mode – prompts for name and parts
pashmak create feature

# Use the alias
pashmak make feature --all Order