Skip to content

Environment commands

The CLI provides commands for validating and managing E2Engine Environments.

e2engine validate environment
e2engine create environment
e2engine get environment
e2engine get environments
e2engine delete environment

For the Environment resource model and specification format, see Environments.

Validate an Environment specification before creating it:

Terminal window
e2engine validate environment <spec-path>

For example:

Terminal window
e2engine validate environment environment.yaml

If the specification is valid, the command prints:

Environment spec is valid

Validation checks the specification against the Environment model and its validation rules without creating a persistent Environment resource.

Use --verbose or -v to display the validated Environment:

Terminal window
e2engine validate environment environment.yaml --verbose

Table output provides a compact representation of the resource. Use JSON or YAML to inspect the complete validated model:

Terminal window
e2engine validate environment environment.yaml -o yaml -v
Terminal window
e2engine validate environment environment.yaml -o json -v

Use --quiet or -q when only the command result is needed:

Terminal window
e2engine validate environment environment.yaml --quiet

A successful validation produces no output. An invalid specification returns an error.

This form is useful in scripts and CI/CD pipelines.

Create an Environment from a specification:

Terminal window
e2engine create environment <spec-path>

For example:

Terminal window
e2engine create environment environment.yaml

On success, the default output identifies the created resource:

created environment, name: payment-demo id: <environment-id> version: 1.0.0

Use --verbose to display the created Environment instead of the compact confirmation:

Terminal window
e2engine create environment environment.yaml --verbose

The default table format shows the resource metadata. JSON and YAML expose the complete created Environment:

Terminal window
e2engine create environment environment.yaml -o yaml -v

With --quiet, the command prints only the ID of the created Environment:

Terminal window
e2engine create environment environment.yaml --quiet

This is useful when another command or script needs to capture the new resource ID.

Retrieve an Environment using its name or an ID prefix:

Terminal window
e2engine get environment <ref>

For example:

Terminal window
e2engine get environment payment-demo

or:

Terminal window
e2engine get environment 8c18c6df3133

The default table output provides a compact view of the resource.

Use YAML or JSON to retrieve its complete structured representation:

Terminal window
e2engine get environment payment-demo -o yaml
Terminal window
e2engine get environment payment-demo -o json

This includes the Environment specification and its service definitions.

List stored Environments using the plural environments command:

Terminal window
e2engine get environments

The default output is a table:

ID NAME VERSION CREATED UPDATED
------------ ------------ ------- --------------------------- ---------------------------
8c18c6df3133 payment-demo 1.0.0 2026-09-27T11:51:22.082035Z 2026-09-27T11:51:22.082035Z

The table contains:

Column Description
ID Compact Environment ID
NAME Environment name
VERSION Resource version
CREATED Creation timestamp
UPDATED Last update timestamp

Use --limit to restrict the maximum number of Environments returned:

Terminal window
e2engine get environments --limit 20

Values above the configured maximum are capped automatically.

Results can be ordered by:

id
name
version
createdAt
updatedAt

Select the field with --order-by:

Terminal window
e2engine get environments --order-by name

Select ascending or descending order with --order-direction:

Terminal window
e2engine get environments \
--order-by updatedAt \
--order-direction desc

Use JSON or YAML when the list is consumed programmatically:

Terminal window
e2engine get environments -o json
Terminal window
e2engine get environments -o yaml

For table output, use --no-headers to omit column headings:

Terminal window
e2engine get environments --no-headers

Delete an Environment using its name or an ID prefix:

Terminal window
e2engine delete environment <ref>

For example:

Terminal window
e2engine delete environment payment-demo

On success, the command confirms the deleted resource:

deleted environment, name: payment-demo id: <environment-id> version: 1.0.0

Use --quiet to suppress the confirmation:

Terminal window
e2engine delete environment payment-demo --quiet

Environment commands provide shorter aliases for interactive use.

The singular resource commands accept env:

Terminal window
e2engine get env payment-demo
e2engine delete env payment-demo

The plural list command accepts envs:

Terminal window
e2engine get envs

The full environment and environments forms are used throughout this documentation for clarity.

Environment commands use the global CLI output options:

-o, --output string Output format (available: table, json, yaml)
--no-headers Omit headers in table output
-q, --quiet Suppress non-error output
-v, --verbose Enable verbose output

Table output is intended for interactive use, while JSON and YAML expose structured E2Engine data for inspection and automation.

See CLI for an overview of CLI conventions and Environments for the Environment specification.