envilder 0.5.5 → 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.
- package/README.md +322 -110
- package/ROADMAP.md +24 -8
- package/lib/apps/cli/Cli.d.ts +3 -0
- package/lib/apps/cli/Cli.d.ts.map +1 -0
- package/lib/apps/cli/Cli.js +79 -0
- package/lib/apps/cli/Cli.js.map +1 -0
- package/lib/envilder/application/dispatch/DispatchActionCommand.d.ts +15 -0
- package/lib/envilder/application/dispatch/DispatchActionCommand.d.ts.map +1 -0
- package/lib/envilder/application/dispatch/DispatchActionCommand.js +26 -0
- package/lib/envilder/application/dispatch/DispatchActionCommand.js.map +1 -0
- package/lib/envilder/application/dispatch/DispatchActionCommandHandler.d.ts +16 -0
- package/lib/envilder/application/dispatch/DispatchActionCommandHandler.d.ts.map +1 -0
- package/lib/envilder/application/dispatch/DispatchActionCommandHandler.js +68 -0
- package/lib/envilder/application/dispatch/DispatchActionCommandHandler.js.map +1 -0
- package/lib/envilder/application/dispatch/builders/DispatchActionCommandHandlerBuilder.d.ts +15 -0
- package/lib/envilder/application/dispatch/builders/DispatchActionCommandHandlerBuilder.d.ts.map +1 -0
- package/lib/envilder/application/dispatch/builders/DispatchActionCommandHandlerBuilder.js +38 -0
- package/lib/envilder/application/dispatch/builders/DispatchActionCommandHandlerBuilder.js.map +1 -0
- package/lib/envilder/application/pullSsmToEnv/PullSsmToEnvCommand.d.ts +7 -0
- package/lib/envilder/application/pullSsmToEnv/PullSsmToEnvCommand.d.ts.map +1 -0
- package/lib/envilder/application/pullSsmToEnv/PullSsmToEnvCommand.js +10 -0
- package/lib/envilder/application/pullSsmToEnv/PullSsmToEnvCommand.js.map +1 -0
- package/lib/envilder/application/pullSsmToEnv/PullSsmToEnvCommandHandler.d.ts +24 -0
- package/lib/envilder/application/pullSsmToEnv/PullSsmToEnvCommandHandler.d.ts.map +1 -0
- package/lib/envilder/application/pullSsmToEnv/PullSsmToEnvCommandHandler.js +92 -0
- package/lib/envilder/application/pullSsmToEnv/PullSsmToEnvCommandHandler.js.map +1 -0
- package/lib/envilder/application/pushEnvToSsm/PushEnvToSsmCommand.d.ts +7 -0
- package/lib/envilder/application/pushEnvToSsm/PushEnvToSsmCommand.d.ts.map +1 -0
- package/lib/envilder/application/pushEnvToSsm/PushEnvToSsmCommand.js +10 -0
- package/lib/envilder/application/pushEnvToSsm/PushEnvToSsmCommand.js.map +1 -0
- package/lib/envilder/application/pushEnvToSsm/PushEnvToSsmCommandHandler.d.ts +22 -0
- package/lib/envilder/application/pushEnvToSsm/PushEnvToSsmCommandHandler.d.ts.map +1 -0
- package/lib/envilder/application/pushEnvToSsm/PushEnvToSsmCommandHandler.js +74 -0
- package/lib/envilder/application/pushEnvToSsm/PushEnvToSsmCommandHandler.js.map +1 -0
- package/lib/envilder/application/pushSingle/PushSingleCommand.d.ts +8 -0
- package/lib/envilder/application/pushSingle/PushSingleCommand.d.ts.map +1 -0
- package/lib/envilder/application/pushSingle/PushSingleCommand.js +11 -0
- package/lib/envilder/application/pushSingle/PushSingleCommand.js.map +1 -0
- package/lib/envilder/application/pushSingle/PushSingleCommandHandler.d.ts +15 -0
- package/lib/envilder/application/pushSingle/PushSingleCommandHandler.d.ts.map +1 -0
- package/lib/envilder/application/pushSingle/PushSingleCommandHandler.js +37 -0
- package/lib/envilder/application/pushSingle/PushSingleCommandHandler.js.map +1 -0
- package/lib/envilder/domain/CliOptions.d.ts +34 -0
- package/lib/envilder/domain/CliOptions.d.ts.map +1 -0
- package/lib/envilder/domain/CliOptions.js +2 -0
- package/lib/envilder/domain/CliOptions.js.map +1 -0
- package/lib/envilder/domain/EnvironmentVariable.d.ts +37 -0
- package/lib/envilder/domain/EnvironmentVariable.d.ts.map +1 -0
- package/lib/envilder/domain/EnvironmentVariable.js +59 -0
- package/lib/envilder/domain/EnvironmentVariable.js.map +1 -0
- package/lib/envilder/domain/OperationMode.d.ts +6 -0
- package/lib/envilder/domain/OperationMode.d.ts.map +1 -0
- package/lib/envilder/domain/OperationMode.js +7 -0
- package/lib/envilder/domain/OperationMode.js.map +1 -0
- package/lib/envilder/domain/errors/DomainErrors.d.ts +34 -0
- package/lib/envilder/domain/errors/DomainErrors.d.ts.map +1 -0
- package/lib/envilder/domain/errors/DomainErrors.js +40 -0
- package/lib/envilder/domain/errors/DomainErrors.js.map +1 -0
- package/lib/envilder/domain/ports/IEnvFileManager.d.ts.map +1 -0
- package/lib/envilder/domain/ports/IEnvFileManager.js.map +1 -0
- package/lib/envilder/domain/ports/ILogger.d.ts +6 -0
- package/lib/envilder/domain/ports/ILogger.d.ts.map +1 -0
- package/lib/envilder/domain/ports/ILogger.js +2 -0
- package/lib/envilder/domain/ports/ILogger.js.map +1 -0
- package/lib/envilder/domain/ports/ISecretProvider.d.ts +5 -0
- package/lib/envilder/domain/ports/ISecretProvider.d.ts.map +1 -0
- package/lib/envilder/domain/ports/ISecretProvider.js.map +1 -0
- package/lib/{cli/infrastructure → envilder/infrastructure/Aws}/AwsSsmSecretProvider.d.ts +2 -1
- package/lib/envilder/infrastructure/Aws/AwsSsmSecretProvider.d.ts.map +1 -0
- package/lib/envilder/infrastructure/Aws/AwsSsmSecretProvider.js +49 -0
- package/lib/envilder/infrastructure/Aws/AwsSsmSecretProvider.js.map +1 -0
- package/lib/{cli/infrastructure → envilder/infrastructure/EnvManager}/EnvFileManager.d.ts +4 -1
- package/lib/envilder/infrastructure/EnvManager/EnvFileManager.d.ts.map +1 -0
- package/lib/{cli/infrastructure → envilder/infrastructure/EnvManager}/EnvFileManager.js +29 -7
- package/lib/envilder/infrastructure/EnvManager/EnvFileManager.js.map +1 -0
- package/lib/envilder/infrastructure/Logger/ConsoleLogger.d.ts +7 -0
- package/lib/envilder/infrastructure/Logger/ConsoleLogger.d.ts.map +1 -0
- package/lib/envilder/infrastructure/Logger/ConsoleLogger.js +12 -0
- package/lib/envilder/infrastructure/Logger/ConsoleLogger.js.map +1 -0
- package/lib/envilder/infrastructure/VersionFinder/PackageJsonFinder.d.ts.map +1 -0
- package/lib/{cli/infrastructure → envilder/infrastructure/VersionFinder}/PackageJsonFinder.js +3 -3
- package/lib/envilder/infrastructure/VersionFinder/PackageJsonFinder.js.map +1 -0
- package/package.json +11 -9
- package/lib/Cli.d.ts +0 -10
- package/lib/Cli.d.ts.map +0 -1
- package/lib/Cli.js +0 -55
- package/lib/Cli.js.map +0 -1
- package/lib/cli/application/EnvilderHandler.d.ts +0 -19
- package/lib/cli/application/EnvilderHandler.d.ts.map +0 -1
- package/lib/cli/application/EnvilderHandler.js +0 -73
- package/lib/cli/application/EnvilderHandler.js.map +0 -1
- package/lib/cli/application/builders/EnvilderBuilder.d.ts +0 -14
- package/lib/cli/application/builders/EnvilderBuilder.d.ts.map +0 -1
- package/lib/cli/application/builders/EnvilderBuilder.js +0 -41
- package/lib/cli/application/builders/EnvilderBuilder.js.map +0 -1
- package/lib/cli/domain/ports/IEnvFileManager.d.ts.map +0 -1
- package/lib/cli/domain/ports/IEnvFileManager.js.map +0 -1
- package/lib/cli/domain/ports/ISecretProvider.d.ts +0 -4
- package/lib/cli/domain/ports/ISecretProvider.d.ts.map +0 -1
- package/lib/cli/domain/ports/ISecretProvider.js.map +0 -1
- package/lib/cli/infrastructure/AwsSsmSecretProvider.d.ts.map +0 -1
- package/lib/cli/infrastructure/AwsSsmSecretProvider.js +0 -26
- package/lib/cli/infrastructure/AwsSsmSecretProvider.js.map +0 -1
- package/lib/cli/infrastructure/EnvFileManager.d.ts.map +0 -1
- package/lib/cli/infrastructure/EnvFileManager.js.map +0 -1
- package/lib/cli/infrastructure/PackageJsonFinder.d.ts.map +0 -1
- package/lib/cli/infrastructure/PackageJsonFinder.js.map +0 -1
- /package/lib/{cli → envilder}/domain/ports/IEnvFileManager.d.ts +0 -0
- /package/lib/{cli → envilder}/domain/ports/IEnvFileManager.js +0 -0
- /package/lib/{cli → envilder}/domain/ports/ISecretProvider.js +0 -0
- /package/lib/{cli/infrastructure → envilder/infrastructure/VersionFinder}/PackageJsonFinder.d.ts +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,202 +21,413 @@
|
|
|
20
21
|
</a>
|
|
21
22
|
</p>
|
|
22
23
|
|
|
24
|
+
## Why centralize environment variables?
|
|
25
|
+
|
|
26
|
+
Environment variables are crucial for configuring applications across different environments
|
|
27
|
+
(development, production) or even projects. Without proper management, they become:
|
|
28
|
+
|
|
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
|
|
32
|
+
|
|
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.
|
|
36
|
+
|
|
23
37
|
---
|
|
24
38
|
|
|
25
|
-
## Table of
|
|
26
|
-
|
|
27
|
-
- [Envilder](
|
|
28
|
-
- [
|
|
29
|
-
- [
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
- [
|
|
33
|
-
- [
|
|
34
|
-
- [
|
|
35
|
-
|
|
36
|
-
- [
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
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)
|
|
41
66
|
|
|
42
67
|
---
|
|
43
68
|
|
|
44
|
-
## Features
|
|
69
|
+
## ⚙️ Features
|
|
45
70
|
|
|
46
|
-
-
|
|
47
|
-
-
|
|
48
|
-
-
|
|
49
|
-
-
|
|
50
|
-
-
|
|
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
|
|
51
76
|
|
|
52
|
-
### Feature
|
|
77
|
+
### 🧱 Feature Status
|
|
53
78
|
|
|
54
|
-
| Feature
|
|
55
|
-
|
|
56
|
-
| Mapping-based
|
|
57
|
-
|
|
|
58
|
-
| AWS profile support
|
|
59
|
-
|
|
|
60
|
-
|
|
|
61
|
-
|
|
|
62
|
-
| Webhook/Slack notification
|
|
63
|
-
| Hierarchical mapping
|
|
64
|
-
| Plugin system
|
|
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) |
|
|
65
90
|
|
|
66
91
|
---
|
|
67
92
|
|
|
68
|
-
##
|
|
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`
|
|
69
100
|
|
|
70
101
|
```bash
|
|
71
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.
|
|
72
116
|
|
|
73
|
-
|
|
117
|
+
Initial Setup
|
|
74
118
|
|
|
119
|
+
```bash
|
|
120
|
+
# Step 1: Create a parameter mapping file
|
|
121
|
+
echo '{
|
|
122
|
+
"DB_PASSWORD": "/my-app/db/password"
|
|
123
|
+
}' > param-map.json
|
|
124
|
+
|
|
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
|
+
```
|
|
128
|
+
|
|
129
|
+
Ongoing Usage
|
|
130
|
+
|
|
131
|
+
```bash
|
|
132
|
+
# Step 3: Generate your .env file from AWS SSM
|
|
75
133
|
envilder --map=param-map.json --envfile=.env
|
|
76
134
|
```
|
|
77
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
|
+

|
|
145
|
+
|
|
78
146
|
---
|
|
79
147
|
|
|
80
|
-
## How it works
|
|
148
|
+
## 🛠️ How it works
|
|
81
149
|
|
|
82
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 ✅
|
|
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
|
|
83
186
|
|
|
187
|
+
```mermaid
|
|
84
188
|
graph LR
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
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
|
+
```
|
|
194
|
+
|
|
195
|
+
**Example:**
|
|
196
|
+
If your `.env` file contains:
|
|
89
197
|
|
|
198
|
+
```text
|
|
199
|
+
API_KEY=abc123
|
|
200
|
+
DB_PASSWORD=secret456
|
|
90
201
|
```
|
|
91
202
|
|
|
92
|
-
|
|
93
|
-
2. **Run Envilder** — One command with your mapping file
|
|
94
|
-
3. **Auto-fetch from AWS** — Retrieves values using your AWS credentials
|
|
95
|
-
4. **Get your .env file** — Ready to use in your project
|
|
203
|
+
And your `param-map.json` file contains:
|
|
96
204
|
|
|
97
|
-
|
|
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
|
|
98
224
|
|
|
99
|
-
|
|
225
|
+
**What it does:**
|
|
226
|
+
Uploads a single environment variable directly to AWS SSM Parameter Store without using any files.
|
|
100
227
|
|
|
101
|
-
**
|
|
228
|
+
**Required parameters:**
|
|
229
|
+
|
|
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
|
|
234
|
+
|
|
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:**
|
|
102
249
|
|
|
103
250
|
```bash
|
|
104
|
-
|
|
251
|
+
envilder --push --key=API_KEY --value=abc123 --ssm-path=/myapp/api/key
|
|
105
252
|
```
|
|
106
253
|
|
|
107
|
-
|
|
254
|
+
Will push:
|
|
255
|
+
|
|
256
|
+
- Value `abc123` to SSM path `/myapp/api/key`
|
|
257
|
+
|
|
258
|
+
### 🧰 Push Mode options summary
|
|
259
|
+
|
|
260
|
+
**Common Options:**
|
|
108
261
|
|
|
109
|
-
|
|
262
|
+
| Option | Description |
|
|
263
|
+
|------------- | ---------------------------------- |
|
|
264
|
+
| `--push` | Required: Enables push mode |
|
|
265
|
+
| `--profile` | Optional: AWS CLI profile to use |
|
|
266
|
+
|
|
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):**
|
|
110
285
|
|
|
111
286
|
```bash
|
|
112
|
-
|
|
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
|
|
113
292
|
```
|
|
114
293
|
|
|
115
|
-
|
|
116
|
-
|-------------|---------------------------------------------|
|
|
117
|
-
| `--map` | Path to JSON mapping file (required) |
|
|
118
|
-
| `--envfile` | Path to output .env file (required) |
|
|
119
|
-
| `--profile` | AWS CLI profile to use (optional) |
|
|
294
|
+
**Method 2: Push a single variable (no files needed):**
|
|
120
295
|
|
|
121
|
-
|
|
296
|
+
```bash
|
|
297
|
+
# Basic usage - pushes one variable directly to SSM
|
|
298
|
+
envilder --push --key=API_KEY --value=secret123 --ssm-path=/my/path
|
|
122
299
|
|
|
123
|
-
|
|
300
|
+
# With AWS profile
|
|
301
|
+
envilder --push --key=API_KEY --value=secret123 --ssm-path=/my/path --profile=dev
|
|
302
|
+
```
|
|
124
303
|
|
|
125
|
-
|
|
126
|
-
aws ssm put-parameter --name "/path/to/ssm/token" --value "my-secret-token-value" --type "SecureString"
|
|
127
|
-
aws ssm put-parameter --name "/path/to/ssm/password" --value "my-secret-password-value" --type "SecureString"
|
|
128
|
-
```
|
|
304
|
+
---
|
|
129
305
|
|
|
130
|
-
|
|
306
|
+
### ⬇️ Pull Mode (`--map` and `--envfile`)
|
|
131
307
|
|
|
132
|
-
|
|
133
|
-
aws ssm put-parameter --name "/path/to/ssm/token" --value "my-secret-token-value" --type "SecureString" --profile dev-account
|
|
134
|
-
aws ssm put-parameter --name "/path/to/ssm/password" --value "my-secret-password-value" --type "SecureString" --profile dev-account
|
|
135
|
-
```
|
|
308
|
+
Downloads secrets from SSM and writes to `.env`.
|
|
136
309
|
|
|
137
|
-
|
|
310
|
+
#### ⚙️ Pull Mode Options
|
|
138
311
|
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
```
|
|
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 |
|
|
145
317
|
|
|
146
|
-
|
|
318
|
+
#### 🧪 Pull Mode Examples
|
|
147
319
|
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
320
|
+
```bash
|
|
321
|
+
envilder --map=param-map.json --envfile=.env
|
|
322
|
+
```
|
|
323
|
+
|
|
324
|
+
With profile:
|
|
325
|
+
|
|
326
|
+
```bash
|
|
327
|
+
envilder --map=param-map.json --envfile=.env --profile=dev-account
|
|
328
|
+
```
|
|
329
|
+
|
|
330
|
+
#### 📜 Sample Output
|
|
151
331
|
|
|
152
|
-
|
|
332
|
+
After running the pull command above with a `param-map.json` file containing:
|
|
153
333
|
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
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.
|
|
157
352
|
|
|
158
353
|
---
|
|
159
354
|
|
|
160
|
-
## Working with multiple AWS profiles
|
|
355
|
+
## 👥 Working with multiple AWS profiles
|
|
161
356
|
|
|
162
|
-
|
|
357
|
+
Edit your `~/.aws/credentials`:
|
|
163
358
|
|
|
164
359
|
```ini
|
|
165
360
|
[default]
|
|
166
|
-
aws_access_key_id=
|
|
167
|
-
aws_secret_access_key=
|
|
361
|
+
aws_access_key_id=DEFAULT_KEY
|
|
362
|
+
aws_secret_access_key=DEFAULT_SECRET
|
|
168
363
|
|
|
169
364
|
[dev-account]
|
|
170
|
-
aws_access_key_id=
|
|
171
|
-
aws_secret_access_key=
|
|
365
|
+
aws_access_key_id=DEV_KEY
|
|
366
|
+
aws_secret_access_key=DEV_SECRET
|
|
172
367
|
|
|
173
368
|
[prod-account]
|
|
174
|
-
aws_access_key_id=
|
|
175
|
-
aws_secret_access_key=
|
|
369
|
+
aws_access_key_id=PROD_KEY
|
|
370
|
+
aws_secret_access_key=PROD_SECRET
|
|
176
371
|
```
|
|
177
372
|
|
|
178
|
-
|
|
373
|
+
---
|
|
374
|
+
|
|
375
|
+
### ⬇️ Pull Mode Example
|
|
179
376
|
|
|
180
377
|
```bash
|
|
181
|
-
#
|
|
378
|
+
# Default
|
|
379
|
+
envilder --map=param-map.json --envfile=.env.dev
|
|
182
380
|
|
|
183
|
-
|
|
381
|
+
# Development
|
|
382
|
+
envilder --map=param-map.json --envfile=.env.dev --profile=dev-account
|
|
184
383
|
|
|
185
384
|
# Production
|
|
186
|
-
|
|
187
|
-
envilder --map=param-map.json --envfile=.env.production --profile=prod-account
|
|
385
|
+
envilder --map=param-map.json --envfile=.env.prod --profile=prod-account
|
|
188
386
|
```
|
|
189
387
|
|
|
190
388
|
---
|
|
191
389
|
|
|
192
|
-
|
|
390
|
+
### 🚀 Push Mode Example
|
|
193
391
|
|
|
194
|
-
|
|
392
|
+
```bash
|
|
393
|
+
# Default
|
|
394
|
+
envilder --push --key=API_KEY --value=secret123 --ssm-path=/dev/api/key
|
|
195
395
|
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
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
|
|
199
401
|
```
|
|
200
402
|
|
|
201
403
|
---
|
|
202
404
|
|
|
203
|
-
## Roadmap
|
|
405
|
+
## 🏁 Roadmap
|
|
204
406
|
|
|
205
|
-
|
|
407
|
+
🧭 Planned features:
|
|
408
|
+
|
|
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)
|
|
206
415
|
|
|
207
416
|
---
|
|
208
417
|
|
|
209
|
-
## Contributing
|
|
418
|
+
## 🤝 Contributing
|
|
210
419
|
|
|
211
|
-
|
|
420
|
+
All help is welcome — PRs, issues, ideas!
|
|
212
421
|
|
|
213
|
-
|
|
422
|
+
- 🔧 Use our [Pull Request Template](.github/pull_request_template.md)
|
|
423
|
+
- 🧪 Add tests where possible
|
|
424
|
+
- 💬 Feedback and discussion welcome
|
|
214
425
|
|
|
215
426
|
---
|
|
216
427
|
|
|
217
|
-
## License
|
|
428
|
+
## 📜 License
|
|
218
429
|
|
|
219
|
-
MIT © [Marçal Albert](https://github.com/macalbert)
|
|
430
|
+
MIT © [Marçal Albert](https://github.com/macalbert)
|
|
431
|
+
See [LICENSE](./LICENSE)
|
|
220
432
|
|
|
221
|
-
|
|
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
|
-
- [ ]
|
|
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
|
-
- [ ] ↩️ **
|
|
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
|
|
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 @@
|
|
|
1
|
+
{"version":3,"file":"Cli.d.ts","sourceRoot":"","sources":["../../../src/apps/cli/Cli.ts"],"names":[],"mappings":";AAqCA,wBAAsB,IAAI,kBA2CzB"}
|