Documentation Index
Fetch the complete documentation index at: https://docs.heylua.ai/llms.txt
Use this file to discover all available pages before exploring further.
Overview
Thelua env command provides an interactive interface for managing environment variables in both sandbox (development) and production environments.
New in v2.6.0: Direct environment access lets you skip the selection prompt for faster workflows!
New in v3.3.0: Full non-interactive mode with
-k, -v, --list, and --delete flags for scripting and CI/CD.Non-Interactive Mode
| Option | Description |
|---|---|
--list | List all environment variables |
-k, --key <name> | Variable name |
-v, --value <val> | Variable value |
-d, --delete | Delete the specified variable |
Sandbox Mode
Manage
.env file locallyProduction Mode
Manage variables on server via API
Interactive Menu
Add, update, delete, and view variables
Secure
Values masked in list view
Usage Modes
- Interactive Mode
- Direct Mode - Sandbox
- Direct Mode - Production
Default behavior - prompts for environmentBest for: When youβre not sure which environment
Quick Start
Environment Selection
- Sandbox (.env)
- Production (API)
Local DevelopmentManages your Features:
.env file in the project directory.- β No authentication required
- β Instant changes
- β Local file management
- β
Used by
lua testandlua chat
PROJECT_ROOT/.envActions Available
Add New Variable
Must start with letter/underscore, contain only letters, numbers, underscores
Any string value (can include spaces, special characters)
Update Existing Variable
Delete Variable
View Variable Value
Variable Display
Variables are masked for security in the list view:- Shows first 4 characters
- Replaces rest with asterisks (max 20)
- Values < 4 chars show only asterisks
Variable Naming Rules
- Valid Names
- Invalid Names
Use in Development Workflow
Step 1: Configure Variables
Step 2: Test Locally
Step 3: Verify Production Config
Step 4: Deploy
Sandbox vs Production
- When to Use Sandbox
- When to Use Production
Local DevelopmentAdd variables like:Used by:
lua testlua chat(sandbox mode)- Local development
Best Practices
Use Different Keys per Environment
Use Different Keys per Environment
Never Commit .env
Never Commit .env
Add to Commit
.gitignore:.env.example instead with placeholder valuesDocument Required Variables
Document Required Variables
Create
.env.example:Rotate Secrets Regularly
Rotate Secrets Regularly
Update sensitive keys every 90 days:
- API keys
- Database passwords
- JWT secrets
- Encryption keys
Example Session
Troubleshooting
Variable not loading in tools
Variable not loading in tools
Problem: Tool canβt find environment variableSolution:
.env file permissions error
.env file permissions error
Error:
EACCES: permission deniedSolution:Production variables not saving
Production variables not saving
Problem: Changes donβt persistSolutions:
- Verify API key:
lua auth key - Check network connection
- Try again
Invalid variable name
Invalid variable name
Error: Validation errorFix: Use valid format:
- Start with letter or underscore
- Only letters, numbers, underscores
- No hyphens, spaces, or special characters
Related Commands
lua test
Uses sandbox environment variables
lua chat
Uses sandbox or production based on mode
lua push
Doesnβt include env vars (stored separately)
lua deploy
Uses production environment variables
Next Steps
Environment Variables Guide
Complete guide to configuration management
Test Your Skills
Test tools with your environment variables

