Skip to main content

Environment Variables

Environment variables let you store configuration values like API keys, database URLs, and feature flags for your project. They are encrypted at rest and injected into the workspace when it starts.

How It Works

  1. You set environment variables on a project
  2. When a workspace starts, the variables are written to a .env file in the project directory
  3. Your application and the agent can read them from the environment
Environment variable values are encrypted at rest. When listing variables, only the keys are shown — values are hidden to prevent accidental exposure.

Setting Variables

Go to your project’s Settings > Environment Variables. Enter the key and value, then click Save.

Listing Variables

aether env list
Output shows keys only:
KEY                   SET
DATABASE_URL          Yes
STRIPE_SECRET_KEY     Yes
NEXT_PUBLIC_API_URL   Yes

Getting a Variable

aether env get DATABASE_URL
Returns the decrypted value for the specified key.

Deleting Variables

aether env delete STRIPE_SECRET_KEY

Importing from a File

You can import variables in bulk from a .env file:
aether env import .env.production
The file should use standard .env format:
# .env.production
DATABASE_URL=postgres://user:pass@host:5432/mydb
STRIPE_SECRET_KEY=sk_live_...
NEXT_PUBLIC_API_URL=https://api.example.com
Importing merges with existing variables. If a key already exists, its value is updated. Existing keys not in the file are left unchanged.

API Endpoints

For programmatic access, environment variables are available through the REST API:
MethodEndpointDescription
GET/projects/{id}/env-varsList all variable keys
GET/projects/{id}/env-vars/{key}Get a variable’s value
PUT/projects/{id}/env-vars/{key}Set or update a variable
DELETE/projects/{id}/env-vars/{key}Delete a variable
POST/projects/{id}/env-vars/importImport from .env format

Workspace Injection

When a workspace starts, all project environment variables are written to the .env file in the project’s working directory. This means:
  • Frameworks like Next.js, Vite, and Express automatically pick them up
  • The agent can reference them in code and configuration
  • Restarting the workspace refreshes the values from the latest project settings
If you update an environment variable while a workspace is running, the change takes effect on the next workspace restart. The .env file is only written during workspace startup.