Skip to main content

Overview

Envark provides multiple execution modes to fit your workflow:
  • Interactive TUI - Full-featured terminal interface
  • Direct Commands - Run individual commands from the shell
  • MCP Server - Background service for AI assistants

Usage Patterns

# Launch interactive TUI
npx envark

# Run a specific command
npx envark scan

# Start MCP server (automatic)
echo "" | npx envark

Command Reference

envark

Launches the interactive TUI or starts the MCP server based on context.
envark
Behavior:
  • If stdin is a TTY (interactive terminal): Launch full TUI mode
  • If stdin is piped: Start MCP server for AI assistant integration
  • No arguments required
Exit codes:
  • 0 - Success
  • 1 - Fatal error

envark -i, —interactive

Explicitly launch interactive TUI mode.
envark -i
envark --interactive
envark tui
Aliases:
  • -i
  • --interactive
  • tui
Features:
  • Persistent readline interface
  • Command history (100 entries)
  • Tab completion
  • Dropdown command menu (/)
  • Real-time output rendering

envark init

Initialize MCP configuration for AI assistants.
envark init <ide>
ide
string
required
Target IDE or AI assistant platform.Options:
  • claude - Claude Desktop (default)
  • cursor - Cursor editor
  • vscode - Visual Studio Code
  • windsurf - Windsurf IDE
Examples:
envark init vscode
# Creates: .vscode/mcp.json
Configuration generated:
VS Code Format
{
  "servers": {
    "envark": {
      "type": "stdio",
      "command": "npx",
      "args": ["envark"]
    }
  }
}
Claude/Cursor/Windsurf Format
{
  "mcpServers": {
    "envark": {
      "command": "npx",
      "args": ["envark"]
    }
  }
}
Error handling:
  • If config file exists: Prints manual instructions without overwriting
  • If directory doesn’t exist: Creates parent directories automatically
  • Invalid IDE: Exits with code 1 and lists valid options

envark help

Display help information.
envark help
envark --help
envark -h
Aliases:
  • help
  • --help
  • -h
Shows complete usage information including:
  • Command list
  • Supported IDEs
  • Usage examples
  • Documentation links

envark version

Display version information.
envark version
envark --version
envark -v
Aliases:
  • version
  • --version
  • -v
Output:
argis v0.1.0
Note: The output currently shows “argis” - this is a known issue in the source code at src/index.ts:285.

Direct Command Execution

All TUI commands can be executed directly from the shell:
# Scan project
envark scan

# Analyze risks
envark risk high

# Find missing variables
envark missing

# Validate .env file
envark validate .env

# Generate template
envark generate .env.example
See TUI Commands for detailed documentation of each command.

Exit Codes

CodeMeaning
0Successful execution
1Fatal error or invalid arguments
Common error scenarios:
  • Unknown IDE in init command
  • File system errors during config creation
  • Unhandled exceptions in tool execution
  • Invalid command arguments

Environment Variables

Envark respects these environment variables:
OPENAI_API_KEY
string
OpenAI API key for AI assistant features.Used by: AI commands (/ask, /analyze, etc.)
ANTHROPIC_API_KEY
string
Anthropic API key for Claude integration.Used by: AI commands when OpenAI is not configured
GEMINI_API_KEY
string
Google Gemini API key.Alternative name: GOOGLE_API_KEYUsed by: AI commands when OpenAI/Anthropic not configured
OLLAMA_MODEL
string
Ollama model name for local AI.Default: llama3.2Used by: AI commands as fallback (no API key required)

Signal Handling

Envark gracefully handles termination signals: SIGINT (Ctrl+C):
  • In TUI mode: Displays goodbye message and exits
  • In MCP mode: Closes server connection cleanly
SIGTERM:
  • Closes MCP server connection
  • Exits with code 0

Working Directory

All commands operate on the current working directory by default:
# Scan current directory
envark scan

# Scan specific directory
cd /path/to/project
envark scan
In TUI mode, use the cd command to change directories:
# Inside TUI
 cd ../other-project
 scan

Performance

Typical command execution times:
Project SizeScan TimeRisk AnalysisValidation
Small (< 50 files)< 500ms< 200ms< 100ms
Medium (50-500 files)< 2s< 1s< 500ms
Large (> 500 files)2-5s1-3s< 1s
Caching:
  • Results cached in .envark/cache.json
  • Cache invalidated on file changes
  • Reduces subsequent scan times by 80%+

Examples

Quick Project Audit

# Run all critical checks
envark scan
envark risk critical
envark missing
envark validate .env

CI/CD Integration

GitHub Actions
name: Env Validation
on: [push, pull_request]

jobs:
  validate:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - uses: actions/setup-node@v3
      
      - name: Check for missing env vars
        run: npx envark missing
      
      - name: Validate production .env
        run: npx envark validate .env.production
      
      - name: Check for high-risk issues
        run: npx envark risk high

Pre-commit Hook

.git/hooks/pre-commit
#!/bin/sh

# Validate env files before commit
npx envark validate .env.example

if [ $? -ne 0 ]; then
  echo "❌ .env.example validation failed"
  exit 1
fi

echo "✅ Environment validation passed"

Docker Integration

Dockerfile
FROM node:20-alpine

WORKDIR /app
COPY package*.json ./
RUN npm install

COPY . .

# Validate env configuration
RUN npx envark validate .env.production
RUN npx envark risk critical

CMD ["npm", "start"]

Build docs developers (and LLMs) love