CLI

Your environment, one command away

The nvault CLI is designed for WSL, SSH sessions, remote servers, cloud VMs and CI — anywhere a browser is inconvenient or unavailable.

CLI access requires a Pro or Team plan. nvault run (inject secrets without writing a file) is still on the roadmap.
new machine — bash
$ nvault login

Open:  https://nvaults.vercel.app/device
Code:  X7KD-29PL

Waiting for authentication...
✓ Device authenticated
$ nvault whoami
dev@acme.com  ·  2 projects

Installation

The CLI ships on npm as @lbharath/nvault — a single self-contained bundle with no transitive runtime dependencies. The installed command is nvault. Requires Node.js 20 or newer.

Install globally

npm install -g @lbharath/nvault
# or: pnpm add -g @lbharath/nvault
# or: yarn global add @lbharath/nvault

Run without installing

npx @lbharath/nvault --help

Handy on CI and throwaway machines where a global install is not worth it.

Verify the install

nvault --version
nvault --help

Homebrew, Scoop, and a curl | sh installer are planned for a later release. Until then, use npm or npx above.

Walkthrough

How you actually use it

Three workflows that cover almost everything: restore on a new machine, push a change, and run a command with secrets injected.

1. Restore a project

Clone the repo, cd in, and let init match the project from your Git remote. Nothing on disk is overwritten without a prompt.

portfolio-analytics — bash
$ git clone git@github.com:acme/portfolio-analytics.git
Cloning into 'portfolio-analytics'...
$ cd portfolio-analytics
$ nvault init
Git repository:   github.com/acme/portfolio-analytics
Matching project: portfolio-analytics

Restore 3 files?  .env  .env.local  .env.production
$ nvault pull
✓ Vault unlocked
✓ 3 files decrypted locally
✓ Environment restored

2. Push a change

Edit a file, push it, and it becomes a new version. Sensitive filenames get a warning before upload.

portfolio-analytics — bash
$ echo 'FEATURE_BILLING=1' >> .env.local
$ nvault push
2 files changed:  .env.local (v4)  .env (unchanged)
✓ Encrypted locally  ·  ✓ Uploaded
$ nvault history .env.local
v4  2026-08-27  1.2 KB  (current)
v3  2026-08-19  1.1 KB
v2  2026-08-04  1.1 KB

3. Run without a .env

nvault run decrypts in memory and injects the values into the child process. No file is written to disk. See the roadmap post.

portfolio-analytics — bash
$ nvault run -- npm run dev
✓ Vault unlocked  ·  injected 12 variables

> next dev
  ▲ Next.js — ready on http://localhost:3000

Command reference

nvault loginAuthenticate this device via a browser device-code flow — no password typed into the terminal.
nvault logoutRemove this device's stored credentials and revoke its session.
nvault whoamiPrint the account this device is authenticated as.
nvault projectsList the projects you have access to.
nvault initDetect the project from the Git remote and offer to restore its environment files.
nvault push [project]Encrypt and upload the config files in the current directory.
nvault pull [project]Download and decrypt files, with confirmation before overwriting anything local.
nvault files <project>List the files stored for a project and their current versions.
nvault history <file>Show the version history for a file.
nvault restore <file> --version <v>Restore a previous version as the current one.
nvault delete <project> <file>Delete a file from a project (the version history is retained).
nvault run -- <command>Inject decrypted secrets into a child process without writing a .env file to disk.

Credentials & configuration

Run nvault login to authenticate via a browser device-code flow — your account password is never typed into the terminal. For CI, create a scoped token in Settings → CLI Tokens and pass it with --token or NVAULT_TOKEN. The login persists in OS-appropriate secure storage. Your vault passphrase is a separate secret that unlocks encryption per session and is never stored.

Non-interactive use

Every command accepts --json for machine-readable output and returns a meaningful exit code. Pass --yes to skip confirmation prompts in automation, and --no-input to fail rather than prompt.

Using it in CI

CLI access requires a Pro or Team plan. For CI, create a scoped, revocable machine token in the web app (Settings → CLI Tokens) and expose it as NVAULT_TOKEN. Provide the vault passphrase as a masked secret. The runner fetches config for exactly one step and nothing is persisted into the workspace.

# GitHub Actions
- run: nvault run --project portfolio-analytics -- pnpm test
  env:
    NVAULT_TOKEN: ${{ secrets.NVAULT_TOKEN }}
    NVAULT_PASSPHRASE: ${{ secrets.NVAULT_PASSPHRASE }}

Design principles

  • Credentials are stored in OS-appropriate secure storage, never in plaintext config.
  • Authentication uses a browser/device flow — your account password is never typed into the CLI.
  • Tokens are not printed unnecessarily, keeping secrets out of shell history and scrollback.
  • Commands return meaningful exit codes and run non-interactively when asked.
  • Project detection is deterministic and explained: it tells you which remote matched which project.
  • Local files are never overwritten without an explicit prompt and a backup.

Availability

The web application and CLI are both available today. Web and CLI are backed by the same domain model, so behaviour stays identical across both. Read more in The CLI is a product, not an afterthought.