@envpilot/cli 0.1.0 → 1.1.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 +83 -0
- package/dist/index.js +19 -6
- package/package.json +14 -5
package/README.md
ADDED
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
# @envpilot/cli
|
|
2
|
+
|
|
3
|
+
The official CLI for [Envpilot](https://www.envpilot.dev) — a secure environment variable management platform for teams.
|
|
4
|
+
|
|
5
|
+
Envpilot lets you sync, share, and manage `.env` files across your team without leaking secrets in Slack, email, or Git. Variables are encrypted at rest using [WorkOS Vault](https://workos.com/vault) and access is controlled through role-based permissions.
|
|
6
|
+
|
|
7
|
+
## Install
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm install -g @envpilot/cli
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
Or with bun:
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
bun install -g @envpilot/cli
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
Or run without installing:
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
npx @envpilot/cli login
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## Quick Start
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
# Authenticate with your Envpilot account
|
|
29
|
+
envpilot login
|
|
30
|
+
|
|
31
|
+
# Initialize a project in the current directory
|
|
32
|
+
envpilot init
|
|
33
|
+
|
|
34
|
+
# Pull environment variables into a .env file
|
|
35
|
+
envpilot pull
|
|
36
|
+
|
|
37
|
+
# Push local .env changes to Envpilot
|
|
38
|
+
envpilot push
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
## Commands
|
|
42
|
+
|
|
43
|
+
| Command | Description |
|
|
44
|
+
| ------------------------- | --------------------------------------------------- |
|
|
45
|
+
| `envpilot login` | Authenticate with your Envpilot account |
|
|
46
|
+
| `envpilot logout` | Log out and clear stored credentials |
|
|
47
|
+
| `envpilot init` | Link the current directory to an Envpilot project |
|
|
48
|
+
| `envpilot pull` | Pull environment variables into a local `.env` file |
|
|
49
|
+
| `envpilot push` | Push local `.env` changes to Envpilot |
|
|
50
|
+
| `envpilot list orgs` | List your organizations |
|
|
51
|
+
| `envpilot list projects` | List projects in the active organization |
|
|
52
|
+
| `envpilot list variables` | List variables in the active project |
|
|
53
|
+
| `envpilot switch` | Switch the active project |
|
|
54
|
+
| `envpilot config` | View or update CLI configuration |
|
|
55
|
+
| `envpilot whoami` | Show the currently authenticated user |
|
|
56
|
+
|
|
57
|
+
## Role-Based Access
|
|
58
|
+
|
|
59
|
+
Envpilot enforces two-tier role-based access control:
|
|
60
|
+
|
|
61
|
+
**Organization roles**: Admin, Team Lead, Member
|
|
62
|
+
|
|
63
|
+
**Project roles**: Manager, Developer, Viewer
|
|
64
|
+
|
|
65
|
+
- **Viewers** have read-only access to explicitly permitted variables
|
|
66
|
+
- **Developers** can push changes, which creates pending approval requests
|
|
67
|
+
- **Managers** can push directly and approve pending requests
|
|
68
|
+
|
|
69
|
+
## Requirements
|
|
70
|
+
|
|
71
|
+
- Node.js 18 or later
|
|
72
|
+
- An [Envpilot](https://www.envpilot.dev) account
|
|
73
|
+
|
|
74
|
+
## Links
|
|
75
|
+
|
|
76
|
+
- [Website](https://www.envpilot.dev)
|
|
77
|
+
- [Privacy Policy](https://www.envpilot.dev/privacy)
|
|
78
|
+
- [Terms & Conditions](https://www.envpilot.dev/terms)
|
|
79
|
+
- [GitHub](https://github.com/rafay99-epic/envpilot.dev)
|
|
80
|
+
|
|
81
|
+
## License
|
|
82
|
+
|
|
83
|
+
This software is proprietary. See [Terms & Conditions](https://www.envpilot.dev/terms) for details.
|
package/dist/index.js
CHANGED
|
@@ -403,11 +403,14 @@ var APIClient = class {
|
|
|
403
403
|
/**
|
|
404
404
|
* List variables in a project
|
|
405
405
|
*/
|
|
406
|
-
async listVariables(projectId, environment) {
|
|
406
|
+
async listVariables(projectId, environment, organizationId) {
|
|
407
407
|
const params = { projectId };
|
|
408
408
|
if (environment) {
|
|
409
409
|
params.environment = environment;
|
|
410
410
|
}
|
|
411
|
+
if (organizationId) {
|
|
412
|
+
params.organizationId = organizationId;
|
|
413
|
+
}
|
|
411
414
|
const response = await this.get(
|
|
412
415
|
"/api/cli/variables",
|
|
413
416
|
params
|
|
@@ -1067,7 +1070,10 @@ var pullCommand = new Command3("pull").description("Download environment variabl
|
|
|
1067
1070
|
async () => {
|
|
1068
1071
|
const response = await api.get("/api/cli/variables", {
|
|
1069
1072
|
projectId: projectConfig.projectId,
|
|
1070
|
-
environment
|
|
1073
|
+
environment,
|
|
1074
|
+
...projectConfig.organizationId && {
|
|
1075
|
+
organizationId: projectConfig.organizationId
|
|
1076
|
+
}
|
|
1071
1077
|
});
|
|
1072
1078
|
metaProjectRole = response.meta?.projectRole;
|
|
1073
1079
|
return response.data || [];
|
|
@@ -1284,10 +1290,14 @@ var pushCommand = new Command4("push").description("Upload local .env file to cl
|
|
|
1284
1290
|
const remoteVariables = await withSpinner(
|
|
1285
1291
|
"Fetching current variables...",
|
|
1286
1292
|
async () => {
|
|
1287
|
-
const
|
|
1293
|
+
const params = {
|
|
1288
1294
|
projectId: projectConfig.projectId,
|
|
1289
1295
|
environment
|
|
1290
|
-
}
|
|
1296
|
+
};
|
|
1297
|
+
if (projectConfig.organizationId) {
|
|
1298
|
+
params.organizationId = projectConfig.organizationId;
|
|
1299
|
+
}
|
|
1300
|
+
const response = await api.get("/api/cli/variables", params);
|
|
1291
1301
|
return response.data || [];
|
|
1292
1302
|
}
|
|
1293
1303
|
);
|
|
@@ -1355,7 +1365,10 @@ var pushCommand = new Command4("push").description("Upload local .env file to cl
|
|
|
1355
1365
|
key,
|
|
1356
1366
|
value
|
|
1357
1367
|
})),
|
|
1358
|
-
mode
|
|
1368
|
+
mode,
|
|
1369
|
+
...projectConfig.organizationId && {
|
|
1370
|
+
organizationId: projectConfig.organizationId
|
|
1371
|
+
}
|
|
1359
1372
|
});
|
|
1360
1373
|
return response.data;
|
|
1361
1374
|
}
|
|
@@ -2030,7 +2043,7 @@ var logoutCommand = new Command8("logout").description("Log out from Envpilot").
|
|
|
2030
2043
|
|
|
2031
2044
|
// src/index.ts
|
|
2032
2045
|
var program = new Command9();
|
|
2033
|
-
program.name("envpilot").description("Envpilot CLI - Sync, secure, and share environment variables").version("
|
|
2046
|
+
program.name("envpilot").description("Envpilot CLI - Sync, secure, and share environment variables").version("1.0.0");
|
|
2034
2047
|
program.addCommand(loginCommand);
|
|
2035
2048
|
program.addCommand(logoutCommand);
|
|
2036
2049
|
program.addCommand(initCommand);
|
package/package.json
CHANGED
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@envpilot/cli",
|
|
3
|
-
"version": "
|
|
4
|
-
"description": "CLI
|
|
3
|
+
"version": "1.1.0",
|
|
4
|
+
"description": "Envpilot CLI — sync and manage environment variables from the terminal",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
7
7
|
"envpilot": "./dist/index.js"
|
|
8
8
|
},
|
|
9
9
|
"main": "./dist/index.js",
|
|
10
10
|
"files": [
|
|
11
|
-
"dist"
|
|
11
|
+
"dist",
|
|
12
|
+
"README.md"
|
|
12
13
|
],
|
|
13
14
|
"scripts": {
|
|
14
15
|
"build": "tsup src/index.ts --format esm --dts --clean",
|
|
@@ -50,6 +51,14 @@
|
|
|
50
51
|
"dotenv",
|
|
51
52
|
"secrets"
|
|
52
53
|
],
|
|
53
|
-
"author": "",
|
|
54
|
-
"license": "
|
|
54
|
+
"author": "Envpilot <hello@envpilot.dev> (https://www.envpilot.dev)",
|
|
55
|
+
"license": "UNLICENSED",
|
|
56
|
+
"repository": {
|
|
57
|
+
"type": "git",
|
|
58
|
+
"url": "https://github.com/rafay99-epic/envpilot.dev"
|
|
59
|
+
},
|
|
60
|
+
"homepage": "https://www.envpilot.dev",
|
|
61
|
+
"bugs": {
|
|
62
|
+
"url": "https://github.com/rafay99-epic/envpilot.dev/issues"
|
|
63
|
+
}
|
|
55
64
|
}
|