Overview
Envark features a sophisticated React/Ink-powered Terminal User Interface (TUI) that provides an interactive environment for managing your environment variables. The TUI supports multiple modes, intelligent command completion, and real-time feedback.Starting the TUI
- ASCII banner and version information
- Command input with autocomplete
- Real-time scanning feedback
- Color-coded output
UI Modes
The TUI operates in three distinct modes:- Normal Mode
- Config Wizard
- Chat Mode
Normal Mode is the default interface for running commands and viewing results.Features:
- Command dropdown with fuzzy matching
- Keyboard shortcuts for all commands
- Tab completion
- Command history
Available Commands
Scanning Commands
/scan
Shortcut: Displays:
sScan project for all environment variables- Total variables found
- Defined vs missing counts
- Critical issues summary
- Top 10 variables with status
/risk
Shortcut: Shows risk breakdown:
rAnalyze security and configuration risks- Critical, High, Medium, Low counts
- Top risky variables
- Issue details and recommendations
/missing
Shortcut: Identifies variables that:
mFind undefined but used variables- Are referenced in code
- Have no definition in .env files
- Have no default values
/duplicates
Shortcut:
dFind duplicate or conflicting definitionsValidation Commands
AI Commands
AI commands require an AI provider to be configured. Use
/ai-config to set one up.AI Command Reference
AI Command Reference
/chat - Interactive Chat Mode
/chat - Interactive Chat Mode
Shortcut: The AI assistant can:
chStart an interactive conversation with the AI assistant.- Answer questions about environment variables
- Explain best practices
- Help debug configuration issues
- Provide framework-specific advice
/ask - Quick Question
/ask - Quick Question
Shortcut:
aAsk a one-off question without entering chat mode./analyze - Environment Analysis
/analyze - Environment Analysis
Shortcut: Returns:
anGet AI-powered analysis of your entire environment configuration.- Summary of findings
- Security recommendations
- Best practice suggestions
/suggest - Variable Improvements
/suggest - Variable Improvements
Shortcut:
suGet suggestions for improving a specific variable./explain - Variable Documentation
/explain - Variable Documentation
Shortcut:
exGet detailed explanation about an environment variable./template - Generate Template
/template - Generate Template
Shortcut:
tplGenerate a .env template for your project type.Utility Commands
Keyboard Navigation
Arrow Keys
- ↑/↓ - Navigate command dropdown
- ↑/↓ - Navigate provider/model selection in wizard
Special Keys
- Enter - Execute command or select option
- Tab - Autocomplete selected command
- Ctrl+C - Cancel/Clear/Exit
- Backspace - Delete character
Command Dropdown
As you type/ followed by letters, Envark shows a filtered dropdown of matching commands:
The dropdown automatically hides AI commands if no provider is configured.
Output Formatting
Envark provides structured, color-coded output:Scan Results
Risk Analysis
Validation Results
Status Footer
The footer displays:- Current Envark version
- AI provider status (provider/model or “Not configured”)
- Current mode indicator
- Keyboard hints
AI Provider Configuration
Envark supports multiple AI providers with easy setup:- OpenAI
- Anthropic
- Google Gemini
- Ollama (Local)
Models Available:
- gpt-4o
- gpt-4-turbo
- gpt-4
- gpt-3.5-turbo
Tips and Best Practices
Use Shortcuts
Learn the single-letter shortcuts (
s, r, m, etc.) for faster workflow.Tab Completion
Press Tab to autocomplete commands from the dropdown instead of typing the full name.
Chat for Learning
Use
/chat mode to learn about environment variable best practices interactively.Clear Often
Use
/clear or c to clean up the output and keep your terminal focused.Architecture
The TUI is built with:- React - Component-based UI structure
- Ink - React renderer for terminal interfaces
- Three UI Modes - Normal, Config Wizard, Chat
- Real-time State Management - React hooks for responsive UI
- Persistent Configuration - AI settings saved to ~/.envark/
src/cli/app.tsx:1-724.