![Bun 1.2 Released with 90% Node.js Compatibility and Built-in S3 Object Support](https://cdn.sanity.io/images/cgdhsj6q/production/2cf8fa428fd5329a3f9bc7f76a597ac829bb1b3d-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Bun 1.2 Released with 90% Node.js Compatibility and Built-in S3 Object Support
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.
@env0/cli
Advanced tools
The command-line tool for the env0 platform.
$ yarn global add @env0/cli
# or
$ npm install -g @env0/cli
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).
The arguments are loaded from env0 configuration files, environment variables and CLI parameters. The order of precedence of the arguments is:
env0
CLI explicit parametersenv0 API Key (Required)
--apiKey
-k
env0 API Secret (Required)
--apiSecret
-s
env0 Organization ID (Required)
--organizationId
-o
env0 Project ID (Required)
--projectId
-p
The Blueprint ID you wish to deploy with (Required for new environments)
--blueprintId
-b
The environment name you wish to create, or deploy to an existing one (Required for existing environments)
--environmentName
-e
The environment id you wish to re-deploy. If both the environment name and ID are specified, the environment ID will take precedence
--environmentId
(Optional) - A name for Terraform Workspace created for your new environment. This cannot be changed after an environment was created
--workspaceName
-w
The environment variables to set on the deployed environment - works only on deploy and can be multiple, the format is "environmentVariableName1=value"
--environmentVariables
-v
For sensitive environment variables, use:
--sensitiveEnvironmentVariables
-q
The terraform variables to set on the deployed environment - works only on deploy and can be multiple, the format is "terraformVariableName1=value"
--terraformVariables
-u
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)
--revision
-r
Requires approval for deployment. Valid values are either "true" or "false".
--requiresApproval <true/false>
-a
Disable automatic state refresh on 'plan -destroy' phase.
--skipStateRefresh <true/false>
-z
A list of resources to explicitly include in the deployment, delimited by a comma. Format is "resource1,resource2,resource3"
--targets
-t
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.
ENV0_API_KEY
ENV0_API_SECRET
ENV0_ORGANIZATION_ID
ENV0_PROJECT_ID
ENV0_BLUEPRINT_ID
ENV0_ENVIRONMENT_NAME
ENV0_ENVIRONMENT_ID
https://docs.env0.com/reference
https://www.env0.com/blog/introducing-the-env0-cli
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
export ENV0_API_URL=https://api-server
to change the API URLhttps://api.env0.com
env0 configure
FAQs
env0 CLI
The npm package @env0/cli receives a total of 2,541 weekly downloads. As such, @env0/cli popularity was classified as popular.
We found that @env0/cli demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 12 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.
Security News
Biden's executive order pushes for AI-driven cybersecurity, software supply chain transparency, and stronger protections for federal and open source systems.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.