@agilecustoms/envctl

中文文档
1.33.1发布于 2026/10/30UNLICENSEDES Module近 30 天下载 1734

node.js CLI client for managing environments

原始使用文档
文档目录8 节
  1. install
  2. setup
  3. usage
  4. Limitations
  5. Extra features:
  6. Support
  7. Roadmap
  8. Ephemeral environments

envctl

┌────────────────────────────┐
│ IN NON-PROD ACCOUNT        │
│                            │
│ You run: terraform apply   │
│ We run:  terraform destroy │
└────────────────────────────┘

EnvCtl is a tool to automate Terraform environment lifecycle management in non-prod accounts

Main use case: you provision resources for dev testing, the tool destroys them at the end of a work day, so you save $

EnvCtl is free for personal use

install

EnvCtl requires Node.js 22 or higher

npm install -g @agilecustoms/envctl

setup

Currently (May 2026) EnvCtl is in alpha testing, please contact author [email protected] for onboarding. Once you get an API Key, you can run:

envctl configure

usage

This is an easy part. You just use envctl instead of terraform:

envctl init -backend-config=key=my-test-env
envctl plan  # any normal terraform plan arguments
envctl apply # any normal terraform apply arguments
envctl delete

Note. Instead of "destroy" you now can use the "delete" command, it launches an async destroy process on EnvCtl backend. For this purpose you'll need to create a user/role with trust policy to allow EnvCtl to assume it and delete resources on your behalf

Advantages:

  • (main) you can forget to run destroy, EnvCtl will delete resources at the end of the workday (configurable)
  • often destroy takes a long time (up to 40 min if you use Lambda in VPC). With envctl you don't need to wait for it
  • (future) Often terraform just can't delete a resource, because, for example, there are already some objects in S3 bucket. We call it "hard resources". EnvCtl will delete them too

Since now a destruction process is run on a remote server, you might need to know what is going on. For this purpose you can use the following commands:

envctl status # shows environment status: ACTIVE, DELETING, DELETE_ERROR
envctl logs   # shows most recent destroy logs - helpful if status returns DELETE_ERROR

logs saves the file and opens its directory in a file manager. It is not opened with --no-open or when output is not a terminal (AI agent, script, CI) - then use the printed file path

Limitations

As of May 2026:

  • Only AWS is supported. GCP, Azure and other providers are planned in the future (send an email at [email protected] if you want to be a tester for other providers)
  • S3 remote state only (other remote states are planned)

Extra features:

  • if apply fails due to a lock error, EnvCtl will offer you to force unlock state and retry apply. In non-interactive mode (CI) it fails with the original lock error instead (prompt would wait forever)
  • if apply fails due to a known transient AWS error, EnvCtl retries apply once. A saved plan can't be applied twice (it is stale after a failed apply), so for envctl apply {planfile} EnvCtl first re-runs plan with the args it saved during envctl plan -out={planfile} (in .terraform/envctl.json). Plan files not made by envctl plan (or changed since) are not retried
  • for multi-tenant accounts EnvCtl offers automatic injection of a variable that defines environment key/prefix
  • just like AWS CLI, EnvCtl supports profiles, so you can switch between different accounts

Support

Currently, support is via email [email protected]

Roadmap

  • OIDC support (currently customers require creating IAM user with access keys)
  • Support for other providers (GCP, Azure)
  • Self-service website (currently onboarding is via chat)
  • Extended "Hard resources" support (non-empty S3 bucket, amended routes in Api Gateway, etc)
  • Notification in Slack/Email when environment deletion failed
  • Extended analytics for enterprise

Ephemeral environments

Ephemeral environments are used in the CD pipeline to run end-to-end tests. Such environments are deleted not at the end of the workday, but after some time after creation (configurable, typically within an hour – the time required to run all tests). Key idea: if tests passed, the last step of your CD pipeline will run envctl delete. So your pipeline finishes when tests finish, you do not need to wait a few more minutes for resources deletion anymore! But if tests fail – you have some time to investigate the failure and a chance to extend environment lifetime!

This feature is available for alpha/beta testers and the first month of use after prod release, then it will be paid

Contact [email protected] for ephemeral environments demo

版本与发布记录

@agilecustoms/envctl 共发布 193 个版本,首次发布于 2025/03/26;过去 12 个月发布了 94 个版本。

版本发布日期距今
1.33.1latest2026/10/3010 天前
1.33.02026/10/2516 天前
1.32.22026/10/2516 天前
1.32.12026/10/2516 天前
1.32.02026/10/1822 天前
1.31.02026/10/1228 天前

关于 @agilecustoms/envctl 的常见问题

@agilecustoms/envctl 是什么?

node.js CLI client for managing environments

如何安装 @agilecustoms/envctl?

在项目目录运行 npm install @agilecustoms/envctl,或使用 pnpm add / yarn add / bun add。它还提供命令行工具 envctl,可以用 npx envctl 直接运行。

@agilecustoms/envctl 支持 TypeScript 吗?

该包的 package.json 没有声明类型入口。需要类型提示时,可以在 npm 上查找社区维护的 @types/agilecustoms__envctl 是否存在。

@agilecustoms/envctl 支持 ESM 还是 CommonJS?

以 ES Module 形式发布,推荐使用 import 引入。在 CommonJS 项目中,Node.js 20.19+ / 22.12+ 可以直接 require() 不含顶层 await 的 ES Module,更早的版本需要改用动态 import()。

@agilecustoms/envctl 需要什么版本的 Node.js?

package.json 的 engines 字段要求 Node.js >=22.0.0。版本不符时 npm 默认只给出警告,开启 engine-strict 后会拒绝安装。

@agilecustoms/envctl 可以商用吗?

@agilecustoms/envctl 使用 UNLICENSED 许可。作者声明为 UNLICENSED,即不授予公开使用许可(与公共领域的 Unlicense 不同)。使用前需获得作者授权。以上为概括,不构成法律意见,请以许可原文为准。

@agilecustoms/envctl 的下载量有多少?

根据 npm 官方下载统计,@agilecustoms/envctl 在 2026/10/05 – 2026/11/03 这 30 天内被下载 1,734 次,日均约 58 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@agilecustoms/envctl 还在维护吗?

最新版本 1.33.1 发布于 2026/10/30(10 天前);至今共发布 193 个版本,其中过去 12 个月发布了 94 个;首次发布于 2025/03/26。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。