CLI

Learn how to use the OnlyNv CLI.

The OnlyNv CLI is available from npm.

It can therefore be installed via the following:

npm install --global @onlynv/cli

Syntax

The CLI offers a variety of commands and subcommands.

Usage: nv <command> [options]

Commands:
  version, -v              Get the version of the CLI
  help, -h                 Show this help message
  ping, p                  Ping the platform
  link, l                  Link your project's environment
    --id                       The id of the project to link
  init, i                  Initialise a new project
    --authority                The authority URL where you would like to init a project.
  glob, g                  Search for included files
  open, o                  Open the project in the browser
  sync, s                  Sync your environment downstream
    --strategy                 The strategy to use for syncing
    --dry-run                  Dry run the command
    --skip-ci                  Skip CI sync
  type, t                  Generate types for your environment
    --target                   The target language for the types
    --dry-run                  Dry run the command
  strip, r                 Generate a blank environment file, stripping all secrets (required)
    --file                     The file to strip (required)
  stow, k                  Manage your authentication methods
    add                        Add a new key
      --key                      The key itself (required)
      --name, -n                 Name of the key
    remove                     Remove a key
      --id                       id or name of the key (required)
    get                        Get a key
      --id                       id or name of the key (required)
    list                       List all keys

You can get detailed explanations of each command here.

The Basics

To get a basic project up and running, there are 3 commands to run.

  1. nv init will initialise a new project and create your .lnvrc.
  2. nv link will generate a PAT (personal access token) and store your project's public key.
  3. nv sync will sync your env files with OnlyNv. You should now be able to see your files in the dashboard.

On this page