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
forge serve [OPTIONS]Options
| Option | Type | Default | Description |
|---|---|---|---|
--service | string | all | Service to start: api, web, admin, or all. |
--docker | flag | false | Run services inside Docker containers instead of locally. |
--port-api | number | 8080 | Port for the Rust API server. |
--port-web | number | 3000 | Port for the Next.js web frontend. |
--port-admin | number | 3001 | Port for the Next.js admin frontend. |
Examples
Start everything:
forge serveStart only the API on a custom port:
forge serve --service api --port-api 9090Run all services through Docker:
forge serve --dockerTIP
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
forge watch [OPTIONS]Options
| Option | Type | Default | Description |
|---|---|---|---|
--target | string | all | Watch target: api, web, admin, or all. |
--clear | flag | false | Clear the terminal before each rebuild. |
--delay | number | 300 | Debounce delay in milliseconds before triggering a rebuild. |
Examples
# Watch only the API with a 500 ms debounce
forge watch --target api --delay 500 --clearforge build
Create a production-optimized build for one or more services.
Usage
forge build [OPTIONS]Options
| Option | Type | Default | Description |
|---|---|---|---|
--target | string | all | Build target: api, web, admin, or all. |
--release | flag | false | Enable release-mode optimizations (Rust --release, Next.js production). |
--skip-types | flag | false | Skip TypeScript type checking during the frontend build. |
--docker | flag | false | Build Docker images instead of local artifacts. |
Examples
Full production build:
forge build --releaseDocker images only:
forge build --docker --releaseWARNING
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
forge test [OPTIONS]Options
| Option | Type | Default | Description |
|---|---|---|---|
--service | string | all | Service to test: api, web, admin, or all. |
--coverage | flag | false | Collect code coverage metrics. |
Examples
# Run all tests with coverage
forge test --coverage
# Test only the API
forge test --service apiforge lint
Run linters across the codebase. Uses clippy for Rust and eslint for Next.js.
Usage
forge lint [OPTIONS]Options
| Option | Type | Default | Description |
|---|---|---|---|
--service | string | all | Service to lint: api, web, admin, or all. |
--fix | flag | false | Automatically fix fixable issues. |
Examples
# Lint everything and auto-fix
forge lint --fixforge format
Check or apply code formatting. Uses rustfmt for Rust and prettier for Next.js.
Usage
forge format [OPTIONS]Options
| Option | Type | Default | Description |
|---|---|---|---|
--service | string | all | Service to format: api, web, admin, or all. |
--check | flag | false | Report formatting issues without writing changes. |
Examples
# Check formatting without modifying files
forge format --check
# Format the admin frontend only
forge format --service adminTIP
Run forge format --check in CI to ensure consistent formatting across the team.
See Also
- Project Commands — create and manage projects
- Database Commands — migrations and seeding
- Infrastructure Commands — Docker, SSL, hosts