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.
- package/README.md +316 -121
- 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.map +1 -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 +2 -2
- package/lib/envilder/infrastructure/EnvManager/EnvFileManager.d.ts.map +1 -0
- package/lib/{cli/infrastructure → envilder/infrastructure/EnvManager}/EnvFileManager.js +24 -8
- package/lib/envilder/infrastructure/EnvManager/EnvFileManager.js.map +1 -0
- package/lib/{cli/infrastructure → envilder/infrastructure/Logger}/ConsoleLogger.d.ts +1 -1
- package/lib/envilder/infrastructure/Logger/ConsoleLogger.d.ts.map +1 -0
- package/lib/envilder/infrastructure/Logger/ConsoleLogger.js.map +1 -0
- package/lib/envilder/infrastructure/VersionFinder/PackageJsonFinder.d.ts.map +1 -0
- package/lib/envilder/infrastructure/VersionFinder/PackageJsonFinder.js.map +1 -0
- package/package.json +7 -5
- package/lib/Cli.d.ts +0 -10
- package/lib/Cli.d.ts.map +0 -1
- package/lib/Cli.js +0 -58
- package/lib/Cli.js.map +0 -1
- package/lib/cli/application/EnvilderHandler.d.ts +0 -21
- package/lib/cli/application/EnvilderHandler.d.ts.map +0 -1
- package/lib/cli/application/EnvilderHandler.js +0 -74
- package/lib/cli/application/EnvilderHandler.js.map +0 -1
- package/lib/cli/application/builders/EnvilderBuilder.d.ts +0 -18
- package/lib/cli/application/builders/EnvilderBuilder.d.ts.map +0 -1
- package/lib/cli/application/builders/EnvilderBuilder.js +0 -53
- 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/ILogger.d.ts.map +0 -1
- package/lib/cli/domain/ports/ILogger.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/ConsoleLogger.d.ts.map +0 -1
- package/lib/cli/infrastructure/ConsoleLogger.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/ILogger.d.ts +0 -0
- /package/lib/{cli → envilder}/domain/ports/ILogger.js +0 -0
- /package/lib/{cli → envilder}/domain/ports/ISecretProvider.js +0 -0
- /package/lib/{cli/infrastructure → envilder/infrastructure/Logger}/ConsoleLogger.js +0 -0
- /package/lib/{cli/infrastructure → envilder/infrastructure/VersionFinder}/PackageJsonFinder.d.ts +0 -0
- /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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
30
|
-
|
|
31
|
-
|
|
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
|
|
37
|
-
|
|
38
|
-
- [Envilder](
|
|
39
|
-
- [
|
|
40
|
-
- [Table of
|
|
41
|
-
- [Features](
|
|
42
|
-
- [Feature
|
|
43
|
-
- [
|
|
44
|
-
- [
|
|
45
|
-
- [
|
|
46
|
-
- [
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
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
|
-
-
|
|
59
|
-
-
|
|
60
|
-
-
|
|
61
|
-
-
|
|
62
|
-
-
|
|
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
|
|
77
|
+
### 🧱 Feature Status
|
|
65
78
|
|
|
66
|
-
| Feature
|
|
67
|
-
|
|
68
|
-
| Mapping-based
|
|
69
|
-
|
|
|
70
|
-
| AWS profile support
|
|
71
|
-
|
|
|
72
|
-
|
|
|
73
|
-
|
|
|
74
|
-
| Webhook/Slack notification
|
|
75
|
-
| Hierarchical mapping
|
|
76
|
-
| 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) |
|
|
77
90
|
|
|
78
91
|
---
|
|
79
92
|
|
|
80
|
-
##
|
|
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
|
-
#
|
|
86
|
-
|
|
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
|
-
|
|
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
|
+

|
|
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
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
**
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
300
|
+
# With AWS profile
|
|
301
|
+
envilder --push --key=API_KEY --value=secret123 --ssm-path=/my/path --profile=dev
|
|
302
|
+
```
|
|
139
303
|
|
|
140
|
-
|
|
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
|
-
|
|
306
|
+
### ⬇️ Pull Mode (`--map` and `--envfile`)
|
|
146
307
|
|
|
147
|
-
|
|
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
|
-
|
|
310
|
+
#### ⚙️ Pull Mode Options
|
|
153
311
|
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
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
|
-
|
|
318
|
+
#### 🧪 Pull Mode Examples
|
|
162
319
|
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
320
|
+
```bash
|
|
321
|
+
envilder --map=param-map.json --envfile=.env
|
|
322
|
+
```
|
|
166
323
|
|
|
167
|
-
|
|
324
|
+
With profile:
|
|
168
325
|
|
|
169
|
-
|
|
170
|
-
|
|
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
|
-
|
|
357
|
+
Edit your `~/.aws/credentials`:
|
|
178
358
|
|
|
179
359
|
```ini
|
|
180
360
|
[default]
|
|
181
|
-
aws_access_key_id=
|
|
182
|
-
aws_secret_access_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=
|
|
186
|
-
aws_secret_access_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=
|
|
190
|
-
aws_secret_access_key=
|
|
369
|
+
aws_access_key_id=PROD_KEY
|
|
370
|
+
aws_secret_access_key=PROD_SECRET
|
|
191
371
|
```
|
|
192
372
|
|
|
193
|
-
|
|
373
|
+
---
|
|
374
|
+
|
|
375
|
+
### ⬇️ Pull Mode Example
|
|
194
376
|
|
|
195
377
|
```bash
|
|
196
|
-
#
|
|
378
|
+
# Default
|
|
379
|
+
envilder --map=param-map.json --envfile=.env.dev
|
|
197
380
|
|
|
198
|
-
|
|
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
|
-
|
|
390
|
+
### 🚀 Push Mode Example
|
|
208
391
|
|
|
209
|
-
|
|
392
|
+
```bash
|
|
393
|
+
# Default
|
|
394
|
+
envilder --push --key=API_KEY --value=secret123 --ssm-path=/dev/api/key
|
|
210
395
|
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
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
|
-
|
|
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
|
-
|
|
420
|
+
All help is welcome — PRs, issues, ideas!
|
|
227
421
|
|
|
228
|
-
|
|
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
|
-
|
|
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
|
-
- [ ]
|
|
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"}
|