@shenvy/cli 0.1.8 → 0.1.9
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/Formula/shenvy.rb +9 -9
- package/bin/README.md +345 -0
- package/bin/install.js +15 -6
- package/package.json +1 -1
- package/scoop/shenvy.json +5 -5
package/Formula/shenvy.rb
CHANGED
|
@@ -5,20 +5,20 @@
|
|
|
5
5
|
class Shenvy < Formula
|
|
6
6
|
desc "Securely manage environment variables with E2EE."
|
|
7
7
|
homepage "https://shenvy.dev"
|
|
8
|
-
version "0.1.
|
|
8
|
+
version "0.1.8"
|
|
9
9
|
|
|
10
10
|
on_macos do
|
|
11
11
|
if Hardware::CPU.intel?
|
|
12
|
-
url "https://github.com/Shenvy/shenvy-cli-dist/releases/download/v0.1.
|
|
13
|
-
sha256 "
|
|
12
|
+
url "https://github.com/Shenvy/shenvy-cli-dist/releases/download/v0.1.8/shenvy_darwin_amd64.tar.gz"
|
|
13
|
+
sha256 "a5c65110cd0a4acbb9b9038242f8e798c82b78d9155611a5964c9ec435dbbb8a"
|
|
14
14
|
|
|
15
15
|
define_method(:install) do
|
|
16
16
|
bin.install "shenvy"
|
|
17
17
|
end
|
|
18
18
|
end
|
|
19
19
|
if Hardware::CPU.arm?
|
|
20
|
-
url "https://github.com/Shenvy/shenvy-cli-dist/releases/download/v0.1.
|
|
21
|
-
sha256 "
|
|
20
|
+
url "https://github.com/Shenvy/shenvy-cli-dist/releases/download/v0.1.8/shenvy_darwin_arm64.tar.gz"
|
|
21
|
+
sha256 "0ce6d67606c51707cc2434b4730e42046b9a703a9f378e69593fe0e81ce4c008"
|
|
22
22
|
|
|
23
23
|
define_method(:install) do
|
|
24
24
|
bin.install "shenvy"
|
|
@@ -28,15 +28,15 @@ class Shenvy < Formula
|
|
|
28
28
|
|
|
29
29
|
on_linux do
|
|
30
30
|
if Hardware::CPU.intel? && Hardware::CPU.is_64_bit?
|
|
31
|
-
url "https://github.com/Shenvy/shenvy-cli-dist/releases/download/v0.1.
|
|
32
|
-
sha256 "
|
|
31
|
+
url "https://github.com/Shenvy/shenvy-cli-dist/releases/download/v0.1.8/shenvy_linux_amd64.tar.gz"
|
|
32
|
+
sha256 "adace922b5f8b4218cfb1da4fd0c49ffa060e44f54497370992a934599490624"
|
|
33
33
|
define_method(:install) do
|
|
34
34
|
bin.install "shenvy"
|
|
35
35
|
end
|
|
36
36
|
end
|
|
37
37
|
if Hardware::CPU.arm? && Hardware::CPU.is_64_bit?
|
|
38
|
-
url "https://github.com/Shenvy/shenvy-cli-dist/releases/download/v0.1.
|
|
39
|
-
sha256 "
|
|
38
|
+
url "https://github.com/Shenvy/shenvy-cli-dist/releases/download/v0.1.8/shenvy_linux_arm64.tar.gz"
|
|
39
|
+
sha256 "e9200f38e0d0e4e770a53d58403518efdaacd10a64f8190023e5216276b9b8a8"
|
|
40
40
|
define_method(:install) do
|
|
41
41
|
bin.install "shenvy"
|
|
42
42
|
end
|
package/bin/README.md
ADDED
|
@@ -0,0 +1,345 @@
|
|
|
1
|
+
# Shenvy CLI
|
|
2
|
+
|
|
3
|
+
CLI to manage projects, teams, members, and environment variables securely with end-to-end encryption.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
Shenvy CLI can be installed through several package managers for easy management and updates.
|
|
8
|
+
|
|
9
|
+
### NPM (Node.js)
|
|
10
|
+
The easiest way for web developers to install Shenvy CLI:
|
|
11
|
+
```bash
|
|
12
|
+
npm install -g @shenvy/cli
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
### Homebrew (macOS & Linux)
|
|
16
|
+
Add our official tap and install the formula:
|
|
17
|
+
```bash
|
|
18
|
+
brew install Shenvy/tap/shenvy
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
### Scoop (Windows)
|
|
22
|
+
Add our bucket and install:
|
|
23
|
+
```bash
|
|
24
|
+
scoop bucket add shenvy https://github.com/Shenvy/shenvy-cli-dist.git
|
|
25
|
+
scoop install shenvy
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
### Direct Binary
|
|
29
|
+
Download the latest binary for your platform from the [GitHub Releases](https://github.com/Shenvy/shenvy-cli-dist/releases) page and add it to your PATH.
|
|
30
|
+
|
|
31
|
+
### Build from Source
|
|
32
|
+
If you have Go installed, you can build it manually:
|
|
33
|
+
```bash
|
|
34
|
+
go build -o shenvy.exe
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
## Authentication
|
|
38
|
+
|
|
39
|
+
### `login`
|
|
40
|
+
Log in via browser (Google, GitHub, or email).
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
shenvy login
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
### `logout`
|
|
47
|
+
Log out of the current session.
|
|
48
|
+
|
|
49
|
+
```bash
|
|
50
|
+
shenvy logout
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
### `user_info`
|
|
54
|
+
Display information about the authenticated user.
|
|
55
|
+
|
|
56
|
+
```bash
|
|
57
|
+
shenvy user_info
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
## Project Management
|
|
61
|
+
|
|
62
|
+
### `init`
|
|
63
|
+
Initialize a shenvy repository in the current directory.
|
|
64
|
+
|
|
65
|
+
```bash
|
|
66
|
+
shenvy init
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
### `project list`
|
|
70
|
+
List all projects you have access to.
|
|
71
|
+
|
|
72
|
+
```bash
|
|
73
|
+
shenvy project list
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
### `project info [projectId]`
|
|
77
|
+
Display details of a project. If no ID is provided, it uses the current project.
|
|
78
|
+
|
|
79
|
+
```bash
|
|
80
|
+
shenvy project info
|
|
81
|
+
shenvy project info <projectId>
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
### `project update [projectId]`
|
|
85
|
+
Update the name or description of a project.
|
|
86
|
+
|
|
87
|
+
```bash
|
|
88
|
+
shenvy project update --name "New Name" --desc "New description"
|
|
89
|
+
shenvy project update <projectId> --name "New Name"
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
### `project delete [projectId]`
|
|
93
|
+
Delete a project (soft delete).
|
|
94
|
+
|
|
95
|
+
```bash
|
|
96
|
+
shenvy project delete
|
|
97
|
+
shenvy project delete <projectId>
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
### `project restore <projectId>`
|
|
101
|
+
Restore a deleted project.
|
|
102
|
+
|
|
103
|
+
```bash
|
|
104
|
+
shenvy project restore <projectId>
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
### `status`
|
|
108
|
+
Display the current project status, tracked files, and pending changes.
|
|
109
|
+
|
|
110
|
+
```bash
|
|
111
|
+
shenvy status
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
## Team Management
|
|
115
|
+
|
|
116
|
+
### `team create <name>`
|
|
117
|
+
Create a new team.
|
|
118
|
+
|
|
119
|
+
```bash
|
|
120
|
+
shenvy team create "My Team"
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
### `team info [teamId]`
|
|
124
|
+
Display details of a team. Without an ID, it lists all your teams.
|
|
125
|
+
|
|
126
|
+
```bash
|
|
127
|
+
shenvy team info
|
|
128
|
+
shenvy team info <teamId>
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
### `team delete <teamId>`
|
|
132
|
+
Permanently delete a team.
|
|
133
|
+
|
|
134
|
+
```bash
|
|
135
|
+
shenvy team delete <teamId>
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
### `team transfer <teamId> <newOwnerId>`
|
|
139
|
+
Transfer team ownership to another user.
|
|
140
|
+
|
|
141
|
+
```bash
|
|
142
|
+
shenvy team transfer <teamId> <newOwnerId>
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
## Member Management
|
|
146
|
+
|
|
147
|
+
### `member invite <teamId> <email> [role]`
|
|
148
|
+
Invite a user to the team. Roles: `MEMBER` (default), `ADMIN`, `READER`.
|
|
149
|
+
|
|
150
|
+
```bash
|
|
151
|
+
shenvy member invite <teamId> user@example.com
|
|
152
|
+
shenvy member invite <teamId> user@example.com ADMIN
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
### `member list <teamId>`
|
|
156
|
+
List all members of a team.
|
|
157
|
+
|
|
158
|
+
```bash
|
|
159
|
+
shenvy member list <teamId>
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
### `member update <teamId> <userId> <role>`
|
|
163
|
+
Update a member's role.
|
|
164
|
+
|
|
165
|
+
```bash
|
|
166
|
+
shenvy member update <teamId> <userId> ADMIN
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
### `member remove <teamId> <userId>`
|
|
170
|
+
Remove a member from the team.
|
|
171
|
+
|
|
172
|
+
```bash
|
|
173
|
+
shenvy member remove <teamId> <userId>
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
## Device Management
|
|
177
|
+
|
|
178
|
+
### `registerdevice`
|
|
179
|
+
Register the current device as a recipient for the project.
|
|
180
|
+
|
|
181
|
+
```bash
|
|
182
|
+
shenvy registerdevice
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
### `unregisterdevice`
|
|
186
|
+
Unregister the current device and remove the local identity.
|
|
187
|
+
|
|
188
|
+
```bash
|
|
189
|
+
shenvy unregisterdevice
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
### `device list`
|
|
193
|
+
List all devices registered in the current project.
|
|
194
|
+
|
|
195
|
+
```bash
|
|
196
|
+
shenvy device list
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
### `reset`
|
|
200
|
+
Reset the device identity.
|
|
201
|
+
|
|
202
|
+
```bash
|
|
203
|
+
shenvy reset
|
|
204
|
+
```
|
|
205
|
+
|
|
206
|
+
## Environment Variable Management
|
|
207
|
+
|
|
208
|
+
### `add <filename>`
|
|
209
|
+
Add a file to track.
|
|
210
|
+
|
|
211
|
+
```bash
|
|
212
|
+
shenvy add .env
|
|
213
|
+
shenvy add .env.production
|
|
214
|
+
```
|
|
215
|
+
|
|
216
|
+
### `push`
|
|
217
|
+
Encrypt and upload all tracked files.
|
|
218
|
+
|
|
219
|
+
```bash
|
|
220
|
+
shenvy push
|
|
221
|
+
```
|
|
222
|
+
|
|
223
|
+
### `pull`
|
|
224
|
+
Download, decrypt, and restore all tracked files.
|
|
225
|
+
|
|
226
|
+
```bash
|
|
227
|
+
shenvy pull
|
|
228
|
+
```
|
|
229
|
+
|
|
230
|
+
### `run`
|
|
231
|
+
Execute a command with the environment variables loaded.
|
|
232
|
+
|
|
233
|
+
```bash
|
|
234
|
+
# Load variables from the default environment
|
|
235
|
+
shenvy run -- npm start
|
|
236
|
+
|
|
237
|
+
# Load variables from a specific environment
|
|
238
|
+
shenvy run -e development -- npm start
|
|
239
|
+
```
|
|
240
|
+
|
|
241
|
+
### `plan`
|
|
242
|
+
Display information about the current subscription plan and its limits.
|
|
243
|
+
|
|
244
|
+
```bash
|
|
245
|
+
shenvy plan
|
|
246
|
+
```
|
|
247
|
+
|
|
248
|
+
### `timeline`
|
|
249
|
+
Display the project's change history.
|
|
250
|
+
|
|
251
|
+
```bash
|
|
252
|
+
shenvy timeline
|
|
253
|
+
```
|
|
254
|
+
|
|
255
|
+
### `env delete <envName>`
|
|
256
|
+
Delete a variable file (soft delete).
|
|
257
|
+
|
|
258
|
+
```bash
|
|
259
|
+
shenvy env delete .env.production
|
|
260
|
+
```
|
|
261
|
+
|
|
262
|
+
### `env restore <envId>`
|
|
263
|
+
Restore a deleted variable file.
|
|
264
|
+
|
|
265
|
+
```bash
|
|
266
|
+
shenvy env restore <envId>
|
|
267
|
+
```
|
|
268
|
+
|
|
269
|
+
### `env versions <envName>`
|
|
270
|
+
List all versions of a variable file.
|
|
271
|
+
|
|
272
|
+
```bash
|
|
273
|
+
shenvy env versions .env.production
|
|
274
|
+
```
|
|
275
|
+
|
|
276
|
+
### `env rollback <envName> <version>`
|
|
277
|
+
Roll back a file to a specific version.
|
|
278
|
+
|
|
279
|
+
```bash
|
|
280
|
+
shenvy env rollback .env.production 3
|
|
281
|
+
```
|
|
282
|
+
|
|
283
|
+
## Autocomplete
|
|
284
|
+
|
|
285
|
+
Generate autocomplete scripts for your shell:
|
|
286
|
+
|
|
287
|
+
### PowerShell
|
|
288
|
+
```powershell
|
|
289
|
+
shenvy completion powershell | Out-String | Invoke-Expression
|
|
290
|
+
```
|
|
291
|
+
|
|
292
|
+
To make it permanent, add it to your `$PROFILE`:
|
|
293
|
+
```powershell
|
|
294
|
+
shenvy completion powershell | Out-String | Invoke-Expression
|
|
295
|
+
```
|
|
296
|
+
|
|
297
|
+
### Bash
|
|
298
|
+
```bash
|
|
299
|
+
shenvy completion bash > /etc/bash_completion.d/shenvy
|
|
300
|
+
```
|
|
301
|
+
|
|
302
|
+
### Zsh
|
|
303
|
+
```bash
|
|
304
|
+
shenvy completion zsh > "${fpath[1]}/_shenvy"
|
|
305
|
+
```
|
|
306
|
+
|
|
307
|
+
## Typical Workflow
|
|
308
|
+
|
|
309
|
+
1. **Initialize project**:
|
|
310
|
+
```bash
|
|
311
|
+
shenvy login
|
|
312
|
+
shenvy init
|
|
313
|
+
```
|
|
314
|
+
|
|
315
|
+
2. **Add environment files**:
|
|
316
|
+
```bash
|
|
317
|
+
shenvy add .env
|
|
318
|
+
shenvy add .env.production
|
|
319
|
+
```
|
|
320
|
+
|
|
321
|
+
3. **Register device**:
|
|
322
|
+
```bash
|
|
323
|
+
shenvy registerdevice
|
|
324
|
+
```
|
|
325
|
+
|
|
326
|
+
4. **Encrypt and upload**:
|
|
327
|
+
```bash
|
|
328
|
+
shenvy push
|
|
329
|
+
```
|
|
330
|
+
|
|
331
|
+
5. **Download on another device**:
|
|
332
|
+
```bash
|
|
333
|
+
shenvy login
|
|
334
|
+
cd <project>
|
|
335
|
+
shenvy registerdevice
|
|
336
|
+
# An admin must run 'shenvy push' to include the new device
|
|
337
|
+
shenvy pull
|
|
338
|
+
```
|
|
339
|
+
|
|
340
|
+
## Security Notes
|
|
341
|
+
|
|
342
|
+
- **Zero Knowledge**: The server never knows your secrets.
|
|
343
|
+
- **End-to-End Encryption**: Uses Age (X25519) + ChaCha20-Poly1305.
|
|
344
|
+
- **Devices**: Each device has its own key. An admin must re-encrypt to include new devices.
|
|
345
|
+
- **Soft Deletes**: Projects and variable files are soft-deleted and can be restored.
|
package/bin/install.js
CHANGED
|
@@ -41,10 +41,17 @@ function download(url, dest) {
|
|
|
41
41
|
const file = fs.createWriteStream(dest);
|
|
42
42
|
https.get(url, (response) => {
|
|
43
43
|
if (response.statusCode === 302 || response.statusCode === 301) {
|
|
44
|
-
|
|
44
|
+
// Close the write stream BEFORE recursing — on Windows, open handles
|
|
45
|
+
// block PowerShell's Expand-Archive even after file.close() is called.
|
|
46
|
+
file.close(() => {
|
|
47
|
+
download(response.headers.location, dest).then(resolve).catch(reject);
|
|
48
|
+
});
|
|
49
|
+
return;
|
|
45
50
|
}
|
|
46
51
|
if (response.statusCode !== 200) {
|
|
47
|
-
|
|
52
|
+
file.close(() => {
|
|
53
|
+
reject(new Error(`Failed to download: ${response.statusCode}`));
|
|
54
|
+
});
|
|
48
55
|
return;
|
|
49
56
|
}
|
|
50
57
|
response.pipe(file);
|
|
@@ -52,8 +59,10 @@ function download(url, dest) {
|
|
|
52
59
|
file.close(() => resolve());
|
|
53
60
|
});
|
|
54
61
|
}).on('error', (err) => {
|
|
55
|
-
|
|
56
|
-
|
|
62
|
+
file.close(() => {
|
|
63
|
+
fs.unlink(dest, () => {});
|
|
64
|
+
reject(err);
|
|
65
|
+
});
|
|
57
66
|
});
|
|
58
67
|
});
|
|
59
68
|
}
|
|
@@ -63,8 +72,8 @@ const wait = (ms) => new Promise(r => setTimeout(r, ms));
|
|
|
63
72
|
async function ensureFileReady(filePath) {
|
|
64
73
|
for (let i = 0; i < 10; i++) {
|
|
65
74
|
try {
|
|
66
|
-
//
|
|
67
|
-
const fd = fs.openSync(filePath, 'r
|
|
75
|
+
// Open read-only to check if the OS has fully released the file handle
|
|
76
|
+
const fd = fs.openSync(filePath, 'r');
|
|
68
77
|
fs.closeSync(fd);
|
|
69
78
|
return true;
|
|
70
79
|
} catch (e) {
|
package/package.json
CHANGED
package/scoop/shenvy.json
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "0.1.
|
|
2
|
+
"version": "0.1.8",
|
|
3
3
|
"architecture": {
|
|
4
4
|
"64bit": {
|
|
5
|
-
"url": "https://github.com/Shenvy/shenvy-cli-dist/releases/download/v0.1.
|
|
5
|
+
"url": "https://github.com/Shenvy/shenvy-cli-dist/releases/download/v0.1.8/shenvy_windows_amd64.zip",
|
|
6
6
|
"bin": [
|
|
7
7
|
"shenvy.exe"
|
|
8
8
|
],
|
|
9
|
-
"hash": "
|
|
9
|
+
"hash": "7b2ff88ba99e087343a9fc171057a4b11cbbb7bddfa9fdaf62558c1948957db3"
|
|
10
10
|
},
|
|
11
11
|
"arm64": {
|
|
12
|
-
"url": "https://github.com/Shenvy/shenvy-cli-dist/releases/download/v0.1.
|
|
12
|
+
"url": "https://github.com/Shenvy/shenvy-cli-dist/releases/download/v0.1.8/shenvy_windows_arm64.zip",
|
|
13
13
|
"bin": [
|
|
14
14
|
"shenvy.exe"
|
|
15
15
|
],
|
|
16
|
-
"hash": "
|
|
16
|
+
"hash": "9f829c5c8d8b7f1e42d1c7a71d21f465ab14da954ad4fa19e44ac0ebfd873944"
|
|
17
17
|
}
|
|
18
18
|
},
|
|
19
19
|
"homepage": "https://shenvy.dev",
|