Nvii is a secure environment variable management platform designed for modern development teams. It provides end to end encryption, version control, and seamless collaboration for managing environment variables across your projects. With Nvii, you can track changes, rollback to previous versions, manage branches, and ensure your sensitive configuration data remains secure.
Nvii offers a comprehensive set of features including:
Security: End to end encryption for all environment variables, secure authentication, device based session management
Version Control: Complete history tracking, version rollback capabilities, branch management for different environments
Collaboration: Team based access control, conflict resolution, synchronized updates across devices
Developer Experience: Intuitive CLI commands, dry run capabilities, automated conflict detection
Install Nvii globally using npm
on linux:
Before using Nvii, you need to authenticate and create or link a project. Here's a quick start workflow:
nvii loginnvii newnvii pushnvii pullAuthenticate and establish a secure session with Nvii. This command opens a browser window for authentication and stores your credentials locally.
The login process generates a unique confirmation code and establishes a secure connection. Your credentials are stored in your home directory for subsequent CLI operations.
Terminate your current session and clear authentication credentials from your local machine.
Options:
-u, --username <username>: Specify the username of the account to logout from
-e, --email <email>: Specify the email of the account to logout from
Examples:
Display information about the currently authenticated user, including username and email address.
This command helps verify your authentication status and confirms which account you're currently using.
Initialize a new project and configure environment variable management. This command reads your local .env file, encrypts the contents, and creates a new project in the Nvii platform.
The command will prompt you for:
Project name: A descriptive name for your project
Project description: Optional description explaining the project's purpose
After creation, your project is automatically linked to the current directory.
Connect the current directory to an existing remote project. This is useful when working on multiple machines or onboarding new team members.
Options:
-t, --token <id>: Specify a project ID to connect to directly
Examples:
The link command creates a .nvii directory in your current folder containing the project configuration.
Disconnect the current directory from its linked remote project. This removes the local .nvii configuration directory.
You'll be asked to confirm before the unlinking process completes. This operation only affects your local machine and doesn't delete the remote project.
Fetch and merge environment variables from the remote repository. This command retrieves the latest version from the server and updates your local .env file.
Options:
-f, --force: Force pull without conflict resolution prompts, automatically accepting remote values
-b, --branch <branch>: Pull from a specific branch (default: main)
-dry, --dry-run: Preview changes without applying them to your local file
Examples:
Conflict Resolution:
When conflicts are detected, Nvii will prompt you to choose between keeping your local value or accepting the remote value for each conflicting variable.
Upload local environment variable changes and create a new version. This command encrypts your local .env file and pushes it to the remote repository.
Options:
-m, --message <message>: Provide a version description message
-b, --branch <branch>: Push to a specific branch (default: main)
-dry, --dry-run: Preview changes without uploading
Examples:
The push command displays a summary of added, modified, and removed variables before creating the new version.
Synchronize local environment file with the latest remote version. This command updates your .env file to match the most recent version without interactive conflict resolution.
This is useful for quickly syncing when you know the remote version should take precedence.
Display version history and change log for the current project. This command shows all versions with their descriptions, authors, and timestamps.
Options:
-n, --limit <number>: Limit the number of versions to display (default: 10)
--oneline: Show condensed one line format for each version
--author <email>: Filter versions by author email or name
Examples:
Output Formats:
Default format shows detailed information including version ID, author, timestamp, and description message.
Oneline format provides a compact view: <version-id> <date> <author> <message>
Restore environment variables to a previous version state. This command updates your local .env file to match the content from a selected historical version.
Options:
-v, --version <id>: Specify a version ID to rollback to directly
-f, --force: Skip confirmation prompts
Examples:
The rollback command displays available versions and asks for confirmation before updating your local file. This operation doesn't delete any versions, it simply updates your working copy.
Consolidate multiple environment variable versions into the main branch. This command helps merge changes from feature branches back into your main branch.
Options:
-s, --source <branch>: Source branch to merge from
-t, --target <branch>: Target branch to merge into (default: main)
Examples:
Create a new branch from the current or specified version. Branches allow you to maintain separate environment configurations for different environments like development, staging, and production.
Options:
-n, --name <name>: Specify the branch name
-v, --version <id>: Base version ID to branch from (default: latest version)
Examples:
Branch names can contain letters, numbers, dots, underscores, hyphens, and slashes.
List all branches for the current project. This command displays all available branches with their base versions and creation dates.
The output shows:
Active branches marked with an asterisk
Current branch you're working on
Base version ID for each branch
Creation timestamp
Switch to a different branch. This command updates your local configuration to work with a specified branch.
Options:
-n, --name <name>: Branch name to switch to
Examples:
After switching branches, your subsequent push and pull operations will target the selected branch.
Create a new tag for the current or specified version. Tags provide named references to specific versions, useful for marking releases or significant milestones.
Options:
-n, --name <name>: Tag name to use
-v, --version <id>: Version ID to tag (default: latest version)
Examples:
Tag names can contain letters, numbers, dots, underscores, and hyphens. They're commonly used for semantic versioning (e.g., v1.0.0, v2.1.3).
List all tags for the current project. This command displays all tags with their associated version IDs, descriptions, and creation dates.
The output includes tag names, linked version IDs, optional descriptions, and timestamps.
Create a template .env file from your current environment variables. This command generates an example file with variable names but empty values, perfect for sharing with team members or documenting required variables.
Options:
-o, --output <file>: Specify output file path (default: .env.example)
--format <type>: Choose output format: env, json, or yaml (default: env)
Examples:
Output Formats:
env: Standard .env file format with empty values
json: JSON object with variable keys and empty string values
yaml: YAML format with variable keys and empty values
Verify encryption and decryption functionality. This command tests the encryption system by encrypting your environment variables and then decrypting them, displaying both versions.
This is primarily used for debugging and verifying that the encryption system is working correctly with your credentials.
Version Messages: Always provide descriptive messages when pushing changes, similar to git commit messages
Branch Strategy: Use branches for different environments (development, staging, production)
Regular Syncing: Pull changes before starting work and push when done to keep your team synchronized
Dry Run First: Use the dry run flag to preview changes before applying them, especially with pull operations
Tag Releases: Create tags for production releases to easily rollback if needed
Conflict Resolution: When conflicts occur, carefully review each variable to choose the correct value
If you're having trouble logging in, try logging out first and then logging in again:
If you see "Project not linked" errors, ensure you've linked your project:
If you encounter conflicts, you can either resolve them interactively or force pull with the remote values:
Ensure you have a .env or .env.local file in your current directory before running commands like push or generate.
Encryption: All environment variables are encrypted using end to end encryption before transmission
Device Authentication: Each device requires separate authentication for security
Local Storage: Credentials are stored securely in your home directory
Access Control: Project access is managed through team permissions
Version History: All changes are tracked and can be audited
Current CLI version: 1.0.3
Check your installed version: