Using CLI

Use the fest CLI to run a server entry in development or production.

Running the CLI

After installation:

fest

Without installation:

npx @hornjs/fest

Default Entry Resolution

When --entry is omitted, the CLI searches for common entry files such as:

  • server.ts
  • server.mjs
  • src/server.ts
  • src/server.mjs

If you want to run another filename or a .tsx entry, pass it explicitly.

Usage

fest <file>
fest <dir>
fest --entry <file>
fest --dir <dir>

Options:
  --entry <file>              Server entry file to use
  --dir <dir>                 Working directory for resolving entry files
  -h, --help                  Show this help message
  --version                   Show package and runtime versions
  -p, --port <port>           Port to listen on
  --host, --hostname <host>   Host to bind to
  -s, --static <dir>          Serve static files from a directory
  --prod                      Disable watch mode and use production env defaults
  --import <module>           Preload a module in Node.js or Bun
  --tls                       Enable TLS
  --cert <file>               TLS certificate file
  --key <file>                TLS private key file

Examples

Run a standard TypeScript entry

fest --entry ./server.ts

Run from a working directory

fest --dir ./apps/api

Use a positional entry

fest ./server.ts

Serve static files only

fest --static ./public

Start in production mode

fest --prod --entry ./server.ts

Run a JSX / TSX entry with jiti

JITI_JSX=1 fest --entry ./server.tsx --import jiti/register

--import is currently intended for Node.js and Bun. Deno does not use that flag in this CLI flow.

Environment Variables

  • PORT: default port when --port is omitted
  • HOST: default host when --host / --hostname is omitted
  • NODE_ENV: defaults to development or production based on --prod