#836·serve

Environment Variables by .env files for CLI

Author: vixsonCreated Nov 20, 2025Updated Nov 27, 2025

Description

Have some environment variables to control the behaviour of the CLI, e.g., PORT, HOST, SSL, DEBUG_LEVEL, etc.

dotenv
PORT=1234
HOST=123.456.890.1
CORS=*
DEBUG_LEVEL=nologs
DEBUG_LEVEL=true

Why

To be able to run the CLI command like serve src -nLC without directly specifying the host or port on the command.

> terminal

bash
serve src -nLC

.env

dotenv
PORT=3200
HOST=localhost

Instead of

> terminal

bash
serve src -l 3200 -nLC

This would make the CLI command shorter and easier to control

Alternatives

N/A