| v2.0.0.beta-15

CLI

Shelve CLI is a command-line interface designed for the Shelve app.

The CLI serves as a command-line interface designed for the Shelve app. Facilitating the seamless transfer of environment variables for project collaboration within a team directly through the terminal interface, but way more other features are and will be available !

Installation

To install the CLI, please refer to the Quickstart guide.

Configuration

Configuration is loaded from cwd. You can use either shelve.json, shelve.config.json or .shelverc.json, but running the CLI without any configuration will create a shelve.json file.

The CLI also has a json schema for the configuration file. that can be used to validate the configuration file (see it here).

shelve.json
{
  "slug": "nuxtlabs",
  "project": "@nuxt/ui",
  "confirmChanges": true,
  "autoCreateProject": true
}

Monorepo support

Shelve natively supports monorepos, tf you are using a monorepo, Shelve will automatically detect the root of the monorepo and look for the global shelve.json file. You can define here common configurations for all the projects in the monorepo (the team slug for example):

shelve.json
{
  "slug": "nuxtlabs"
}

Monorepo usage

If you are using a monorepo, running a command at the root level will execute the command for all the projects in the monorepo that have a shelve.json file.

Example:

terminal
shelve pull

This command will execute the pull command for all the projects in the monorepo that have a shelve.json file.

apps/app/terminal
shelve pull

This command will execute the pull command for the @nuxt/app project.

Options

Here are all the available options for the configuration file:

OptionTypeDefaultDescription
projectstringprocess.env.SHELVE_PROJECT or nearest package.json nameThe name of your project
slugstringprocess.env.SHELVE_TEAM_SLUGYour team slug (can be found in your team settings)
tokenstringGlobal token stored in ~/.shelverc after shelve login, or process.env.SHELVE_TOKENAuthentication token created via app.shelve cloud/tokens
urlstringhttps://app.shelve.cloudURL of the Shelve instance
confirmChangesbooleanfalseWhether to confirm changes before applying them
envFileNamestring.envName of your environment file
autoUppercasebooleantrueAutomatically uppercase environment variable keys
autoCreateProjectbooleantrueAutomatically create project if it doesn't exist

Environment Variables

The following environment variables can be used to override configuration options:

VariableDescription
SHELVE_PROJECTProject name
SHELVE_TEAM_SLUGTeam slug
SHELVE_TOKENAuthentication token
SHELVE_URLShelve instance URL
Edit this page