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.
PORT=1234
HOST=123.456.890.1
CORS=*
DEBUG_LEVEL=nologs
DEBUG_LEVEL=trueWhy
To be able to run the CLI command like serve src -nLC without directly specifying the host or port on the command.
> terminal
serve src -nLC.env
PORT=3200
HOST=localhostInstead of
> terminal
serve src -l 3200 -nLCThis would make the CLI command shorter and easier to control
Alternatives
N/A
Source: vercel/serve