CLI · env
cem add env
Add a new environment variable everywhere it needs to exist — in a single command.
bash
cem add env RESEND_API_KEYWhat gets updated
The CLI atomically updates three locations so nothing drifts:
- .env — appends
RESEND_API_KEY=<your_resend_api_key> - .env.example — appends
RESEND_API_KEY= - src/app/config/index.ts — adds a typed entry, normalised to
lower_snake_case:
src/app/config/index.tsts
export default {
// ...
resend_api_key: process.env.RESEND_API_KEY,
};From anywhere in your app, you now have type-safe access:
ts
import config from '@/app/config';
await resend.send({ apiKey: config.resend_api_key, /* ... */ });Removing a variable
bash
cem remove env RESEND_API_KEYScrubs the key from all three locations — no orphan references left behind.