Documentation previewThese docs are actively being built. Some pages may change as the framework and examples are finalized.
Skip to content

CLI Reference

This page lists common GoForj CLI commands and generated App command patterns.

Use workflow pages for full context.

Project Commands

CommandPurpose
forj newCreate a new generated GoForj App through the interactive wizard.
forj buildRun generation, Wire, API indexing, then go build.
forj run <app-command>Run generation, API indexing, then go run . <app-command>.
forj devRun local development watchers from .goforj.yml.
forj generateRefresh generated component code and derived files.
forj make:controller <name>Generate an HTTP controller and wire it into HTTP.
forj make:command <name>Generate an application command and wire it into the App command tree.
forj make:migration <name>Generate migration files for supported database drivers.

Inside a generated App, forj <command> is the normal development surface. Native GoForj commands take precedence. If no native command matches, GoForj delegates to the generated App through the same source-aware path as forj run <command>.

Use forj run <command> when you want to force App command execution explicitly, especially for scripts or command names that collide with native GoForj commands. Use ./bin/app <command> for the built binary and deployment/runtime process supervision.

Common App Commands

Run these as forj <command> during development or directly through ./bin/app <command> after build.

Prefer the short aliases in day-to-day commands. The canonical command names remain available.

PreferredCanonicalPurpose
apprunRun enabled App runtimes together.
apihttp:serveRun the HTTP runtime.
workerqueue:workRun queue workers.
schedulerschedule:runRun the scheduler runtime.
route:listroute:listList registered HTTP routes.
migratemigrateRun database migrations.
migrate:rollbackmigrate:rollbackRoll back recent migrations.
dbdb:shellOpen a database shell for a configured connection.
make:eventmake:eventGenerate an event type.
make:jobmake:jobGenerate a queue job and wire it into jobs.
make:schedulemake:scheduleGenerate a scheduled task and wire it into the scheduler.
make:modelmake:modelGenerate a model and repository when database support is enabled.

Examples:

bash
forj app
forj api
forj worker
forj scheduler
forj route:list
forj db
forj make:job reports:generate
forj make:schedule reports:daily --every 24h

./bin/app run
./bin/app api
./bin/app worker
./bin/app scheduler
./bin/app db

These resolve to generated App commands through Kong aliases.

Available commands depend on selected components.

Database shell examples:

bash
forj db
forj db analytics
forj db --method compose
forj db --print
forj db --exec "select count(*) from users"
forj db -- --batch -e "select count(*) from users"
forj db analytics -- -c "select count(*) from events"

Controller, command, and migration generation are project-level forj commands:

bash
forj make:controller users
forj make:command reports:reconcile
forj make:migration create_users

Maintainer Commands

These are mainly for framework contributors:

CommandPurpose
forj test:render -sRender a disposable App, build it, and run tests.
forj test:integrationRun framework and rendered integration suites.
forj test:openapiValidate generated OpenAPI behavior.