Documentation · Chapter 06

Keep secrets
out of Git.

.env configures one installation. .env.example documents expected keys without revealing real values.

No real secret is required: we configure reading-list with safe values.

Create the local environment

phpaml — zsh
aml env:init
aml env:set APP_DEBUG true
aml env:get APP_DEBUG
aml env:list

env:init copies .env.example. It refuses to overwrite an existing .env; --force deliberately replaces it. env:set also creates .env from the example when missing.

Starter variables

phpaml — zsh
APP_ENV=development
APP_DEBUG=false
APP_URL=http://localhost:8000
APP_KEY=
DATABASE_DRIVER=sqlite
DATABASE_DSN=sqlite:runtime/storage/database.sqlite
DATABASE_USER=root
DATABASE_PASSWORD=root
APP_DEBUGdebug details
APP_URLexpected public address
APP_KEYapplication secret
DATABASE_DSNtechnical database address
DATABASE_PASSWORDconnection secret

Two files, two responsibilities

.env.example

Committed. Contains names and fake or safe values. It helps a newcomer start.

.env

Ignored by Git. Contains real machine or server values. Never publish it.

Masking does not replace care

env:list masks keys ending with PASSWORD, SECRET, TOKEN, or KEY. env:get prints the requested value: avoid it while screen sharing.