Projects and workspaces

Create or select a workspace

Create a workspace, and choose which workspace CLI commands use when you belong to several

A workspace holds a team's members, billing, secrets and variables. Nevia creates one on your first sign-in. While you belong to one workspace, every command uses it.

If you belong to several, tell the CLI which one to use. You can pass it on a single command, set it for a shell or a directory, or save a default.

Create a workspace

A new workspace starts empty, with its own members, billing, secrets and variables:

nevia workspace create --name acme --use
nevia whoami

You are the new workspace's admin. --use saves its ID as your default, as below.

Find the ID

nevia whoami

Copy the full ID of the workspace and use it in place of 01d4cnjjq40hnnh0nwmkg35nv2h below.

Save a default

nevia workspace use 01d4cnjjq40hnnh0nwmkg35nv2h
nevia workspace current

use writes the default to your user config.toml. current shows the effective workspace and its source.

Override one command

nevia workspace get --workspace 01d4cnjjq40hnnh0nwmkg35nv2h

Select for a shell

export NEVIA_WORKSPACE=01d4cnjjq40hnnh0nwmkg35nv2h
nevia workspace current

Clear it with unset NEVIA_WORKSPACE.

Select for a directory

nevia workspace use 01d4cnjjq40hnnh0nwmkg35nv2h --local
nevia workspace current

--local writes .nevia.toml in the current directory. Commands in that directory and its subdirectories use the workspace.

Precedence

  1. --workspace on the command.
  2. NEVIA_WORKSPACE.
  3. The nearest .nevia.toml.
  4. The default in your user config.toml.

A positional workspace argument, such as nevia workspace get 01d4cnjjq40hnnh0nwmkg35nv2h, beats all four.

Clear the default with nevia workspace use --unset. Clear the directory's selection with nevia workspace use --local --unset. The file stays in place.

With several workspaces and no selection, commands fail with no workspace selected and list them.

When the selected workspace is removed

nevia workspace rm clears your saved default if it names the removed workspace. It leaves .nevia.toml and NEVIA_WORKSPACE alone and reports when either one names the removed workspace. If someone removes the workspace elsewhere, such as in the console, commands fail with exit code 3 and name the source of the selection. The CLI does not switch to another workspace on its own.

Command options are in nevia workspace use.

On this page