Skip to main content

nifectl orgenv Command Reference

Manage organisation env sets.

Overview​

An org env set is a named group of environment variables that belongs to an organisation. The orgenv commands list, show, create, update and delete these sets. They mirror the Global Envs tab in the nife.io dashboard.

Values are encrypted before they are sent and shown as ****** unless you ask for them with --reveal.

Subcommands​

SubcommandDescription
orgenv listList the env sets of an organization
orgenv showShow the variables of an env set
orgenv createCreate an env set
orgenv updateAdd, change or remove variables, or rename an env set
orgenv deleteDelete an env set
nifectl orgenv <subcommand> [flags]

Options​

--org string Slug of the organization (asked if you have more than one)
-h, --help Help for orgenv

Global Options​

-t, --access-token string Nife API Access Token
-j, --json JSON output format
-V, --verbose Verbose / debug output

orgenv list​

List the env sets of an organization.

List the env sets of an organization with the number of variables in each.

nifectl orgenv list [flags]

Options:

--org string Slug of the organization (asked if you have more than one)

orgenv show​

Show the variables of an env set.

Values are hidden unless you pass --reveal.

nifectl orgenv show NAME [flags]

Options:

--org string Slug of the organization (asked if you have more than one)
--reveal Show the values, not ******

Examples:

nifectl orgenv show shared-config --org acme --reveal

orgenv create​

Create an env set.

Create an env set from --env NAME=VALUE flags, a .env file, or both. The set name uses lowercase letters, numbers, '-' and '.'.

nifectl orgenv create NAME [flags]

Options:

--org string Slug of the organization (asked if you have more than one)
--env strings Variable in NAME=VALUE format (repeatable)
--from-file string Path to a .env file with NAME=VALUE lines

Examples:

nifectl orgenv create shared-config --org acme --env LOG_LEVEL=info --env REGION=ap-south-1
nifectl orgenv create shared-config --org acme --from-file .env

orgenv update​

Add, change or remove variables, or rename an env set.

Change an env set. Variables you do not mention stay as they are.

nifectl orgenv update NAME [flags]

Options:

--org string Slug of the organization (asked if you have more than one)
--env strings Variable to add or change, in NAME=VALUE format (repeatable)
--unset strings Name of a variable to remove (repeatable)
--from-file string Path to a .env file whose variables are added or changed
--rename string New name for the set

Examples:

nifectl orgenv update shared-config --org acme --env LOG_LEVEL=debug --unset OLD_FLAG
nifectl orgenv update shared-config --org acme --rename shared-config-v2

orgenv delete​

Delete an env set.

nifectl orgenv delete NAME [flags]

Options:

--org string Slug of the organization (asked if you have more than one)
-y, --yes Accept all confirmations

Examples:

nifectl orgenv delete shared-config --org acme

Best Practices​

  • Use --from-file .env so secret values do not end up in your shell history.
  • orgenv update leaves every variable you do not mention as it is; use --unset NAME to remove one and --rename to rename the set.
  • Set names use lowercase letters, numbers, - and ..
  • Pass --yes to orgenv delete in scripts to skip the confirmation.

See Also​

Summary​

Nifectl Orgenv keeps shared configuration in one place for the whole organisation, encrypted in transit and hidden by default.