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_KEY

What gets updated

The CLI atomically updates three locations so nothing drifts:

  1. .env — appends RESEND_API_KEY=<your_resend_api_key>
  2. .env.example — appends RESEND_API_KEY=
  3. 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_KEY

Scrubs the key from all three locations — no orphan references left behind.