nv CLI
Environment variable management with Vercel-like developer experience.
Installation
npm install -g nvenv-cli
bun add -g nvenv-cli
pnpm add -g nvenv-cli
Quick Start
nv login
nv list
nv link --workspace <workspace-id>
nv pull --env production
nv pull --env development --output .env.local
Commands
nv login
Authenticate with nv via browser. This will:
- Generate a unique verification code
- Open your browser for confirmation
- Save your authentication token locally
nv login
nv logout
Log out from your nv account and remove stored credentials.
nv logout
nv list (alias: ls)
List all your workspaces.
nv list
nv ls
nv link
Link the current directory to a workspace. Once linked, you can use nv pull without specifying the workspace ID.
nv link --workspace <workspace-id>
nv link
Options:
-w, --workspace <id> - Workspace ID to link
nv pull
Pull environment variables from a workspace and save them to a local file.
nv pull
nv pull --env production
nv pull --workspace <workspace-id> --env production
nv pull --env production --output .env.production.local
Options:
-e, --env <env> - Environment (production, preview, development). Default: development
-w, --workspace <id> - Workspace ID (optional if linked)
-o, --output <file> - Output file path. Default: .env.<env>.local
Configuration
The CLI stores configuration in your system's config directory:
- macOS:
~/Library/Preferences/nv-cli-nodejs
- Linux:
~/.config/nv-cli
- Windows:
%APPDATA%\nv-cli\Config
Configuration includes:
apiUrl - API endpoint (default: https://nvenv.dev)
accessToken - Authentication token
currentWorkspace - Linked workspace ID
Environment Variables
You can customize the API URL using an environment variable:
export NV_API_URL=https://your-nv-instance.com
nv login
Examples
Typical Workflow
nv login
nv list
nv link --workspace abc123
nv pull --env production
nv pull --env development --output .env.local
CI/CD Integration
For CI/CD environments, you can skip the link step by always specifying the workspace:
nv pull --workspace $WORKSPACE_ID --env production --output .env.production
License
MIT