ast env
An environment is where one agent of a blueprint runs in the active account. Each environment has its own variables and secrets, which override the account’s values with the same name. Deleting the agent keeps the environment and its values, ready for the next deploy. Aliases: ast envs, ast environment, ast environments.
Every subcommand works on one blueprint. Pass --blueprint (-b), or run the command in the blueprint’s project directory, where the CLI reads the name from astropods.yml.
Environments are available for private blueprints only.
env list
Lists the blueprint’s environments with each one’s agent, status, and variable and secret counts. An environment with no agent shows as empty.
env create
Creates an empty environment. Deploy into it with ast deploy --env <name>.
env rename
A name is unique per blueprint in an account.
env delete
Deletes an environment and its variables and secrets. An environment that has an agent can’t be deleted: delete the agent first with ast agent delete --env <name>. Prompts for confirmation. Pass --confirm with the environment name to skip the prompt.
Deploy into an environment
--env names an environment with no agent. Without it, a deploy uses the blueprint’s oldest environment that has no agent, or creates a new one named main, main-2, and so on. Either way, the deploy prints the environment it used. A redeploy stays in its environment.
Environment variables and secrets
Pass --env to any ast secrets subcommand to work on an environment’s values instead of the account’s:
At deploy time, a --var KEY=@NAME reference resolves from the environment first, then from the account.
Target an agent by environment
An environment holds at most one agent, so --env picks exactly one. The blueprint comes from --blueprint or astropods.yml, as above. Every ast agent command that acts on one agent accepts it in place of --name or --id:
Next steps
- ast secrets: manage account and environment values
- ast agent: manage the agent in an environment
- ast blueprint: deploy a blueprint