with one click
environment-variables
Add environment variable
Menu
Add environment variable
| name | environment-variables |
| description | Add environment variable |
This is how we add environment variables to the project:
Add to .env.example:
NEW_VARIABLE=value_example
Add to apps/web/env.ts:
// For server-only variables
server: {
NEW_VARIABLE: z.string(),
}
// For client-side variables
client: {
NEXT_PUBLIC_NEW_VARIABLE: z.string(),
}
experimental__runtimeEnv: {
NEXT_PUBLIC_NEW_VARIABLE: process.env.NEXT_PUBLIC_NEW_VARIABLE,
}
For client-side variables:
NEXT_PUBLIC_client and experimental__runtimeEnv sectionsAdd to turbo.json under globalDependencies:
{
"tasks": {
"build": {
"env": [
"NEW_VARIABLE"
]
}
}
}
examples:
input: |
API_KEY=your_api_key_here
server: { API_KEY: z.string(), }
"build": { "env": ["API_KEY"] } output: "Server-side environment variable properly added"
input: |
NEXT_PUBLIC_FEATURE_ENABLED=false
client: { NEXT_PUBLIC_FEATURE_ENABLED: z.coerce.boolean().default(false), }, experimental__runtimeEnv: { NEXT_PUBLIC_FEATURE_ENABLED: process.env.NEXT_PUBLIC_FEATURE_ENABLED, }
"build": { "env": ["NEXT_PUBLIC_FEATURE_ENABLED"] } output: "Client-side environment variable properly added"
references:
Cursor Cloud VM setup and service startup instructions for local development
Guidelines for implementing LLM (Language Model) functionality in the application
Guidelines for testing the application with Vitest, including unit tests, integration tests (emulator), AI tests, and eval suites for LLM features
Simplify and refine recently modified code for clarity, consistency, and maintainability while preserving exact behavior. Use when asked to simplify, polish, refactor lightly, or clean up current-session changes before review or PR.
Commit changes and open a pull request with safe metadata
Review prompt and tool-description changes in a branch or PR. Use when asked to audit system prompts, prompt builders, tool descriptions, prompt inputs, or nearby evals/tests; summarize what changed; identify guidance that feels eval-shaped or too heavy for product use; and find repeated instructions between the main prompt and tool descriptions.