e2sm 0.5.0 → 0.6.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -5,41 +5,127 @@
5
5
  ## Usage
6
6
 
7
7
  ```bash
8
- npx e2sm
9
- npx e2sm --dry-run
10
- npx e2sm --help
8
+ npx e2sm init # Create .e2smrc.jsonc config file
9
+ npx e2sm set # Upload .env to Secrets Manager
10
+ npx e2sm get # Display secret value
11
+ npx e2sm pull # Download secret to .env file
12
+ npx e2sm delete # Delete secret from Secrets Manager
13
+ npx e2sm --help # Show help
11
14
  ```
12
15
 
13
- ### Get Secrets
16
+ ## Commands
14
17
 
15
- Retrieve secrets from AWS Secrets Manager.
18
+ ### init - Create configuration file
19
+
20
+ Creates a `.e2smrc.jsonc` configuration file in the current directory with commented examples.
21
+
22
+ ```bash
23
+ npx e2sm init
24
+ npx e2sm init --force # Overwrite existing file
25
+ ```
26
+
27
+ | Flag | Short | Description |
28
+ | --------- | ----- | ----------------------- |
29
+ | `--force` | `-f` | Overwrite existing file |
30
+
31
+ ### set - Upload .env to Secrets Manager
32
+
33
+ ```bash
34
+ npx e2sm set
35
+ npx e2sm set -i .env.local -n my-app/prod
36
+ npx e2sm set --dry-run # Preview JSON without uploading
37
+ npx e2sm set --force # Skip overwrite confirmation
38
+ npx e2sm set -t -a my-app -s prod # Template mode: creates "my-app/prod"
39
+ ```
40
+
41
+ | Flag | Short | Description |
42
+ | --------------- | ----- | --------------------------------------- |
43
+ | `--input` | `-i` | Path to .env file |
44
+ | `--name` | `-n` | Secret name |
45
+ | `--dry-run` | `-d` | Preview JSON output |
46
+ | `--force` | `-f` | Skip overwrite confirmation |
47
+ | `--template` | `-t` | Use template mode ($application/$stage) |
48
+ | `--application` | `-a` | Application name (implies --template) |
49
+ | `--stage` | `-s` | Stage name (implies --template) |
50
+ | `--profile` | `-p` | AWS profile |
51
+ | `--region` | `-r` | AWS region |
52
+
53
+ ### get - Display secret value
16
54
 
17
55
  ```bash
18
56
  npx e2sm get
19
- npx e2sm get -n my-secret-name
57
+ npx e2sm get -n my-app/prod
20
58
  npx e2sm get -p my-profile -r ap-northeast-1
21
59
  ```
22
60
 
61
+ | Flag | Short | Description |
62
+ | ----------- | ----- | ---------------------------------------- |
63
+ | `--name` | `-n` | Secret name (skip interactive selection) |
64
+ | `--profile` | `-p` | AWS profile |
65
+ | `--region` | `-r` | AWS region |
66
+
67
+ ### pull - Download secret to .env file
68
+
69
+ ```bash
70
+ npx e2sm pull
71
+ npx e2sm pull -n my-app/prod -o .env.local
72
+ npx e2sm pull --force # Overwrite existing file
73
+ ```
74
+
75
+ | Flag | Short | Description |
76
+ | ----------- | ----- | -------------------------------------------- |
77
+ | `--name` | `-n` | Secret name (skip interactive selection) |
78
+ | `--output` | `-o` | Output file path (default: .env) |
79
+ | `--force` | `-f` | Overwrite existing file without confirmation |
80
+ | `--profile` | `-p` | AWS profile |
81
+ | `--region` | `-r` | AWS region |
82
+
83
+ ### delete - Delete secret from Secrets Manager
84
+
85
+ ```bash
86
+ npx e2sm delete
87
+ npx e2sm delete -n my-app/prod -d 7
88
+ npx e2sm delete -n my-app/prod -d 7 --force
89
+ ```
90
+
91
+ | Flag | Short | Description |
92
+ | ----------------- | ----- | ---------------------------------------- |
93
+ | `--name` | `-n` | Secret name (skip interactive selection) |
94
+ | `--recovery-days` | `-d` | Recovery window in days (7-30) |
95
+ | `--force` | `-f` | Skip confirmation prompt |
96
+ | `--profile` | `-p` | AWS profile |
97
+ | `--region` | `-r` | AWS region |
98
+
23
99
  ## Configuration
24
100
 
25
- You can create a `.e2smrc.json` file to set default options.
101
+ Create a `.e2smrc.jsonc` file to set default options. JSONC format supports comments.
26
102
 
27
- ```json
103
+ ```jsonc
28
104
  {
29
- "$schema": "https://unpkg.com/e2sm/schema.json",
30
- "template": true,
31
- "application": "my-app",
32
- "stage": "dev",
105
+ "$schema": "https://unpkg.com/e2sm/assets/schema.json",
106
+ // Secret name (cannot use with template mode)
107
+ "name": "my-secret-name",
108
+ // Or use template mode: generate secret name as $application/$stage
109
+ // "template": true,
110
+ // "application": "my-app",
111
+ // "stage": "dev",
112
+ // AWS settings
33
113
  "profile": "my-profile",
34
114
  "region": "ap-northeast-1",
35
- "input": ".env.local"
115
+ // File paths
116
+ "input": ".env.local",
117
+ "output": ".env",
36
118
  }
37
119
  ```
38
120
 
39
121
  ### Config file locations
40
122
 
41
- 1. `./.e2smrc.json` (project) - takes precedence
42
- 2. `~/.e2smrc.json` (global)
123
+ Searched in order (first found is used):
124
+
125
+ 1. `./.e2smrc.jsonc` (project)
126
+ 2. `./.e2smrc.json` (project, backward compatibility)
127
+ 3. `~/.e2smrc.jsonc` (global)
128
+ 4. `~/.e2smrc.json` (global, backward compatibility)
43
129
 
44
130
  Only the first found config is used (no merging).
45
131
 
@@ -49,8 +135,8 @@ CLI flags always take precedence over config file values.
49
135
 
50
136
  ```bash
51
137
  # Uses profile from config
52
- npx e2sm
138
+ npx e2sm set
53
139
 
54
140
  # Overrides config with "prod-profile"
55
- npx e2sm -p prod-profile
141
+ npx e2sm set -p prod-profile
56
142
  ```
@@ -29,6 +29,14 @@
29
29
  "input": {
30
30
  "type": "string",
31
31
  "description": "Path to the .env file"
32
+ },
33
+ "output": {
34
+ "type": "string",
35
+ "description": "Path to the output .env file for pull command"
36
+ },
37
+ "name": {
38
+ "type": "string",
39
+ "description": "Secret name for AWS Secrets Manager"
32
40
  }
33
41
  },
34
42
  "additionalProperties": false
@@ -0,0 +1,15 @@
1
+ {
2
+ "$schema": "https://unpkg.com/e2sm/assets/schema.json",
3
+ // Secret name (cannot use with template mode)
4
+ // "name": "my-secret-name",
5
+ // Or use template mode: generate secret name as $application/$stage
6
+ // "template": true,
7
+ // "application": "my-app",
8
+ // "stage": "dev",
9
+ // AWS settings
10
+ // "profile": "my-profile",
11
+ // "region": "ap-northeast-1",
12
+ // File paths
13
+ // "input": ".env.local",
14
+ // "output": ".env"
15
+ }