nvenv-cli
v0.1.3
Published
nv CLI - Environment variable management with Vercel-like DX
Maintainers
Readme
nv CLI
Environment variable management with Vercel-like developer experience.
Installation
npm install -g nvenv-cli
# or
bun add -g nvenv-cli
# or
pnpm add -g nvenv-cliQuick Start
# Authenticate with your nv account
nv login
# List your workspaces
nv list
# Link to a workspace
nv link --workspace <workspace-id>
# Pull environment variables
nv pull --env production
# Pull to a custom file
nv pull --env development --output .env.localCommands
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 loginnv logout
Log out from your nv account and remove stored credentials.
nv logoutnv list (alias: ls)
List all your workspaces.
nv list
# or
nv lsnv link
Link the current directory to a workspace. Once linked, you can use nv pull without specifying the workspace ID.
# Link to a workspace
nv link --workspace <workspace-id>
# Show current linked workspace
nv linkOptions:
-w, --workspace <id>- Workspace ID to link
nv pull
Pull environment variables from a workspace and save them to a local file.
# Pull development variables (default)
nv pull
# Pull production variables
nv pull --env production
# Pull from a specific workspace
nv pull --workspace <workspace-id> --env production
# Save to a custom file
nv pull --env production --output .env.production.localOptions:
-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 tokencurrentWorkspace- 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 loginExamples
Typical Workflow
# 1. Login
nv login
# 2. List workspaces to find the one you need
nv list
# 3. Link to your project workspace
nv link --workspace abc123
# 4. Pull production variables
nv pull --env production
# 5. Pull development variables for local development
nv pull --env development --output .env.localCI/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.productionLicense
MIT
