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).
{
"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):
{
"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:
shelve pull
This command will execute the pull
command for all the projects in the monorepo that have a shelve.json
file.
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:
Option | Type | Default | Description |
---|---|---|---|
project | string | process.env.SHELVE_PROJECT or nearest package.json name | The name of your project |
slug | string | process.env.SHELVE_TEAM_SLUG | Your team slug (can be found in your team settings) |
token | string | Global token stored in ~/.shelverc after shelve login , or process.env.SHELVE_TOKEN | Authentication token created via app.shelve cloud/tokens |
url | string | https://app.shelve.cloud | URL of the Shelve instance |
confirmChanges | boolean | false | Whether to confirm changes before applying them |
envFileName | string | .env | Name of your environment file |
autoUppercase | boolean | true | Automatically uppercase environment variable keys |
autoCreateProject | boolean | true | Automatically create project if it doesn't exist |
Environment Variables
The following environment variables can be used to override configuration options:
Variable | Description |
---|---|
SHELVE_PROJECT | Project name |
SHELVE_TEAM_SLUG | Team slug |
SHELVE_TOKEN | Authentication token |
SHELVE_URL | Shelve instance URL |