Skip to content

Development Commands

Development commands cover the day-to-day workflow — starting services, watching for changes, building for production, running tests, and enforcing code quality.

forge serve

Start one or more development servers. By default all services (API, web, admin) start together, each on its own port.

Usage

bash
forge serve [OPTIONS]

Options

OptionTypeDefaultDescription
--servicestringallService to start: api, web, admin, or all.
--dockerflagfalseRun services inside Docker containers instead of locally.
--port-apinumber8080Port for the Rust API server.
--port-webnumber3000Port for the Next.js web frontend.
--port-adminnumber3001Port for the Next.js admin frontend.

Examples

Start everything:

bash
forge serve

Start only the API on a custom port:

bash
forge serve --service api --port-api 9090

Run all services through Docker:

bash
forge serve --docker

TIP

When running without --docker, make sure PostgreSQL is accessible locally. FORGE reads the database URL from .env at the project root.


forge watch

Start a file watcher that triggers rebuilds on source changes. Useful when you need finer control than the built-in hot-reload of forge serve.

Usage

bash
forge watch [OPTIONS]

Options

OptionTypeDefaultDescription
--targetstringallWatch target: api, web, admin, or all.
--clearflagfalseClear the terminal before each rebuild.
--delaynumber300Debounce delay in milliseconds before triggering a rebuild.

Examples

bash
# Watch only the API with a 500 ms debounce
forge watch --target api --delay 500 --clear

forge build

Create a production-optimized build for one or more services.

Usage

bash
forge build [OPTIONS]

Options

OptionTypeDefaultDescription
--targetstringallBuild target: api, web, admin, or all.
--releaseflagfalseEnable release-mode optimizations (Rust --release, Next.js production).
--skip-typesflagfalseSkip TypeScript type checking during the frontend build.
--dockerflagfalseBuild Docker images instead of local artifacts.

Examples

Full production build:

bash
forge build --release

Docker images only:

bash
forge build --docker --release

WARNING

The --skip-types flag disables TypeScript strict checks. Use it only for rapid iteration — never for production builds.


forge test

Run the test suite for one or more services.

Usage

bash
forge test [OPTIONS]

Options

OptionTypeDefaultDescription
--servicestringallService to test: api, web, admin, or all.
--coverageflagfalseCollect code coverage metrics.

Examples

bash
# Run all tests with coverage
forge test --coverage

# Test only the API
forge test --service api

forge lint

Run linters across the codebase. Uses clippy for Rust and eslint for Next.js.

Usage

bash
forge lint [OPTIONS]

Options

OptionTypeDefaultDescription
--servicestringallService to lint: api, web, admin, or all.
--fixflagfalseAutomatically fix fixable issues.

Examples

bash
# Lint everything and auto-fix
forge lint --fix

forge format

Check or apply code formatting. Uses rustfmt for Rust and prettier for Next.js.

Usage

bash
forge format [OPTIONS]

Options

OptionTypeDefaultDescription
--servicestringallService to format: api, web, admin, or all.
--checkflagfalseReport formatting issues without writing changes.

Examples

bash
# Check formatting without modifying files
forge format --check

# Format the admin frontend only
forge format --service admin

TIP

Run forge format --check in CI to ensure consistent formatting across the team.


See Also

Released under the MIT License.