envilder 0.5.6 → 0.6.0

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 (115) hide show
  1. package/README.md +316 -121
  2. package/ROADMAP.md +24 -8
  3. package/lib/apps/cli/Cli.d.ts +3 -0
  4. package/lib/apps/cli/Cli.d.ts.map +1 -0
  5. package/lib/apps/cli/Cli.js +79 -0
  6. package/lib/apps/cli/Cli.js.map +1 -0
  7. package/lib/envilder/application/dispatch/DispatchActionCommand.d.ts +15 -0
  8. package/lib/envilder/application/dispatch/DispatchActionCommand.d.ts.map +1 -0
  9. package/lib/envilder/application/dispatch/DispatchActionCommand.js +26 -0
  10. package/lib/envilder/application/dispatch/DispatchActionCommand.js.map +1 -0
  11. package/lib/envilder/application/dispatch/DispatchActionCommandHandler.d.ts +16 -0
  12. package/lib/envilder/application/dispatch/DispatchActionCommandHandler.d.ts.map +1 -0
  13. package/lib/envilder/application/dispatch/DispatchActionCommandHandler.js +68 -0
  14. package/lib/envilder/application/dispatch/DispatchActionCommandHandler.js.map +1 -0
  15. package/lib/envilder/application/dispatch/builders/DispatchActionCommandHandlerBuilder.d.ts +15 -0
  16. package/lib/envilder/application/dispatch/builders/DispatchActionCommandHandlerBuilder.d.ts.map +1 -0
  17. package/lib/envilder/application/dispatch/builders/DispatchActionCommandHandlerBuilder.js +38 -0
  18. package/lib/envilder/application/dispatch/builders/DispatchActionCommandHandlerBuilder.js.map +1 -0
  19. package/lib/envilder/application/pullSsmToEnv/PullSsmToEnvCommand.d.ts +7 -0
  20. package/lib/envilder/application/pullSsmToEnv/PullSsmToEnvCommand.d.ts.map +1 -0
  21. package/lib/envilder/application/pullSsmToEnv/PullSsmToEnvCommand.js +10 -0
  22. package/lib/envilder/application/pullSsmToEnv/PullSsmToEnvCommand.js.map +1 -0
  23. package/lib/envilder/application/pullSsmToEnv/PullSsmToEnvCommandHandler.d.ts +24 -0
  24. package/lib/envilder/application/pullSsmToEnv/PullSsmToEnvCommandHandler.d.ts.map +1 -0
  25. package/lib/envilder/application/pullSsmToEnv/PullSsmToEnvCommandHandler.js +92 -0
  26. package/lib/envilder/application/pullSsmToEnv/PullSsmToEnvCommandHandler.js.map +1 -0
  27. package/lib/envilder/application/pushEnvToSsm/PushEnvToSsmCommand.d.ts +7 -0
  28. package/lib/envilder/application/pushEnvToSsm/PushEnvToSsmCommand.d.ts.map +1 -0
  29. package/lib/envilder/application/pushEnvToSsm/PushEnvToSsmCommand.js +10 -0
  30. package/lib/envilder/application/pushEnvToSsm/PushEnvToSsmCommand.js.map +1 -0
  31. package/lib/envilder/application/pushEnvToSsm/PushEnvToSsmCommandHandler.d.ts +22 -0
  32. package/lib/envilder/application/pushEnvToSsm/PushEnvToSsmCommandHandler.d.ts.map +1 -0
  33. package/lib/envilder/application/pushEnvToSsm/PushEnvToSsmCommandHandler.js +74 -0
  34. package/lib/envilder/application/pushEnvToSsm/PushEnvToSsmCommandHandler.js.map +1 -0
  35. package/lib/envilder/application/pushSingle/PushSingleCommand.d.ts +8 -0
  36. package/lib/envilder/application/pushSingle/PushSingleCommand.d.ts.map +1 -0
  37. package/lib/envilder/application/pushSingle/PushSingleCommand.js +11 -0
  38. package/lib/envilder/application/pushSingle/PushSingleCommand.js.map +1 -0
  39. package/lib/envilder/application/pushSingle/PushSingleCommandHandler.d.ts +15 -0
  40. package/lib/envilder/application/pushSingle/PushSingleCommandHandler.d.ts.map +1 -0
  41. package/lib/envilder/application/pushSingle/PushSingleCommandHandler.js +37 -0
  42. package/lib/envilder/application/pushSingle/PushSingleCommandHandler.js.map +1 -0
  43. package/lib/envilder/domain/CliOptions.d.ts +34 -0
  44. package/lib/envilder/domain/CliOptions.d.ts.map +1 -0
  45. package/lib/envilder/domain/CliOptions.js +2 -0
  46. package/lib/envilder/domain/CliOptions.js.map +1 -0
  47. package/lib/envilder/domain/EnvironmentVariable.d.ts +37 -0
  48. package/lib/envilder/domain/EnvironmentVariable.d.ts.map +1 -0
  49. package/lib/envilder/domain/EnvironmentVariable.js +59 -0
  50. package/lib/envilder/domain/EnvironmentVariable.js.map +1 -0
  51. package/lib/envilder/domain/OperationMode.d.ts +6 -0
  52. package/lib/envilder/domain/OperationMode.d.ts.map +1 -0
  53. package/lib/envilder/domain/OperationMode.js +7 -0
  54. package/lib/envilder/domain/OperationMode.js.map +1 -0
  55. package/lib/envilder/domain/errors/DomainErrors.d.ts +34 -0
  56. package/lib/envilder/domain/errors/DomainErrors.d.ts.map +1 -0
  57. package/lib/envilder/domain/errors/DomainErrors.js +40 -0
  58. package/lib/envilder/domain/errors/DomainErrors.js.map +1 -0
  59. package/lib/envilder/domain/ports/IEnvFileManager.d.ts.map +1 -0
  60. package/lib/envilder/domain/ports/IEnvFileManager.js.map +1 -0
  61. package/lib/envilder/domain/ports/ILogger.d.ts.map +1 -0
  62. package/lib/envilder/domain/ports/ILogger.js.map +1 -0
  63. package/lib/envilder/domain/ports/ISecretProvider.d.ts +5 -0
  64. package/lib/envilder/domain/ports/ISecretProvider.d.ts.map +1 -0
  65. package/lib/envilder/domain/ports/ISecretProvider.js.map +1 -0
  66. package/lib/{cli/infrastructure → envilder/infrastructure/Aws}/AwsSsmSecretProvider.d.ts +2 -1
  67. package/lib/envilder/infrastructure/Aws/AwsSsmSecretProvider.d.ts.map +1 -0
  68. package/lib/envilder/infrastructure/Aws/AwsSsmSecretProvider.js +49 -0
  69. package/lib/envilder/infrastructure/Aws/AwsSsmSecretProvider.js.map +1 -0
  70. package/lib/{cli/infrastructure → envilder/infrastructure/EnvManager}/EnvFileManager.d.ts +2 -2
  71. package/lib/envilder/infrastructure/EnvManager/EnvFileManager.d.ts.map +1 -0
  72. package/lib/{cli/infrastructure → envilder/infrastructure/EnvManager}/EnvFileManager.js +24 -8
  73. package/lib/envilder/infrastructure/EnvManager/EnvFileManager.js.map +1 -0
  74. package/lib/{cli/infrastructure → envilder/infrastructure/Logger}/ConsoleLogger.d.ts +1 -1
  75. package/lib/envilder/infrastructure/Logger/ConsoleLogger.d.ts.map +1 -0
  76. package/lib/envilder/infrastructure/Logger/ConsoleLogger.js.map +1 -0
  77. package/lib/envilder/infrastructure/VersionFinder/PackageJsonFinder.d.ts.map +1 -0
  78. package/lib/envilder/infrastructure/VersionFinder/PackageJsonFinder.js.map +1 -0
  79. package/package.json +7 -5
  80. package/lib/Cli.d.ts +0 -10
  81. package/lib/Cli.d.ts.map +0 -1
  82. package/lib/Cli.js +0 -58
  83. package/lib/Cli.js.map +0 -1
  84. package/lib/cli/application/EnvilderHandler.d.ts +0 -21
  85. package/lib/cli/application/EnvilderHandler.d.ts.map +0 -1
  86. package/lib/cli/application/EnvilderHandler.js +0 -74
  87. package/lib/cli/application/EnvilderHandler.js.map +0 -1
  88. package/lib/cli/application/builders/EnvilderBuilder.d.ts +0 -18
  89. package/lib/cli/application/builders/EnvilderBuilder.d.ts.map +0 -1
  90. package/lib/cli/application/builders/EnvilderBuilder.js +0 -53
  91. package/lib/cli/application/builders/EnvilderBuilder.js.map +0 -1
  92. package/lib/cli/domain/ports/IEnvFileManager.d.ts.map +0 -1
  93. package/lib/cli/domain/ports/IEnvFileManager.js.map +0 -1
  94. package/lib/cli/domain/ports/ILogger.d.ts.map +0 -1
  95. package/lib/cli/domain/ports/ILogger.js.map +0 -1
  96. package/lib/cli/domain/ports/ISecretProvider.d.ts +0 -4
  97. package/lib/cli/domain/ports/ISecretProvider.d.ts.map +0 -1
  98. package/lib/cli/domain/ports/ISecretProvider.js.map +0 -1
  99. package/lib/cli/infrastructure/AwsSsmSecretProvider.d.ts.map +0 -1
  100. package/lib/cli/infrastructure/AwsSsmSecretProvider.js +0 -26
  101. package/lib/cli/infrastructure/AwsSsmSecretProvider.js.map +0 -1
  102. package/lib/cli/infrastructure/ConsoleLogger.d.ts.map +0 -1
  103. package/lib/cli/infrastructure/ConsoleLogger.js.map +0 -1
  104. package/lib/cli/infrastructure/EnvFileManager.d.ts.map +0 -1
  105. package/lib/cli/infrastructure/EnvFileManager.js.map +0 -1
  106. package/lib/cli/infrastructure/PackageJsonFinder.d.ts.map +0 -1
  107. package/lib/cli/infrastructure/PackageJsonFinder.js.map +0 -1
  108. /package/lib/{cli → envilder}/domain/ports/IEnvFileManager.d.ts +0 -0
  109. /package/lib/{cli → envilder}/domain/ports/IEnvFileManager.js +0 -0
  110. /package/lib/{cli → envilder}/domain/ports/ILogger.d.ts +0 -0
  111. /package/lib/{cli → envilder}/domain/ports/ILogger.js +0 -0
  112. /package/lib/{cli → envilder}/domain/ports/ISecretProvider.js +0 -0
  113. /package/lib/{cli/infrastructure → envilder/infrastructure/Logger}/ConsoleLogger.js +0 -0
  114. /package/lib/{cli/infrastructure → envilder/infrastructure/VersionFinder}/PackageJsonFinder.d.ts +0 -0
  115. /package/lib/{cli/infrastructure → envilder/infrastructure/VersionFinder}/PackageJsonFinder.js +0 -0
package/README.md CHANGED
@@ -1,8 +1,9 @@
1
- # Envilder
1
+ # 🗝️ Envilder ☁️
2
2
 
3
3
  <p align="center">
4
4
  <img src="https://github.com/user-attachments/assets/96bf1efa-7d21-440a-a414-3a20e7f9a1f1" alt="Envilder">
5
5
  </p>
6
+ </p>
6
7
 
7
8
  <p align="center">
8
9
  <b>✨ A CLI that securely centralizes your environment variables from AWS SSM as a single source of truth ✨</b>
@@ -20,219 +21,413 @@
20
21
  </a>
21
22
  </p>
22
23
 
23
- ---
24
+ ## Why centralize environment variables?
24
25
 
25
- ## Video Demonstration 🎥
26
+ Environment variables are crucial for configuring applications across different environments
27
+ (development, production) or even projects. Without proper management, they become:
26
28
 
27
- Check out this video to learn how to use Envilder:
29
+ - 🔐 **Security risks** when stored in code repositories
30
+ - 🔄 **Out of sync** across team members and deployment environments
31
+ - 🧩 **Scattered** across various documentation, chat messages, and emails
28
32
 
29
- <video width="640" height="360" controls>
30
- <source src="https://github.com/user-attachments/assets/3c4985e6-49e9-4f29-bf1c-130747df0ca6" type="video/mp4">
31
- Your browser does not support the video tag.
32
- </video>
33
+ **Envilder** solves these problems by using AWS SSM Parameter Store as a secure, centralized location for all your
34
+ environment variables, ensuring everyone on your team works with the same configuration and no secrets are exposed
35
+ in your codebase.
33
36
 
34
37
  ---
35
38
 
36
- ## Table of contents
37
-
38
- - [Envilder](#envilder)
39
- - [Video Demonstration 🎥](#video-demonstration-)
40
- - [Table of contents](#table-of-contents)
41
- - [Features](#features)
42
- - [Feature status](#feature-status)
43
- - [Quick start 🚀](#quick-start-)
44
- - [How it works 🛠️](#how-it-works-️)
45
- - [Installation 💾](#installation-)
46
- - [Usage](#usage)
47
- - [Example](#example)
48
- - [Working with multiple AWS profiles](#working-with-multiple-aws-profiles)
49
- - [Sample output 📄](#sample-output-)
50
- - [Roadmap 🗺️](#roadmap-️)
51
- - [Contributing 🤝](#contributing-)
52
- - [License 📄](#license-)
39
+ ## 📚 Table of Contents
40
+
41
+ - [🗝️ Envilder ☁️](#️-envilder-️)
42
+ - [Why centralize environment variables?](#why-centralize-environment-variables)
43
+ - [📚 Table of Contents](#-table-of-contents)
44
+ - [⚙️ Features](#️-features)
45
+ - [🧱 Feature Status](#-feature-status)
46
+ - [💾 Installation](#-installation)
47
+ - [🚀 Quick Start](#-quick-start)
48
+ - [🎥 Video Demonstration](#-video-demonstration)
49
+ - [🛠️ How it works](#️-how-it-works)
50
+ - [🎮 Usage](#-usage)
51
+ - [🚀 Push Mode (`--push`)](#-push-mode---push)
52
+ - [🍄 Method 1: Push from .env file](#-method-1-push-from-env-file)
53
+ - [ Method 2: Push a single variable](#-method-2-push-a-single-variable)
54
+ - [🧰 Push Mode options summary](#-push-mode-options-summary)
55
+ - [🧪 Push Mode Examples](#-push-mode-examples)
56
+ - [⬇️ Pull Mode (`--map` and `--envfile`)](#️-pull-mode---map-and---envfile)
57
+ - [⚙️ Pull Mode Options](#️-pull-mode-options)
58
+ - [🧪 Pull Mode Examples](#-pull-mode-examples)
59
+ - [📜 Sample Output](#-sample-output)
60
+ - [👥 Working with multiple AWS profiles](#-working-with-multiple-aws-profiles)
61
+ - [⬇️ Pull Mode Example](#️-pull-mode-example)
62
+ - [🚀 Push Mode Example](#-push-mode-example)
63
+ - [🏁 Roadmap](#-roadmap)
64
+ - [🤝 Contributing](#-contributing)
65
+ - [📜 License](#-license)
53
66
 
54
67
  ---
55
68
 
56
- ## Features
69
+ ## ⚙️ Features
57
70
 
58
- - **🔒 Strict access control** — AWS IAM policies control who accesses which secrets (dev vs prod)
59
- - **📊 Full audit trail** — All parameter access is logged in CloudTrail for compliance
60
- - **🧩 Single source of truth** — No more copying .env files from Notion or emails
61
- - **🔁 Idempotent operations** — Only variables in your mapping file are overwritten; others are preserved
62
- - **🧱 No extra infrastructure** — Uses AWS SSM's reliability, no new services needed
71
+ - 🔒 **Strict access control** — IAM policies define access to secrets across stages (dev, staging, prod)
72
+ - 📊 **Auditable** — All reads/writes are logged in AWS CloudTrail
73
+ - 🧩 **Single source of truth** — No more Notion, emails or copy/paste of envs
74
+ - 🔁 **Idempotent sync** — Only what’s in your map gets updated. Nothing else is touched
75
+ - 🧱 **Zero infrastructure** — Fully based on native AWS SSM. No Lambdas, no servers, no fuss
63
76
 
64
- ### Feature status
77
+ ### 🧱 Feature Status
65
78
 
66
- | Feature | Status | Notes |
67
- |--------------------------------|---------------|-------|
68
- | Mapping-based secret resolution| ✅ Implemented | |
69
- | .env file generation | ✅ Implemented | |
70
- | AWS profile support | ✅ Implemented | |
71
- | Auto-discovery mode (`--auto`) | Not implemented | Planned |
72
- | Check/sync mode (`--check`) | ❌ Not implemented | Planned |
73
- | Import/push mode (`--import`) | ❌ Not implemented | Planned |
74
- | Webhook/Slack notification | ❌ Not implemented | Planned |
75
- | Hierarchical mapping | ❌ Not implemented | Only flat JSON mapping supported |
76
- | Plugin system | ❌ Not implemented | Only AWS SSM supported |
79
+ | Feature | Status | Notes |
80
+ |--|--|--|
81
+ | Mapping-based resolution | ✅ Implemented | |
82
+ | `.env` file generation | ✅ Implemented | |
83
+ | AWS profile support | ✅ Implemented | `--profile` flag |
84
+ | Import/push mode (`--push`) | Implemented | |
85
+ | Auto-discovery (`--auto`) | ❌ Planned | Detect keys based on env |
86
+ | Check/sync mode (`--check`) | ❌ Planned | Diff local vs remote |
87
+ | Webhook/Slack notification | ❌ Planned | On push/pull events |
88
+ | Hierarchical mapping | ❌ Not yet | Flat mapping only |
89
+ | Plugin system | ❌ Not yet | SSM is the only backend (for now) |
77
90
 
78
91
  ---
79
92
 
80
- ## Quick start 🚀
93
+ ## 💾 Installation
94
+
95
+ 🛠 Requirements:
96
+
97
+ - Node.js **v20+**
98
+ - AWS CLI installed and configured
99
+ - IAM user/role with `ssm:GetParameter`, `ssm:PutParameter`
81
100
 
82
101
  ```bash
83
102
  npm install -g envilder
103
+ ```
104
+
105
+ > 💡 **New to AWS SSM?** AWS Systems Manager Parameter Store provides secure storage for configuration data and secrets:
106
+ >
107
+ > - [AWS SSM Parameter Store Overview](https://docs.aws.amazon.com/systems-manager/latest/userguide/systems-manager-parameter-store.html)
108
+ > - [Setting up AWS CLI credentials](https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-files.html)
109
+ > - [IAM permissions for SSM](https://docs.aws.amazon.com/systems-manager/latest/userguide/setup-instance-profile.html)
110
+
111
+ ---
112
+
113
+ ## 🚀 Quick Start
114
+
115
+ Get started with **Envilder** in 3 simple steps. Remember to add `.env` to your `.gitignore` file for security.
116
+
117
+ Initial Setup
118
+
119
+ ```bash
120
+ # Step 1: Create a parameter mapping file
121
+ echo '{
122
+ "DB_PASSWORD": "/my-app/db/password"
123
+ }' > param-map.json
84
124
 
85
- # Watch the video demonstration for detailed guidance
86
- # https://github.com/user-attachments/assets/3c4985e6-49e9-4f29-bf1c-130747df0ca6
125
+ # Step 2: Push a secret to AWS SSM Parameter Store
126
+ envilder --push --key=DB_PASSWORD --value=12345 --ssm-path=/my-app/db/password
127
+ ```
87
128
 
88
- echo '{"DB_PASSWORD": "/my-app/db/password"}' > param-map.json
129
+ Ongoing Usage
89
130
 
131
+ ```bash
132
+ # Step 3: Generate your .env file from AWS SSM
90
133
  envilder --map=param-map.json --envfile=.env
91
134
  ```
92
135
 
136
+ 🎯 That’s it — your secrets are now managed and versioned from AWS SSM.
137
+
138
+ ---
139
+
140
+ ## 🎥 Video Demonstration
141
+
142
+ Watch how Envilder works in less than 1 minute:
143
+
144
+ ![Watch the video](https://github.com/user-attachments/assets/2de7cac3-0c13-4706-96f6-bf2ef12b661a)
145
+
93
146
  ---
94
147
 
95
- ## How it works 🛠️
148
+ ## 🛠️ How it works
96
149
 
97
150
  ```mermaid
151
+ graph LR
152
+ A[Mapping File (param-map.json)] --> B[Envilder]
153
+ C[.env File or --key] --> B
154
+ D[AWS Credentials] --> B
155
+ E[AWS SSM] --> B
156
+ B --> F[Pull/Push Secrets 💾]
157
+ ```
158
+
159
+ 1. Define mappings in JSON: `{"ENV_VAR": "ssm/path"}`
160
+ 2. Run Envilder: `--push` to upload, or `--map` + `--envfile` to generate
161
+ 3. It talks to SSM using your AWS credentials
162
+ 4. Result: your secrets synced ✅
98
163
 
164
+ ---
165
+
166
+ ## 🎮 Usage
167
+
168
+ ### 🚀 Push Mode (`--push`)
169
+
170
+ Push Mode uploads environment variables to AWS SSM Parameter Store. It has two distinct operation methods:
171
+
172
+ #### 🍄 Method 1: Push from .env file
173
+
174
+ **Requirements:**
175
+
176
+ - `--push` flag to enable Push Mode
177
+ - `--envfile` pointing to your local .env file
178
+ - `--map` pointing to your parameter mapping JSON file
179
+
180
+ **How File-Based Push Works:**
181
+
182
+ 1. Envilder reads your local `.env` file to get variable names and values
183
+ 2. Envilder reads your `map` file to find the corresponding SSM paths
184
+ 3. For each variable found in both files, Envilder pushes the value to AWS SSM
185
+ 4. No modifications are made to your local files
186
+
187
+ ```mermaid
99
188
  graph LR
100
- A[Mapping File] --> B[Envilder]
101
- C[AWS Credentials] --> B
102
- B --> D[.env File]
103
- E[SSM Parameters] --> B
189
+ A[.env File] --> |Variables & Values| B[Envilder]
190
+ C[Mapping File] --> |SSM Paths| B
191
+ D[AWS Profile] --> B
192
+ B --> E[AWS SSM Parameter Store]
193
+ ```
104
194
 
195
+ **Example:**
196
+ If your `.env` file contains:
197
+
198
+ ```text
199
+ API_KEY=abc123
200
+ DB_PASSWORD=secret456
105
201
  ```
106
202
 
107
- 1. **Define your mapping** Simple JSON mapping env vars to SSM paths
108
- 2. **Run Envilder** — One command with your mapping file
109
- 3. **Auto-fetch from AWS** — Retrieves values using your AWS credentials
110
- 4. **Get your .env file** — Ready to use in your project
203
+ And your `param-map.json` file contains:
111
204
 
112
- ---
205
+ ```json
206
+ {
207
+ "API_KEY": "/myapp/api/key",
208
+ "DB_PASSWORD": "/myapp/db/password"
209
+ }
210
+ ```
211
+
212
+ Running this command:
213
+
214
+ ```bash
215
+ envilder --push --envfile=.env --map=param-map.json
216
+ ```
217
+
218
+ Will push:
219
+
220
+ - Value `abc123` to SSM path `/myapp/api/key`
221
+ - Value `secret456` to SSM path `/myapp/db/password`
222
+
223
+ ### ⭐ Method 2: Push a single variable
224
+
225
+ **What it does:**
226
+ Uploads a single environment variable directly to AWS SSM Parameter Store without using any files.
227
+
228
+ **Required parameters:**
113
229
 
114
- ## Installation 💾
230
+ - `--push`: Activates Push Mode
231
+ - `--key=VAR_NAME`: The name of the environment variable
232
+ - `--value=secret123`: The value to store in AWS SSM
233
+ - `--ssm-path=/your/path`: The full AWS SSM parameter path
115
234
 
116
- **Requires:** Node.js >= 20.0.0, AWS CLI configured with SSM access
235
+ **Important notes:**
236
+
237
+ - NO files are read or modified
238
+ - This is a direct command-to-SSM operation
239
+ - Useful for quick updates or CI/CD pipelines
240
+
241
+ ```mermaid
242
+ graph LR
243
+ A[Command Line Arguments] --> B[Envilder]
244
+ C[AWS Profile] --> B
245
+ B --> D[AWS SSM Parameter Store]
246
+ ```
247
+
248
+ **Example:**
117
249
 
118
250
  ```bash
119
- npm install -g envilder
251
+ envilder --push --key=API_KEY --value=abc123 --ssm-path=/myapp/api/key
120
252
  ```
121
253
 
122
- ---
254
+ Will push:
255
+
256
+ - Value `abc123` to SSM path `/myapp/api/key`
257
+
258
+ ### 🧰 Push Mode options summary
259
+
260
+ **Common Options:**
261
+
262
+ | Option | Description |
263
+ |------------- | ---------------------------------- |
264
+ | `--push` | Required: Enables push mode |
265
+ | `--profile` | Optional: AWS CLI profile to use |
123
266
 
124
- ## Usage
267
+ **Method 1: File-Based Push Options:**
268
+
269
+ | Option | Description |
270
+ |------------- | -------------------------------------------------- |
271
+ | `--envfile` | Required: Path to your local .env file |
272
+ | `--map` | Required: Path to your parameter mapping JSON file |
273
+
274
+ **Method 2: Single-Variable Push Options:**
275
+
276
+ | Option | Description |
277
+ |------------- | ------------------------------------------- |
278
+ | `--key` | Required: Environment variable name |
279
+ | `--value` | Required: Value to store in AWS SSM |
280
+ | `--ssm-path` | Required: Full SSM parameter path |
281
+
282
+ ### 🧪 Push Mode Examples
283
+
284
+ **Method 1: Push from .env file (multiple variables at once):**
125
285
 
126
286
  ```bash
127
- envilder --map=<mapping-file> --envfile=<output-file> [--profile=<aws-profile>]
287
+ # Basic usage - pushes all variables found in both .env and map files
288
+ envilder --push --envfile=.env --map=param-map.json
289
+
290
+ # With AWS profile - for different environments
291
+ envilder --push --envfile=.env.prod --map=param-map.json --profile=prod-account
128
292
  ```
129
293
 
130
- | Option | Description |
131
- |-------------|---------------------------------------------|
132
- | `--map` | Path to JSON mapping file (required) |
133
- | `--envfile` | Path to output .env file (required) |
134
- | `--profile` | AWS CLI profile to use (optional) |
294
+ **Method 2: Push a single variable (no files needed):**
135
295
 
136
- ### Example
296
+ ```bash
297
+ # Basic usage - pushes one variable directly to SSM
298
+ envilder --push --key=API_KEY --value=secret123 --ssm-path=/my/path
137
299
 
138
- 1. **Create a parameter in AWS SSM Parameter Store using AWS CLI:**
300
+ # With AWS profile
301
+ envilder --push --key=API_KEY --value=secret123 --ssm-path=/my/path --profile=dev
302
+ ```
139
303
 
140
- ```bash
141
- aws ssm put-parameter --name "/path/to/ssm/token" --value "my-secret-token-value" --type "SecureString"
142
- aws ssm put-parameter --name "/path/to/ssm/password" --value "my-secret-password-value" --type "SecureString"
143
- ```
304
+ ---
144
305
 
145
- You can also create the parameter in a specific profile (for example, `dev-account`):
306
+ ### ⬇️ Pull Mode (`--map` and `--envfile`)
146
307
 
147
- ```bash
148
- aws ssm put-parameter --name "/path/to/ssm/token" --value "my-secret-token-value" --type "SecureString" --profile dev-account
149
- aws ssm put-parameter --name "/path/to/ssm/password" --value "my-secret-password-value" --type "SecureString" --profile dev-account
150
- ```
308
+ Downloads secrets from SSM and writes to `.env`.
151
309
 
152
- 2. Create a mapping file `param-map.json`:
310
+ #### ⚙️ Pull Mode Options
153
311
 
154
- ```json
155
- {
156
- "SECRET_TOKEN": "/path/to/ssm/token",
157
- "SECRET_KEY": "/path/to/ssm/password"
158
- }
159
- ```
312
+ | Option | Description |
313
+ | ----------- | ----------------------------------- |
314
+ | `--map` | JSON mapping of env var to SSM path |
315
+ | `--envfile` | Path to write `.env` |
316
+ | `--profile` | AWS profile to use |
160
317
 
161
- 3. Generate your `.env` file:
318
+ #### 🧪 Pull Mode Examples
162
319
 
163
- ```bash
164
- envilder --map=param-map.json --envfile=.env
165
- ```
320
+ ```bash
321
+ envilder --map=param-map.json --envfile=.env
322
+ ```
166
323
 
167
- 4. Watch the video demonstration for detailed guidance:
324
+ With profile:
168
325
 
169
- ```plaintext
170
- https://github.com/user-attachments/assets/3c4985e6-49e9-4f29-bf1c-130747df0ca6
171
- ```
326
+ ```bash
327
+ envilder --map=param-map.json --envfile=.env --profile=dev-account
328
+ ```
329
+
330
+ #### 📜 Sample Output
331
+
332
+ After running the pull command above with a `param-map.json` file containing:
333
+
334
+ ```json
335
+ {
336
+ "API_KEY": "/myapp/api/key",
337
+ "DB_PASSWORD": "/myapp/db/password",
338
+ "SECRET_TOKEN": "/myapp/auth/token"
339
+ }
340
+ ```
341
+
342
+ Your generated `.env` file would look like:
343
+
344
+ ```dotenv
345
+ # Generated by Envilder on 2025-07-13
346
+ API_KEY=abc123
347
+ DB_PASSWORD=secret456
348
+ SECRET_TOKEN=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9
349
+ ```
350
+
351
+ This keeps your sensitive values secure in AWS SSM while providing local access for development.
172
352
 
173
353
  ---
174
354
 
175
- ## Working with multiple AWS profiles
355
+ ## 👥 Working with multiple AWS profiles
176
356
 
177
- Configure different profiles in your AWS credentials file (usually at `~/.aws/credentials` or `%USERPROFILE%\.aws\credentials`):
357
+ Edit your `~/.aws/credentials`:
178
358
 
179
359
  ```ini
180
360
  [default]
181
- aws_access_key_id=YOUR_DEFAULT_ACCESS_KEY
182
- aws_secret_access_key=YOUR_DEFAULT_SECRET_KEY
361
+ aws_access_key_id=DEFAULT_KEY
362
+ aws_secret_access_key=DEFAULT_SECRET
183
363
 
184
364
  [dev-account]
185
- aws_access_key_id=YOUR_DEV_ACCESS_KEY
186
- aws_secret_access_key=YOUR_DEV_SECRET_KEY
365
+ aws_access_key_id=DEV_KEY
366
+ aws_secret_access_key=DEV_SECRET
187
367
 
188
368
  [prod-account]
189
- aws_access_key_id=YOUR_PROD_ACCESS_KEY
190
- aws_secret_access_key=YOUR_PROD_SECRET_KEY
369
+ aws_access_key_id=PROD_KEY
370
+ aws_secret_access_key=PROD_SECRET
191
371
  ```
192
372
 
193
- Specify which profile to use:
373
+ ---
374
+
375
+ ### ⬇️ Pull Mode Example
194
376
 
195
377
  ```bash
196
- # Development
378
+ # Default
379
+ envilder --map=param-map.json --envfile=.env.dev
197
380
 
198
- envilder --map=param-map.json --envfile=.env.development --profile=dev-account
381
+ # Development
382
+ envilder --map=param-map.json --envfile=.env.dev --profile=dev-account
199
383
 
200
384
  # Production
201
-
202
- envilder --map=param-map.json --envfile=.env.production --profile=prod-account
385
+ envilder --map=param-map.json --envfile=.env.prod --profile=prod-account
203
386
  ```
204
387
 
205
388
  ---
206
389
 
207
- ## Sample output 📄
390
+ ### 🚀 Push Mode Example
208
391
 
209
- Example `.env` file generated:
392
+ ```bash
393
+ # Default
394
+ envilder --push --key=API_KEY --value=secret123 --ssm-path=/dev/api/key
210
395
 
211
- ```ini
212
- SECRET_TOKEN=mockedEmail@example.com
213
- SECRET_KEY=mockedPassword
396
+ # Development
397
+ envilder --push --key=API_KEY --value=secret123 --ssm-path=/dev/api/key --profile=dev-account
398
+
399
+ # Production
400
+ envilder --push --key=API_KEY --value=secret123 --ssm-path=/prod/api/key --profile=prod-account
214
401
  ```
215
402
 
216
403
  ---
217
404
 
218
- ## Roadmap 🗺️
405
+ ## 🏁 Roadmap
406
+
407
+ 🧭 Planned features:
219
408
 
220
- See [ROADMAP.md](./ROADMAP.md) for planned features and ideas.
409
+ - 🔍 Drift detection (`--check`)
410
+ - 🧠 Auto-discovery (`--auto`)
411
+ - 📨 Slack/Webhook notifications
412
+ - 🔌 Plugin system (Vault, Secrets Manager, etc.)
413
+
414
+ 👉 See full [ROADMAP.md](./ROADMAP.md)
221
415
 
222
416
  ---
223
417
 
224
- ## Contributing 🤝
418
+ ## 🤝 Contributing
225
419
 
226
- Contributions are welcome! Please see the [contributing guidelines](https://github.com/macalbert/envilder/blob/main/.github/pull_request_template.md).
420
+ All help is welcome PRs, issues, ideas!
227
421
 
228
- Feel free to open issues or pull requests.
422
+ - 🔧 Use our [Pull Request Template](.github/pull_request_template.md)
423
+ - 🧪 Add tests where possible
424
+ - 💬 Feedback and discussion welcome
229
425
 
230
426
  ---
231
427
 
232
- ## License 📄
233
-
234
- MIT © [Marçal Albert](https://github.com/macalbert).
428
+ ## 📜 License
235
429
 
236
- See [LICENSE](./LICENSE) for details.
430
+ MIT © [Marçal Albert](https://github.com/macalbert)
431
+ See [LICENSE](./LICENSE)
237
432
 
238
433
  ---
package/ROADMAP.md CHANGED
@@ -10,6 +10,7 @@ Envilder aims to be the simplest, most reliable way to generate `.env` files fro
10
10
  - Supports AWS profiles (`AWS_PROFILE`)
11
11
  - Compatible with SecureString and plain parameters
12
12
  - CLI-first, lightweight
13
+ - 📸 **Demo GIF/video** showing the tool in action (terminal + env + app)
13
14
 
14
15
  ---
15
16
 
@@ -17,21 +18,20 @@ Envilder aims to be the simplest, most reliable way to generate `.env` files fro
17
18
 
18
19
  ### 🔹 Usability & Visibility
19
20
 
20
- - [ ] 🔍 **Auto-discovery mode** (`--auto`) for fetching all parameters with a given prefix
21
- - [ ] 📸 **Demo GIF/video** showing the tool in action (terminal + env + app)
22
- - [ ] ✍️ **Tutorial repo** showing full example with GitHub Actions
21
+ - [ ] 🔍 **Auto-discovery mode** (`--auto`) for fetching all parameters with a given prefix
22
+ - [ ] ✍️ **Tutorial repo** showing full example with GitHub Actions
23
23
  - [ ] 🛍️ **Official GitHub Action** (in Marketplace)
24
24
 
25
25
  ### 🔹 Dev Experience & Adoption
26
26
 
27
- - [ ] ✅ **Check mode** (`--check`) to validate SSM vs existing `.env` and fail CI if out-of-sync
27
+ - [ ] ✅ **Check mode** (`--check`) to validate SSM vs existing `.env` and fail CI if out-of-sync
28
28
  - [ ] 📝 **Onboarding doc** for new teams (how to set up param-map, profiles, best practices)
29
29
 
30
30
  ### 🔹 Advanced Features
31
31
 
32
- - [ ] ↩️ **Import mode** (`--import`) to push local `.env` back to AWS SSM
33
- - [ ] 🔔 **Optional webhook/Slack notifier** on secret sync (for audit/logging)
34
- - [ ] 🌐 **Web-based interactive demo** (optional) to test mappings live
32
+ - [ ] ↩️ **Push mode** (`--push`) to push local `.env` back to AWS SSM
33
+ - [ ] 🔔 **Optional webhook/Slack notifier** on secret sync (for audit/logging)
34
+ - [ ] 🌐 **Web-based interactive demo** (optional) to test mappings live
35
35
  - [ ] 🧠 **Awesome list submissions** and community templates
36
36
 
37
37
  ---
@@ -39,7 +39,7 @@ Envilder aims to be the simplest, most reliable way to generate `.env` files fro
39
39
  ## 🧪 Long-term Ideas (Open to Feedback)
40
40
 
41
41
  - [ ] 📁 Support hierarchical `param-map.json` per environment
42
- - [ ] 🧬 Plugin system for custom resolvers (e.g. secrets from other providers)
42
+ - [ ] 🧬 Plugin system for custom resolvers (e.g., secrets from other providers)
43
43
 
44
44
  ---
45
45
 
@@ -48,3 +48,19 @@ Envilder aims to be the simplest, most reliable way to generate `.env` files fro
48
48
  If you’ve faced similar problems or want to help improve this tool, feel free to open an issue, submit a PR
49
49
  or reach out.
50
50
  Every bit of feedback helps make this tool better for the community.
51
+
52
+ ---
53
+
54
+ ## Feature Status
55
+
56
+ | Feature | Status | Notes |
57
+ |--------------------------------|---------------|-------|
58
+ | Push mode (`--push`) | ✅ Implemented | |
59
+ | Mapping-based secret resolution| ✅ Implemented | |
60
+ | .env file generation | ✅ Implemented | |
61
+ | AWS profile support | ✅ Implemented | |
62
+ | Auto-discovery mode (`--auto`) | ❌ Not implemented | Planned |
63
+ | Check/sync mode (`--check`) | ❌ Not implemented | Planned |
64
+ | Webhook/Slack notification | ❌ Not implemented | Planned |
65
+ | Hierarchical mapping | ❌ Not implemented | Only flat JSON mapping supported |
66
+ | Plugin system | ❌ Not implemented | Only AWS SSM supported |
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env node
2
+ export declare function main(): Promise<void>;
3
+ //# sourceMappingURL=Cli.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Cli.d.ts","sourceRoot":"","sources":["../../../src/apps/cli/Cli.ts"],"names":[],"mappings":";AAqCA,wBAAsB,IAAI,kBA2CzB"}