gon env

Manage .env files on remote servers. Pull, push, or update individual variables.

Commands

gon env:pull [environment] # Download .env from server
gon env:push [environment] [--restart] # Upload .env to server
gon env:set KEY=VALUE [environment] # Set single variable on server

Default environment is production. Host is resolved from ~/.gon/servers.json.

env:pull

Downloads the remote .env and saves it locally as .env.production.

gon env:pull
gon env:pull staging

env:push

Uploads a local .env.{environment} file to the server. Shows confirmation before overwriting.

gon env:push # Upload .env.production
gon env:push --force # Skip confirmation
gon env:push --restart # Restart app + clear config cache

env:set

Update or add a single variable on the remote server. Automatically restarts the app and clears config cache.

gon env:set APP_DEBUG=true
gon env:set MAIL_HOST=smtp.example.com production