envilder 0.5.1 โ†’ 0.5.2

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.
Files changed (3) hide show
  1. package/README.md +80 -29
  2. package/lib/cli/cli.js +0 -0
  3. package/package.json +22 -5
package/README.md CHANGED
@@ -1,12 +1,9 @@
1
1
  <h1 align="center">
2
2
  <br>
3
3
  <img src="https://github.com/user-attachments/assets/96bf1efa-7d21-440a-a414-3a20e7f9a1f1" alt="Envilder">
4
- <br>
5
- Envilder
6
- <br>
7
4
  </h1>
8
5
 
9
- <h4 align="center">Secure Your Environment Variables with AWS SSM Parameter Store</h4>
6
+ <h4 align="center">A CLI that securely centralizes your environment variables from AWS SSM as a single source of truth</h4>
10
7
 
11
8
  <p align="center">
12
9
  <a href="https://www.npmjs.com/package/envilder">
@@ -20,11 +17,16 @@
20
17
  </a>
21
18
  </p>
22
19
 
23
- <p align="center">
24
- <b>Stop committing secrets to your repo! Start using AWS SSM Parameter Store to secure your credentials.</b>
25
- </p>
20
+ ## ๐ŸŒŸ Key benefits
21
+
22
+ - **๐Ÿ”’ Strict access control** - AWS IAM policies control who accesses which secrets (dev vs prod)
23
+ - **๐Ÿ“Š Full audit trail** - All parameter access is logged in CloudTrail for compliance requirements
24
+ - **๐Ÿงฉ Single source of truth** - No more copying .env files from Notion or emails - SSM is your only source
25
+ - **๐Ÿ” Idempotent operations** - Won't overwrite your local values - safe for automation
26
+ - **โš™๏ธ Environment-aware** - Use templates like `/project/${ENV}/DB_PASSWORD` to dynamically fetch the right secrets
27
+ - **๐Ÿงฑ No extra infrastructure** - Uses AWS SSM's existing reliability instead of additional secret managers
26
28
 
27
- ## โšก Quick Start
29
+ ## โšก Quick start
28
30
 
29
31
  ```bash
30
32
  # Install globally
@@ -37,7 +39,7 @@ echo '{"DB_PASSWORD": "/my-app/db/password"}' > param-map.json
37
39
  envilder --map=param-map.json --envfile=.env
38
40
  ```
39
41
 
40
- ## ๐Ÿค” What Problem Does Envilder Solve?
42
+ ## ๐Ÿค” What problem does Envilder solve?
41
43
 
42
44
  <table>
43
45
  <tr>
@@ -72,23 +74,23 @@ envilder --map=param-map.json --envfile=.env
72
74
 
73
75
  ## ๐Ÿ’ก Why Envilder?
74
76
 
75
- - ๐Ÿ” **No More Secrets in Git** - Store credentials in AWS SSM Parameter Store instead of version control
76
- - ๐Ÿค– **Automate Everything** - One command to generate your `.env` files across all environments
77
- - ๐Ÿ”„ **Always in Sync** - Keep your local, dev, and production environments consistent
78
- - ๐ŸŽ๏ธ **Fast to Set Up** - Configure once, then generate `.env` files with a single command
79
- - ๐Ÿชถ **Simple but Powerful** - Easy interface with support for encrypted parameters and multiple AWS profiles
77
+ - ๐Ÿ” **No more secrets in git** - Store credentials in AWS SSM Parameter Store instead of version control
78
+ - ๐Ÿค– **Automate everything** - One command to generate your `.env` files across all environments
79
+ - ๐Ÿ”„ **Always in sync** - Keep your local, dev, and production environments consistent
80
+ - ๐ŸŽ๏ธ **Fast to set up** - Configure once, then generate `.env` files with a single command
81
+ - ๐Ÿชถ **Simple but powerful** - Easy interface with support for encrypted parameters and multiple AWS profiles
80
82
 
81
- ## ๐ŸŽฏ Perfect for Teams
83
+ ## ๐ŸŽฏ Perfect for teams
82
84
 
83
85
  Envilder is the tool you need if you:
84
86
 
85
- - ๐Ÿ‘ฅ **Work in a Development Team** - Ensure everyone has the same environment without sharing raw secrets
86
- - ๐Ÿ”‘ **Deal with API Keys & Tokens** - Securely store and retrieve sensitive credentials
87
- - โš™๏ธ **Run CI/CD Pipelines** - Automatically generate environment files during deployments
88
- - โ˜๏ธ **Use AWS Already** - Leverage your existing AWS infrastructure more effectively
89
- - ๐ŸŒ **Manage Multiple Environments** - Switch easily between dev, staging, and production
87
+ - ๐Ÿ‘ฅ **Work in a development team** - Ensure everyone has the same environment without sharing raw secrets
88
+ - ๐Ÿ”‘ **Deal with API keys & tokens** - Securely store and retrieve sensitive credentials
89
+ - โš™๏ธ **Run CI/CD pipelines** - Automatically generate environment files during deployments
90
+ - โ˜๏ธ **Use AWS already** - Leverage your existing AWS infrastructure more effectively
91
+ - ๐ŸŒ **Manage multiple environments** - Switch easily between dev, staging, and production
90
92
 
91
- ## ๐Ÿ” How It Works (Simple!)
93
+ ## ๐Ÿ” How it works (simple!)
92
94
 
93
95
  ```mermaid
94
96
  graph LR
@@ -98,10 +100,10 @@ graph LR
98
100
  E[SSM Parameters] --> B
99
101
  ```
100
102
 
101
- 1. ๐Ÿ“– **Define Your Mapping** - Simple JSON mapping env vars to SSM paths
103
+ 1. ๐Ÿ“– **Define your mapping** - Simple JSON mapping env vars to SSM paths
102
104
  2. ๐Ÿš€ **Run Envilder** - One command with your mapping file
103
- 3. ๐Ÿ”„ **Auto-Fetch from AWS** - Retrieves values using your AWS credentials
104
- 4. ๐Ÿ’พ **Get Your .env File** - Ready to use in your project
105
+ 3. ๐Ÿ”„ **Auto-fetch from AWS** - Retrieves values using your AWS credentials
106
+ 4. ๐Ÿ’พ **Get your .env file** - Ready to use in your project
105
107
 
106
108
  ## โš™๏ธ Prerequisites
107
109
 
@@ -110,7 +112,7 @@ You'll need:
110
112
  - โœ… **AWS CLI** - Installed and configured with proper permissions to access SSM Parameter Store
111
113
  - โœ… **Node.js** - Version 14 or higher
112
114
 
113
- ### AWS CLI Setup
115
+ ### AWS CLI setup
114
116
 
115
117
  1. Install the AWS CLI by following the [official instructions](https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html).
116
118
  2. After installation, configure the AWS CLI:
@@ -149,7 +151,7 @@ envilder --map=<mapping-file> --envfile=<output-file> [--profile=<aws-profile>]
149
151
  | `--envfile` | Path to output .env file (required) |
150
152
  | `--profile` | AWS CLI profile to use (optional) |
151
153
 
152
- ## ๐Ÿ”ง Quick Example
154
+ ## ๐Ÿ”ง Quick example
153
155
 
154
156
  1. Create a mapping file `param-map.json`:
155
157
 
@@ -172,7 +174,7 @@ envilder --map=<mapping-file> --envfile=<output-file> [--profile=<aws-profile>]
172
174
  envilder --map=param-map.json --envfile=.env --profile=dev-account
173
175
  ```
174
176
 
175
- ## ๐ŸŒ Working with Multiple AWS Profiles
177
+ ## ๐ŸŒ Working with multiple AWS profiles
176
178
 
177
179
  For multiple AWS accounts or environments, configure different profiles in your AWS credentials file:
178
180
 
@@ -203,14 +205,63 @@ or `%USERPROFILE%\.aws\credentials` on Windows):
203
205
  envilder --map=param-map.json --envfile=.env.production --profile=prod-account
204
206
  ```
205
207
 
206
- ## ๐Ÿ“‚ Sample `.env` Output
208
+ ## ๐Ÿ› ๏ธ Advanced usage: environment-specific parameters
209
+
210
+ Envilder works brilliantly with environment variables for dynamic parameter paths:
211
+
212
+ 1. Set up your SSM parameters with environment-specific paths:
213
+
214
+ ```text
215
+ /project/dev/DB_PASSWORD
216
+ /project/stage/DB_PASSWORD
217
+ /project/prod/DB_PASSWORD
218
+ ```
219
+
220
+ 2. Create a template-based mapping file `env-map.json`:
221
+
222
+ ```json
223
+ {
224
+ "DB_PASSWORD": "/project/${ENV}/DB_PASSWORD"
225
+ }
226
+ ```
227
+
228
+ 3. Generate environment-specific .env files:
229
+
230
+ ```powershell
231
+ # Development
232
+ $env:ENV = "dev"
233
+ envilder --map=env-map.json --envfile=.env.dev
234
+
235
+ # Staging
236
+ $env:ENV = "stage"
237
+ envilder --map=env-map.json --envfile=.env.stage
238
+
239
+ # Production
240
+ $env:ENV = "prod"
241
+ envilder --map=env-map.json --envfile=.env.prod --profile=prod-account
242
+ ```
243
+
244
+ This approach ensures the right variables are pulled for each environment with minimal configuration.
245
+
246
+ ## ๐Ÿ“‚ Sample `.env` output
207
247
 
208
248
  ```ini
209
249
  SECRET_TOKEN=mockedEmail@example.com
210
250
  SECRET_KEY=mockedPassword
211
251
  ```
212
252
 
213
- ## ๐Ÿงช Running Tests
253
+ ## ๐ŸŽฏ Why use Envilder in practice?
254
+
255
+ Envilder eliminates common problems in development teams:
256
+
257
+ - **๐Ÿ›‘ No more "it works on my machine"** - Everyone uses the exact same environment variables from the same source
258
+ - **๐Ÿ”„ Always fresh credentials** - Update a secret in SSM and everyone gets it automatically on next run
259
+ - **๐Ÿ›ก๏ธ Access control built-in** - Developers only see dev secrets, CI/CD systems see what they need
260
+ - **๐Ÿง  Zero mental overhead** - No need to remember which variables are needed - the mapping defines everything
261
+ - **๐Ÿšซ No more sharing secrets** - Stop pasting credentials in Slack, email, or Notion documents
262
+ - **๐Ÿ“‹ Compliance ready** - All accesses are logged in AWS CloudTrail for auditing
263
+
264
+ ## ๐Ÿงช Running tests
214
265
 
215
266
  ```bash
216
267
  yarn test
package/lib/cli/cli.js CHANGED
File without changes
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "envilder",
3
- "version": "0.5.1",
4
- "description": "A CLI tool to generate .env files from AWS SSM parameters",
3
+ "version": "0.5.2",
4
+ "description": "A CLI that securely centralizes your environment variables from AWS SSM as a single source of truth",
5
5
  "exports": {
6
6
  ".": {
7
7
  "import": "./lib/index.js",
@@ -13,9 +13,10 @@
13
13
  "envilder": "lib/cli/cli.js"
14
14
  },
15
15
  "scripts": {
16
- "clean": "npx jest --clearCache && yarn cache clean --force && npx rimraf lib && npx rimraf node_modules && npx rimraf coverage && npx rimraf yarn.lock",
16
+ "clean": "npx jest --clearCache && yarn cache clean --force && npx rimraf lib && npx rimraf node_modules && npx rimraf coverage",
17
17
  "test-run": "yarn build && node lib/cli/cli.js --map=tests/sample/param-map.json --envfile=tests/sample/autogenerated.env",
18
- "build": "tsc -p tsconfig.build.json --sourceMap --declaration && node --no-warnings scripts/chmod-cli.js",
18
+ "build": "tsc -p tsconfig.build.json --sourceMap --declaration",
19
+ "local-deploy": "yarn build && node --no-warnings scripts/pack-and-install.js",
19
20
  "validate-cli": "node --no-warnings --loader ts-node/esm scripts/validate-cli.ts",
20
21
  "format": "npx biome format",
21
22
  "format:write": "npx biome format --write",
@@ -28,7 +29,23 @@
28
29
  "npm-release-minor": "yarn version --new-version minor",
29
30
  "npm-release-prerelease": "yarn version --new-version prerelease"
30
31
  },
31
- "keywords": [],
32
+ "keywords": [
33
+ "env",
34
+ "dotenv",
35
+ "aws",
36
+ "ssm",
37
+ "parameter-store",
38
+ "cli",
39
+ "environment",
40
+ "secrets",
41
+ "automation",
42
+ "config",
43
+ "aws-cli",
44
+ "devops",
45
+ "ci-cd",
46
+ "secure",
47
+ "envfile"
48
+ ],
32
49
  "repository": {
33
50
  "type": "git",
34
51
  "url": "git://github.com/macalbert/envilder.git"