Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

ssm-cli

Skydev-soft16ISC1.4.1-rc

Skydev serect management CLI

ssm-cli, env-cli, secret-management, env management, environment management, pull, push env

readme

Skydev Secret Management

Skydev Secret Management CLI (ssm-cli) is a command-line interface tool for managing project environments and secrets.

Table of Contents

Installation

You can install the CLI using npm for your project:

npm install ssm-cli

but we recommend you to install it globally:

npm install -g ssm-cli

Prerequisites

  • SSM system have linked to your Gitlab repository, so you need to have a Gitlab account and a project on Gitlab.
  • You have installed and configured Git on your local machine.

In the future, we will support more Git providers such as Github, Bitbucket,...

Usage

After installation, you can use the ssm-cli command in your terminal.

ssm-cli [command] [options]

Example

# Prerequisites: Your project have version controls (GIT) to a Gitlab repository

# Private key must be added before you login. Please set it using 'ssm-cli config set --private-key <key>'. Short of --private-key is -pk
# Get key from https://web-ssm.skydev.vn/generate-private-key
ssm-cli config set -pk <private-key>

# Login to the Skydev Secret Management system
ssm-cli login

# Sync repository from Gitlab to SSM Registry
ssm-cli sync

# Initialize a repository by repo-name (default is current repository, the folder stores .env file)
ssm-cli init .

# Short command: ssm-cli init --sync .

# Push environment variables (default is develop)
ssm-cli push -m "commit message"

# Pull environment variables (default is develop)
ssm-cli pull

Commands

config Get and change local configurations CLI.

ssm-cli config get
ssm-cli config set <key> <value>
  • --private-key <value> Set private key for encrypting access token which stored in your machine

login Login to the Skydev Secret Management system.

ssm-cli login

sync Synchronize repository from Gitlab to SSM Registry.

ssm-cli sync

init Initialize a repository by pathname.

ssm-cli init [option] <working-dir>
  • -n, --name <repo-name> The pathname of the repository to sync. If not specified, the current repository (GIT) will be used. I can access this website to get repo-name Skydev Secret Management
  • working-dir The directory will include .env file. Default is . (Current directory)
  • --sync Sync repository from Gitlab to SSM Registry

pull Pull environment variables.

ssm-cli pull [option]
  • -f, --force Force pull env

  • -d, --develop Pull env Develop (default)

  • -p, --production Pull env Production
  • -s, --stagding Pull env Stagding
  • -c, --cicd Pull env CICD

push Push environment variables.

ssm-cli push -m "commit message" [option]
  • -d, --develop Push env Develop (default)
  • -p, --production Push env Production
  • -s, --stagding Push env Stagding
  • -c, --cicd Push env CICD

head Show the current version of environment variables

ssm-cli head

log Log the history of the changes of environment variables

ssm-cli log
  • --oneline Show in one line

revert Revert to any previous version of environment variables

ssm-cli revert <version>

auto-complete Append some config to your terminal for auto complete (using tab)

ssm-cli auto-complete

Contributors

TriThuc2321 nxquan nxquan nxquan