npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@env0/cli

v1.0.23

Published

env0 CLI

Downloads

18,814

Readme

@env0/cli License Version Downloads CI

The command-line tool for the env0 platform.

Features

  • deploy - Creates a new environment or deploy an existing environment.
  • destroy - Destroys an existing environment.
  • approve - Resumes a deployment that awaits an approval.
  • cancel - Cancels a deployment that awaits an approval.

Installation

$ yarn global add @env0/cli
# or
$ npm install -g @env0/cli

Commands Overview

env0 help

Run env0 help to get a helpful list of supported commands and arguments.

env0 configure <arguments>

Sets configurable options for the CLI. If no arguments are given, displays a set of prompts that will help you configure the CLI options.

env0 deploy <arguments>

Initiates a new deployment on env0, whether for a new environment or for an existing one.

env0 destroy <arguments>

Initiates a new deployment to destroy and existing environment.

env0 approve <arguments>

Runs an approval of an existing deployment that is waiting to be approved (AKA waiting in plan stage).

env0 cancel <arguments>

Cancels an existing deployment that is waiting to be approved (AKA waiting in plan stage).

Arguments Overview

The arguments are loaded from env0 configuration files, environment variables and CLI parameters. The order of precedence of the arguments is:

  1. env0 CLI explicit parameters
  2. Environment Variables
  3. Configuration File

API Key

env0 API Key (Required)

  • Usage: --apiKey
  • Alias: -k

API Secret

env0 API Secret (Required)

  • Usage: --apiSecret
  • Alias: -s

Organization ID

env0 Organization ID (Required)

  • Usage: --organizationId
  • Alias: -o

Project ID

env0 Project ID (Required)

  • Usage: --projectId
  • Alias: -p

Blueprint ID

The Blueprint ID you would like to deploy with (Required for new environments)

  • Usage: --blueprintId
  • Alias: -b

Environment Name

The environment name you would like to create, or deploy to an existing one (Required for existing environments)

  • Usage: --environmentName
  • Alias: -e

Workspace Name

(Optional) - A name for Terraform Workspace created for your new environment. This cannot be changed after an environment was created

  • Usage: --workspaceName
  • Alias: -w

Environment Variables

The environment variables to set on the deployed environment - works only on deploy and can be multiple, the format is "environmentVariableName1=value"

  • Usage: --environmentVariables
  • Alias: -v

For sensitive environment variables, use:

  • Usage: --sensitiveEnvironmentVariables
  • Alias: -q

Terraform Variables

The terraform variables to set on the deployed environment - works only on deploy and can be multiple, the format is "terraformVariableName1=value"

  • Usage: --terraformVariables
  • Alias: -u

Revision

Your GIT revision, can be a branch, a tag or a commit hash. (For existing environments - if not specified, will use the previously defined revision)

  • Usage: --revision
  • Alias: -r

Requires Approval

Requires approval for deployment. Valid values are either "true" or "false".

  • Usage: --requiresApproval <true/false>
  • Alias: -a

Skip State Refresh

Disable automatic state refresh on 'plan -destroy' phase.

  • Usage: --skipStateRefresh <true/false>
  • Alias: -z

Targets (Partial Apply)

A list of resources to explicitly include in the deployment, delimited by a comma. Format is "resource1,resource2,resource3"

  • Usage: --targets
  • Alias: -t

Configuration File

After initial deployment, a configuration file will be created under ~/.env0/config.json

This file holds your last action's required parameters and will spare you from re-configuring the required parameters on every action.

Supported Environment Variables

  • ENV0_API_KEY
  • ENV0_API_SECRET
  • ENV0_ORGANIZATION_ID
  • ENV0_PROJECT_ID
  • ENV0_BLUEPRINT_ID
  • ENV0_ENVIRONMENT_NAME

API Reference

https://docs.env0.com/reference

env0 blog:

https://www.env0.com/blog/introducing-the-env0-cli

Compiling from Source

You can compile and run the CLI from source by cloning the repo from Github and then running the following:

# Clone the repo from github
# Make sure env0 lib is not installed globally
npm install
npm link # link your local copy of the CLI to your terminal path

Development flow:

  • Run export ENV0_API_URL=https://api-server to change the API URL
    Default url is set to https://api.env0.com
  • Run env0 configure