Skip to main content

Overview

The lua env command provides an interactive interface for managing environment variables in both sandbox (development) and production environments.
Direct environment access lets you skip the selection prompt for faster workflows!
Full non-interactive mode with -k, -v, --list, and --delete flags for scripting and CI/CD.

Non-Interactive Mode

Sandbox Mode

Manage .env file locally

Production Mode

Manage variables on server via API

Interactive Menu

Add, update, delete, and view variables

Secure

Values masked in list view

Usage Modes

Default behavior - prompts for environment
Best for: When you’re not sure which environment

Quick Start

1

Run Command

2

Choose Environment (if interactive)

3

Manage Variables

  • βž• Add new variable
  • ✏️ Update existing
  • πŸ—‘οΈ Delete variable
  • πŸ‘οΈ View full value

Environment Selection

Local DevelopmentManages your .env file in the project directory.
Features:
  • βœ… No authentication required
  • βœ… Instant changes
  • βœ… Local file management
  • βœ… Used by lua test and lua chat
File location: PROJECT_ROOT/.env

Actions Available

Add New Variable

string
required
Must start with letter/underscore, contain only letters, numbers, underscores
string
required
Any string value (can include spaces, special characters)

Update Existing Variable

Delete Variable

Deletion requires confirmation to prevent accidents. Default is β€œNo”.

View Variable Value

Shows the full unmasked value for copying.

Variable Display

Variables are masked for security in the list view:
Masking rules:
  • Shows first 4 characters
  • Replaces rest with asterisks (max 20)
  • Values < 4 chars show only asterisks

Variable Naming Rules

Use in Development Workflow

Step 1: Configure Variables

Step 2: Test Locally

Step 3: Verify Production Config

Step 4: Deploy

Sandbox vs Production

Local Development
Add variables like:
Used by:
  • lua test
  • lua chat (sandbox mode)
  • Local development

Best Practices

Add to .gitignore:
Commit .env.example instead with placeholder values
Create .env.example:
Update sensitive keys every 90 days:
  • API keys
  • Database passwords
  • JWT secrets
  • Encryption keys

Example Session

Troubleshooting

Problem: Tool can’t find environment variableSolution:
Error: EACCES: permission deniedSolution:
Problem: Changes don’t persistSolutions:
  1. Verify API key: lua auth key
  2. Check network connection
  3. Try again
Error: Validation errorFix: Use valid format:
  • Start with letter or underscore
  • Only letters, numbers, underscores
  • No hyphens, spaces, or special characters

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