Skip to main content

Prerequisites

Before installing Envark, ensure your system meets these requirements:
1

Node.js Version

Node.js 18.0.0 or higher is required
node --version
# Should output v18.0.0 or higher
2

Package Manager

One of: npm (comes with Node.js), yarn, pnpm, or bun
3

Terminal Access

A modern terminal that supports ANSI colors and Unicode characters for the best TUI experience
Envark requires Node.js 18+ as specified in package.json engines field. Earlier versions are not supported.

Installation Methods

Choose the installation method that works best for your workflow:

Quick Start (No Installation)

The fastest way to try Envark - no installation required:
npx envark
This method downloads and runs Envark in one command. Perfect for CI/CD pipelines or trying before installing.

Global Installation

Install Envark globally to run it from anywhere on your system:
npm install -g envark
After global installation, run Envark with:
envark

Project-Local Installation

Add Envark as a dev dependency to your project:
npm install --save-dev envark
Run via package.json scripts or npx:
package.json
{
  "scripts": {
    "env:check": "envark scan",
    "env:risk": "envark risk critical",
    "env:validate": "envark validate .env"
  }
}
Local installation is recommended for CI/CD integration to lock the Envark version with your project dependencies.

Build from Source

For development or contributing to Envark:
1

Clone Repository

git clone https://github.com/yourusername/envark.git
cd envark
2

Install Dependencies

npm install
3

Build TypeScript

npm run build
This compiles src/ to dist/ using TypeScript.
4

Run Development Version

# Run without building (uses bun)
npm run dev

# Or run the built version
npm start
The npm run dev command uses bun to run TypeScript directly from src/index.ts without compilation - great for rapid development.

Verify Installation

Confirm Envark is installed correctly:
envark --version
# Output: envark v0.1.1

MCP Server Configuration

To use Envark as an MCP server with AI-powered IDEs, you need to configure your IDE:

Automatic Configuration

Envark provides an init command that auto-configures supported IDEs:
envark init vscode
# Creates .vscode/mcp.json in current directory
If the config file already exists, Envark will print the configuration instead of overwriting. You’ll need to manually merge the settings.

Manual Configuration

If automatic configuration fails or you need custom settings, manually add Envark to your IDE’s MCP config:
{
  "servers": {
    "envark": {
      "type": "stdio",
      "command": "npx",
      "args": ["-y", "envark"]
    }
  }
}
Using npx -y envark ensures the latest version runs without installation. For locked versions, use a local installation and specify the path: "command": "node_modules/.bin/envark"

Restart Your IDE

After configuration, restart your IDE to load the MCP server:
1

Close all IDE windows

2

Reopen your project

3

Verify MCP connection

Check your IDE’s MCP server status panel. Envark should appear as “Connected”.

Configuration Files

Envark creates these files during operation:
PathPurpose
.envark/cache.jsonCached scan results with file hashes
.envark/ai-history.jsonAI conversation history (if using AI features)
Add .envark/ to your .gitignore to avoid committing cache files:
.gitignore
.envark/

Environment Variables for AI Features

If you plan to use Envark’s AI assistant, configure your preferred provider:
export OPENAI_API_KEY="sk-..."
You can also configure AI providers interactively in TUI mode with the /config command.

Troubleshooting

Command Not Found

If envark command is not recognized after global installation:
# Check npm global bin path is in your PATH
npm config get prefix
# Should output a directory like /usr/local or ~/.npm-global

# Add to PATH if needed (add to ~/.bashrc or ~/.zshrc)
export PATH="$(npm config get prefix)/bin:$PATH"

Permission Errors

On Linux/macOS, you might need sudo for global installation:
# Option 1: Use sudo (not recommended)
sudo npm install -g envark

# Option 2: Fix npm permissions (recommended)
mkdir ~/.npm-global
npm config set prefix '~/.npm-global'
export PATH=~/.npm-global/bin:$PATH
npm install -g envark

Node Version Too Old

Envark requires Node.js 18+. Upgrade with:
nvm install 18
nvm use 18

MCP Server Not Connecting

1

Verify config path

Ensure the MCP config file is in the correct location for your IDE
2

Check JSON syntax

Validate your MCP config JSON has no syntax errors
3

Test standalone

Run npx envark in terminal to verify Envark works outside the IDE
4

Check IDE logs

Look for MCP connection errors in your IDE’s developer console

Updating Envark

Keep Envark up to date for the latest features and bug fixes:
npm update -g envark
When using npx envark, you always get the latest version unless you specify a version: npx [email protected]

Next Steps

Now that Envark is installed, learn how to use it:

Quickstart Guide

Complete tutorial from first scan to advanced features

CLI Reference

Comprehensive command-line documentation

Build docs developers (and LLMs) love