envilder 0.5.6 → 0.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +325 -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,422 @@
|
|
|
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)
|
|
84
110
|
|
|
85
|
-
|
|
86
|
-
# https://github.com/user-attachments/assets/3c4985e6-49e9-4f29-bf1c-130747df0ca6
|
|
111
|
+
---
|
|
87
112
|
|
|
88
|
-
|
|
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
|
|
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
|
+
```
|
|
89
128
|
|
|
129
|
+
Ongoing Usage
|
|
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<br/>(param-map.json)"] --> B[Envilder]:::core
|
|
153
|
+
C["Environment File<br/> '.env' or --key"] --> B
|
|
154
|
+
D["AWS Credentials"]:::aws --> B
|
|
155
|
+
E["AWS SSM"]:::aws --> B
|
|
156
|
+
B --> F["Pull/Push Secrets 💾"]
|
|
157
|
+
|
|
158
|
+
classDef aws fill:#ffcc66,color:#000000,stroke:#333,stroke-width:1.5px;
|
|
159
|
+
classDef core fill:#1f3b57,color:#fff,stroke:#ccc,stroke-width:2px;
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
1. Define mappings in JSON: `{"ENV_VAR": "ssm/path"}`
|
|
163
|
+
2. Run Envilder: `--push` to upload, or `--map` + `--envfile` to generate
|
|
164
|
+
3. It talks to SSM using your AWS credentials
|
|
165
|
+
4. Result: your secrets synced ✅
|
|
98
166
|
|
|
167
|
+
---
|
|
168
|
+
|
|
169
|
+
## 🎮 Usage
|
|
170
|
+
|
|
171
|
+
### 🚀 Push Mode (`--push`)
|
|
172
|
+
|
|
173
|
+
Push Mode uploads environment variables to AWS SSM Parameter Store. It has two distinct operation methods:
|
|
174
|
+
|
|
175
|
+
#### 🍄 Method 1: Push from .env file
|
|
176
|
+
|
|
177
|
+
**Requirements:**
|
|
178
|
+
|
|
179
|
+
- `--push` flag to enable Push Mode
|
|
180
|
+
- `--envfile` pointing to your local .env file
|
|
181
|
+
- `--map` pointing to your parameter mapping JSON file
|
|
182
|
+
|
|
183
|
+
**How File-Based Push Works:**
|
|
184
|
+
|
|
185
|
+
1. Envilder reads your local `.env` file to get variable names and values
|
|
186
|
+
2. Envilder reads your `map` file to find the corresponding SSM paths
|
|
187
|
+
3. For each variable found in both files, Envilder pushes the value to AWS SSM
|
|
188
|
+
4. No modifications are made to your local files
|
|
189
|
+
|
|
190
|
+
```mermaid
|
|
99
191
|
graph LR
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
192
|
+
A[.env File] --> |Variables & Values| B[Envilder]:::core
|
|
193
|
+
C[Mapping File] --> |SSM Paths| B
|
|
194
|
+
D[AWS Profile]:::aws --> B
|
|
195
|
+
B --> E[AWS SSM Parameter Store]:::aws
|
|
104
196
|
|
|
197
|
+
classDef aws fill:#ffcc66,color:#000000,stroke:#333,stroke-width:1.5px;
|
|
198
|
+
classDef core fill:#1f3b57,color:#fff,stroke:#ccc,stroke-width:2px;
|
|
105
199
|
```
|
|
106
200
|
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
3. **Auto-fetch from AWS** — Retrieves values using your AWS credentials
|
|
110
|
-
4. **Get your .env file** — Ready to use in your project
|
|
201
|
+
**Example:**
|
|
202
|
+
If your `.env` file contains:
|
|
111
203
|
|
|
112
|
-
|
|
204
|
+
```text
|
|
205
|
+
API_KEY=abc123
|
|
206
|
+
DB_PASSWORD=secret456
|
|
207
|
+
```
|
|
113
208
|
|
|
114
|
-
|
|
209
|
+
And your `param-map.json` file contains:
|
|
115
210
|
|
|
116
|
-
|
|
211
|
+
```json
|
|
212
|
+
{
|
|
213
|
+
"API_KEY": "/myapp/api/key",
|
|
214
|
+
"DB_PASSWORD": "/myapp/db/password"
|
|
215
|
+
}
|
|
216
|
+
```
|
|
217
|
+
|
|
218
|
+
Running this command:
|
|
117
219
|
|
|
118
220
|
```bash
|
|
119
|
-
|
|
221
|
+
envilder --push --envfile=.env --map=param-map.json
|
|
120
222
|
```
|
|
121
223
|
|
|
122
|
-
|
|
224
|
+
Will push:
|
|
225
|
+
|
|
226
|
+
- Value `abc123` to SSM path `/myapp/api/key`
|
|
227
|
+
- Value `secret456` to SSM path `/myapp/db/password`
|
|
228
|
+
|
|
229
|
+
### ⭐ Method 2: Push a single variable
|
|
123
230
|
|
|
124
|
-
|
|
231
|
+
**What it does:**
|
|
232
|
+
Uploads a single environment variable directly to AWS SSM Parameter Store without using any files.
|
|
233
|
+
|
|
234
|
+
**Required parameters:**
|
|
235
|
+
|
|
236
|
+
- `--push`: Activates Push Mode
|
|
237
|
+
- `--key=VAR_NAME`: The name of the environment variable
|
|
238
|
+
- `--value=secret123`: The value to store in AWS SSM
|
|
239
|
+
- `--ssm-path=/your/path`: The full AWS SSM parameter path
|
|
240
|
+
|
|
241
|
+
**Important notes:**
|
|
242
|
+
|
|
243
|
+
- NO files are read or modified
|
|
244
|
+
- This is a direct command-to-SSM operation
|
|
245
|
+
- Useful for quick updates or CI/CD pipelines
|
|
246
|
+
|
|
247
|
+
```mermaid
|
|
248
|
+
graph LR
|
|
249
|
+
A[Command Line Arguments] --> B[Envilder]:::core
|
|
250
|
+
C[AWS Profile]:::aws --> B
|
|
251
|
+
B --> D[AWS SSM Parameter Store]:::aws
|
|
252
|
+
|
|
253
|
+
classDef aws fill:#ffcc66,color:#000000,stroke:#333,stroke-width:1.5px;
|
|
254
|
+
classDef core fill:#1f3b57,color:#fff,stroke:#ccc,stroke-width:2px;
|
|
255
|
+
```
|
|
256
|
+
|
|
257
|
+
**Example:**
|
|
258
|
+
|
|
259
|
+
```bash
|
|
260
|
+
envilder --push --key=API_KEY --value=abc123 --ssm-path=/myapp/api/key
|
|
261
|
+
```
|
|
262
|
+
|
|
263
|
+
Will push:
|
|
264
|
+
|
|
265
|
+
- Value `abc123` to SSM path `/myapp/api/key`
|
|
266
|
+
|
|
267
|
+
### 🧰 Push Mode options summary
|
|
268
|
+
|
|
269
|
+
**Common Options:**
|
|
270
|
+
|
|
271
|
+
| Option | Description |
|
|
272
|
+
|------------- | ---------------------------------- |
|
|
273
|
+
| `--push` | Required: Enables push mode |
|
|
274
|
+
| `--profile` | Optional: AWS CLI profile to use |
|
|
275
|
+
|
|
276
|
+
**Method 1: File-Based Push Options:**
|
|
277
|
+
|
|
278
|
+
| Option | Description |
|
|
279
|
+
|------------- | -------------------------------------------------- |
|
|
280
|
+
| `--envfile` | Required: Path to your local .env file |
|
|
281
|
+
| `--map` | Required: Path to your parameter mapping JSON file |
|
|
282
|
+
|
|
283
|
+
**Method 2: Single-Variable Push Options:**
|
|
284
|
+
|
|
285
|
+
| Option | Description |
|
|
286
|
+
|------------- | ------------------------------------------- |
|
|
287
|
+
| `--key` | Required: Environment variable name |
|
|
288
|
+
| `--value` | Required: Value to store in AWS SSM |
|
|
289
|
+
| `--ssm-path` | Required: Full SSM parameter path |
|
|
290
|
+
|
|
291
|
+
### 🧪 Push Mode Examples
|
|
292
|
+
|
|
293
|
+
**Method 1: Push from .env file (multiple variables at once):**
|
|
125
294
|
|
|
126
295
|
```bash
|
|
127
|
-
|
|
296
|
+
# Basic usage - pushes all variables found in both .env and map files
|
|
297
|
+
envilder --push --envfile=.env --map=param-map.json
|
|
298
|
+
|
|
299
|
+
# With AWS profile - for different environments
|
|
300
|
+
envilder --push --envfile=.env.prod --map=param-map.json --profile=prod-account
|
|
301
|
+
```
|
|
302
|
+
|
|
303
|
+
**Method 2: Push a single variable (no files needed):**
|
|
304
|
+
|
|
305
|
+
```bash
|
|
306
|
+
# Basic usage - pushes one variable directly to SSM
|
|
307
|
+
envilder --push --key=API_KEY --value=secret123 --ssm-path=/my/path
|
|
308
|
+
|
|
309
|
+
# With AWS profile
|
|
310
|
+
envilder --push --key=API_KEY --value=secret123 --ssm-path=/my/path --profile=dev
|
|
128
311
|
```
|
|
129
312
|
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
313
|
+
---
|
|
314
|
+
|
|
315
|
+
### ⬇️ Pull Mode (`--map` and `--envfile`)
|
|
316
|
+
|
|
317
|
+
Downloads secrets from SSM and writes to `.env`.
|
|
135
318
|
|
|
136
|
-
|
|
319
|
+
#### ⚙️ Pull Mode Options
|
|
137
320
|
|
|
138
|
-
|
|
321
|
+
| Option | Description |
|
|
322
|
+
| ----------- | ----------------------------------- |
|
|
323
|
+
| `--map` | JSON mapping of env var to SSM path |
|
|
324
|
+
| `--envfile` | Path to write `.env` |
|
|
325
|
+
| `--profile` | AWS profile to use |
|
|
139
326
|
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
327
|
+
#### 🧪 Pull Mode Examples
|
|
328
|
+
|
|
329
|
+
```bash
|
|
330
|
+
envilder --map=param-map.json --envfile=.env
|
|
331
|
+
```
|
|
144
332
|
|
|
145
|
-
|
|
333
|
+
With profile:
|
|
146
334
|
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
```
|
|
335
|
+
```bash
|
|
336
|
+
envilder --map=param-map.json --envfile=.env --profile=dev-account
|
|
337
|
+
```
|
|
151
338
|
|
|
152
|
-
|
|
339
|
+
#### 📜 Sample Output
|
|
153
340
|
|
|
154
|
-
|
|
155
|
-
{
|
|
156
|
-
"SECRET_TOKEN": "/path/to/ssm/token",
|
|
157
|
-
"SECRET_KEY": "/path/to/ssm/password"
|
|
158
|
-
}
|
|
159
|
-
```
|
|
341
|
+
After running the pull command above with a `param-map.json` file containing:
|
|
160
342
|
|
|
161
|
-
|
|
343
|
+
```json
|
|
344
|
+
{
|
|
345
|
+
"API_KEY": "/myapp/api/key",
|
|
346
|
+
"DB_PASSWORD": "/myapp/db/password",
|
|
347
|
+
"SECRET_TOKEN": "/myapp/auth/token"
|
|
348
|
+
}
|
|
349
|
+
```
|
|
162
350
|
|
|
163
|
-
|
|
164
|
-
envilder --map=param-map.json --envfile=.env
|
|
165
|
-
```
|
|
351
|
+
Your generated `.env` file would look like:
|
|
166
352
|
|
|
167
|
-
|
|
353
|
+
```dotenv
|
|
354
|
+
# Generated by Envilder on 2025-07-13
|
|
355
|
+
API_KEY=abc123
|
|
356
|
+
DB_PASSWORD=secret456
|
|
357
|
+
SECRET_TOKEN=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9
|
|
358
|
+
```
|
|
168
359
|
|
|
169
|
-
|
|
170
|
-
https://github.com/user-attachments/assets/3c4985e6-49e9-4f29-bf1c-130747df0ca6
|
|
171
|
-
```
|
|
360
|
+
This keeps your sensitive values secure in AWS SSM while providing local access for development.
|
|
172
361
|
|
|
173
362
|
---
|
|
174
363
|
|
|
175
|
-
## Working with multiple AWS profiles
|
|
364
|
+
## 👥 Working with multiple AWS profiles
|
|
176
365
|
|
|
177
|
-
|
|
366
|
+
Edit your `~/.aws/credentials`:
|
|
178
367
|
|
|
179
368
|
```ini
|
|
180
369
|
[default]
|
|
181
|
-
aws_access_key_id=
|
|
182
|
-
aws_secret_access_key=
|
|
370
|
+
aws_access_key_id=DEFAULT_KEY
|
|
371
|
+
aws_secret_access_key=DEFAULT_SECRET
|
|
183
372
|
|
|
184
373
|
[dev-account]
|
|
185
|
-
aws_access_key_id=
|
|
186
|
-
aws_secret_access_key=
|
|
374
|
+
aws_access_key_id=DEV_KEY
|
|
375
|
+
aws_secret_access_key=DEV_SECRET
|
|
187
376
|
|
|
188
377
|
[prod-account]
|
|
189
|
-
aws_access_key_id=
|
|
190
|
-
aws_secret_access_key=
|
|
378
|
+
aws_access_key_id=PROD_KEY
|
|
379
|
+
aws_secret_access_key=PROD_SECRET
|
|
191
380
|
```
|
|
192
381
|
|
|
193
|
-
|
|
382
|
+
---
|
|
383
|
+
|
|
384
|
+
### ⬇️ Pull Mode Example
|
|
194
385
|
|
|
195
386
|
```bash
|
|
196
|
-
#
|
|
387
|
+
# Default
|
|
388
|
+
envilder --map=param-map.json --envfile=.env.dev
|
|
197
389
|
|
|
198
|
-
|
|
390
|
+
# Development
|
|
391
|
+
envilder --map=param-map.json --envfile=.env.dev --profile=dev-account
|
|
199
392
|
|
|
200
393
|
# Production
|
|
201
|
-
|
|
202
|
-
envilder --map=param-map.json --envfile=.env.production --profile=prod-account
|
|
394
|
+
envilder --map=param-map.json --envfile=.env.prod --profile=prod-account
|
|
203
395
|
```
|
|
204
396
|
|
|
205
397
|
---
|
|
206
398
|
|
|
207
|
-
|
|
399
|
+
### 🚀 Push Mode Example
|
|
208
400
|
|
|
209
|
-
|
|
401
|
+
```bash
|
|
402
|
+
# Default
|
|
403
|
+
envilder --push --key=API_KEY --value=secret123 --ssm-path=/dev/api/key
|
|
210
404
|
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
405
|
+
# Development
|
|
406
|
+
envilder --push --key=API_KEY --value=secret123 --ssm-path=/dev/api/key --profile=dev-account
|
|
407
|
+
|
|
408
|
+
# Production
|
|
409
|
+
envilder --push --key=API_KEY --value=secret123 --ssm-path=/prod/api/key --profile=prod-account
|
|
214
410
|
```
|
|
215
411
|
|
|
216
412
|
---
|
|
217
413
|
|
|
218
|
-
## Roadmap
|
|
414
|
+
## 🏁 Roadmap
|
|
219
415
|
|
|
220
|
-
|
|
416
|
+
🧭 Planned features:
|
|
417
|
+
|
|
418
|
+
- 🔍 Drift detection (`--check`)
|
|
419
|
+
- 🧠 Auto-discovery (`--auto`)
|
|
420
|
+
- 📨 Slack/Webhook notifications
|
|
421
|
+
- 🔌 Plugin system (Vault, Secrets Manager, etc.)
|
|
422
|
+
|
|
423
|
+
👉 See full [ROADMAP.md](./ROADMAP.md)
|
|
221
424
|
|
|
222
425
|
---
|
|
223
426
|
|
|
224
|
-
## Contributing
|
|
427
|
+
## 🤝 Contributing
|
|
225
428
|
|
|
226
|
-
|
|
429
|
+
All help is welcome — PRs, issues, ideas!
|
|
227
430
|
|
|
228
|
-
|
|
431
|
+
- 🔧 Use our [Pull Request Template](.github/pull_request_template.md)
|
|
432
|
+
- 🧪 Add tests where possible
|
|
433
|
+
- 💬 Feedback and discussion welcome
|
|
229
434
|
|
|
230
435
|
---
|
|
231
436
|
|
|
232
|
-
## License
|
|
233
|
-
|
|
234
|
-
MIT © [Marçal Albert](https://github.com/macalbert).
|
|
437
|
+
## 📜 License
|
|
235
438
|
|
|
236
|
-
|
|
439
|
+
MIT © [Marçal Albert](https://github.com/macalbert)
|
|
440
|
+
See [LICENSE](./LICENSE)
|
|
237
441
|
|
|
238
442
|
---
|
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"}
|