@agilecustoms/envctl 1.5.0 → 1.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE ADDED
@@ -0,0 +1,6 @@
1
+ Copyright (c) 2026 Alexey Chekulaev
2
+
3
+ All rights reserved.
4
+
5
+ This software may be used for personal or commercial purposes.
6
+ Modification, redistribution, sublicensing, or resale is strictly prohibited without explicit written permission.
@@ -66,9 +66,7 @@ export class EnvService extends BaseService {
66
66
  const env = await this.tryGetEnv(key);
67
67
  if (env) {
68
68
  this.checkKind(env);
69
- if (env.status === EnvStatus.Deleting) {
70
- throw new KnownException(`Env ${env.key} status is DELETING, please wait`);
71
- }
69
+ this.handleDeleteStatuses(env);
72
70
  }
73
71
  await this.lockTerraform(env, env === null);
74
72
  await this.terraformAdapter.plan(env, tfArgs);
@@ -109,6 +107,16 @@ export class EnvService extends BaseService {
109
107
  }
110
108
  return applyArgs;
111
109
  }
110
+ handleDeleteStatuses(env) {
111
+ if (env.status === EnvStatus.Deleting) {
112
+ throw new KnownException(`Env ${env.key} status is DELETING, please wait.\n
113
+ If it is DELETING more than 10 minutes, you can try to run 'envctl delete ${env.key} --force' to remove it`);
114
+ }
115
+ if (env.status === EnvStatus.DeleteError) {
116
+ throw new KnownException(`Env ${env.key} status is DELETE_ERROR, most likely lack of permissions.\n
117
+ Check logs with 'envctl logs', address the issue and re-run 'envctl delete ${env.key}'`);
118
+ }
119
+ }
112
120
  async deploy(tfArgs) {
113
121
  const key = this.terraformAdapter.getTerraformBackend().getKey();
114
122
  let env = await this.tryGetEnv(key);
@@ -124,10 +132,8 @@ export class EnvService extends BaseService {
124
132
  return;
125
133
  }
126
134
  this.checkKind(env);
135
+ this.handleDeleteStatuses(env);
127
136
  const status = env.status;
128
- if (status === EnvStatus.Deleting) {
129
- throw new KnownException(`Env ${env.key} status is DELETING, please wait`);
130
- }
131
137
  if (status === EnvStatus.Deploying || status === EnvStatus.Updating) {
132
138
  const answerYes = await this.cli.promptYesNo(`Env status is ${status}, likely due to an error from a previous run\n
133
139
  Do you want to proceed with deployment?`);
package/package.json CHANGED
@@ -1,12 +1,26 @@
1
1
  {
2
2
  "name": "@agilecustoms/envctl",
3
+ "version": "1.6.1",
3
4
  "description": "node.js CLI client for manage environments",
4
- "version": "1.5.0",
5
- "author": "Alex Chekulaev",
5
+ "keywords": [
6
+ "terraform wrapper",
7
+ "auto deletion"
8
+ ],
9
+ "homepage": "https://github.com/agilecustoms/envctl",
10
+ "bugs": {
11
+ "url": "https://github.com/agilecustoms/envctl/issues"
12
+ },
13
+ "repository": {
14
+ "type": "git",
15
+ "url": "git+https://github.com/agilecustoms/envctl.git"
16
+ },
17
+ "license": "UNLICENSED",
18
+ "author": "Alexey Chekulaev <chekulaevalexey@gmail.com> (https://github.com/laxa1986)",
6
19
  "type": "module",
7
20
  "engines": {
8
21
  "node": ">=22.0.0"
9
22
  },
23
+ "private": false,
10
24
  "bin": {
11
25
  "envctl": "dist/index.js"
12
26
  },
@@ -14,11 +28,6 @@
14
28
  "dist/",
15
29
  "package.json"
16
30
  ],
17
- "repository": {
18
- "type": "git",
19
- "url": "git+https://github.com/agilecustoms/envctl.git"
20
- },
21
- "license": "UNLICENSED",
22
31
  "_comment0": "to run via `npx` you must use `name` (with scope) and have at least one entry in `bin`. Key does not matter when run via `npx`",
23
32
  "_comment1": "keys become CLI apps (symlinks) when install globally. ex: npm install -g @agilecustoms/envctl; ls $(which alexc-blah) >> lrwxr-xr-x 1 alexc admin 62 Dec 30 14:29 /opt/homebrew/bin/alexc-blah -> ../lib/node_modules/@agilecustoms/envctl-client/dist/index.js",
24
33
  "scripts": {