@dcdavidev/bastion-cli 0.2.0 → 0.4.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/LICENSE +21 -0
- package/README.md +72 -0
- package/bin/darwin_amd64/bastion-cli +0 -0
- package/bin/darwin_arm64/bastion-cli +0 -0
- package/bin/index.js +17 -13
- package/bin/linux_amd64/bastion-cli +0 -0
- package/bin/linux_arm64/bastion-cli +0 -0
- package/bin/windows_amd64/bastion-cli.exe +0 -0
- package/bin/windows_arm64/bastion-cli.exe +0 -0
- package/package.json +26 -3
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Davide Di Criscito
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
# @dcdavidev/bastion-cli 🛡️
|
|
2
|
+
|
|
3
|
+
The official Node.js wrapper for **Bastion**, a secure E2EE (End-to-End Encrypted) secrets vault.
|
|
4
|
+
|
|
5
|
+
## Features
|
|
6
|
+
|
|
7
|
+
- **Zero-Config Secrets**: Inject secrets directly into your application's environment.
|
|
8
|
+
- **E2EE**: All secrets are encrypted client-side.
|
|
9
|
+
- **Profiles**: Manage multiple environments (dev, staging, prod) with `bastion profile`.
|
|
10
|
+
- **CI/CD Ready**: All commands support flags to bypass interactive prompts.
|
|
11
|
+
|
|
12
|
+
## Installation
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
npm install -g @dcdavidev/bastion-cli
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
## Quick Start
|
|
19
|
+
|
|
20
|
+
### 1. Initialize and Configure
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
bastion init
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
### 2. Login
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
bastion login --email your@email.com --password your-pass
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
### 3. Run your application with secrets
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
bastion run --project PROJECT_ID --password vault-pass -- node main.js
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
## CLI Reference 📖
|
|
39
|
+
|
|
40
|
+
### Setup & Profiles
|
|
41
|
+
|
|
42
|
+
- `bastion init`: Interactive setup wizard for server and profile configuration.
|
|
43
|
+
- `bastion profile list`: List all configured environments.
|
|
44
|
+
- `bastion profile add <name> <url>`: Add a new server environment.
|
|
45
|
+
- `bastion profile use <name>`: Switch the active environment.
|
|
46
|
+
- `bastion login`: Authenticate and store session token for the active profile.
|
|
47
|
+
|
|
48
|
+
### Management
|
|
49
|
+
|
|
50
|
+
- `bastion create client --name <name>`: Register a new tenant.
|
|
51
|
+
- `bastion create project --client <id> --name <name>`: Add an E2EE project.
|
|
52
|
+
- `bastion list clients`: Show all registered clients.
|
|
53
|
+
- `bastion list projects --client <id>`: Show projects for a client.
|
|
54
|
+
|
|
55
|
+
### Secrets
|
|
56
|
+
|
|
57
|
+
- `bastion set <KEY> <VALUE> --project <id> --password <vault-pass>`: Encrypt and store a secret.
|
|
58
|
+
- `bastion run --project <id> --password <vault-pass> -- <command>`: Inject secrets and execute a command.
|
|
59
|
+
|
|
60
|
+
## Global Flags
|
|
61
|
+
|
|
62
|
+
- `--profile, -P <name>`: Use a specific profile for the command.
|
|
63
|
+
- `--url, -u <url>`: Override the Bastion server URL for any command.
|
|
64
|
+
- `--help, -h`: Help for any command.
|
|
65
|
+
|
|
66
|
+
## Documentation
|
|
67
|
+
|
|
68
|
+
For the full documentation and CLI reference, visit the [official repository](https://github.com/dcdavidev/bastion).
|
|
69
|
+
|
|
70
|
+
## License
|
|
71
|
+
|
|
72
|
+
MIT © [Davide Di Criscito](https://github.com/dcdavidev)
|
|
Binary file
|
|
Binary file
|
package/bin/index.js
CHANGED
|
@@ -1,23 +1,27 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
import { spawn } from 'node:child_process';
|
|
4
|
+
import os from 'node:os';
|
|
5
|
+
import path from 'node:path';
|
|
6
|
+
import { fileURLToPath } from 'node:url';
|
|
7
|
+
|
|
8
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
9
|
+
const __dirname = path.dirname(__filename);
|
|
6
10
|
|
|
7
11
|
// Mapping OS and architecture to the folders created by GoReleaser
|
|
8
12
|
const platforms = {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
13
|
+
darwin: {
|
|
14
|
+
x64: 'darwin_amd64/bastion-cli',
|
|
15
|
+
arm64: 'darwin_arm64/bastion-cli',
|
|
16
|
+
},
|
|
17
|
+
linux: {
|
|
18
|
+
x64: 'linux_amd64/bastion-cli',
|
|
19
|
+
arm64: 'linux_arm64/bastion-cli',
|
|
12
20
|
},
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
21
|
+
win32: {
|
|
22
|
+
x64: 'windows_amd64/bastion-cli.exe',
|
|
23
|
+
arm64: 'windows_arm64/bastion-cli.exe',
|
|
16
24
|
},
|
|
17
|
-
'win32': {
|
|
18
|
-
'x64': 'windows_amd64/bastion-cli.exe',
|
|
19
|
-
'arm64': 'windows_arm64/bastion-cli.exe'
|
|
20
|
-
}
|
|
21
25
|
};
|
|
22
26
|
|
|
23
27
|
const platform = os.platform();
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,18 +1,41 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dcdavidev/bastion-cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"description": "Bastion CLI - Secure secret management and execution",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"secrets",
|
|
7
|
+
"vault",
|
|
8
|
+
"e2ee",
|
|
9
|
+
"encryption",
|
|
10
|
+
"cli",
|
|
11
|
+
"security",
|
|
12
|
+
"blind-backend",
|
|
13
|
+
"injection"
|
|
14
|
+
],
|
|
15
|
+
"homepage": "https://github.com/dcdavidev/bastion#readme",
|
|
16
|
+
"bugs": {
|
|
17
|
+
"url": "https://github.com/dcdavidev/bastion/issues"
|
|
18
|
+
},
|
|
5
19
|
"repository": {
|
|
6
20
|
"type": "git",
|
|
7
21
|
"url": "git+https://github.com/dcdavidev/bastion.git"
|
|
8
22
|
},
|
|
9
23
|
"license": "MIT",
|
|
10
24
|
"author": "Davide Di Criscito",
|
|
11
|
-
"
|
|
25
|
+
"type": "module",
|
|
26
|
+
"main": "bin/index.js",
|
|
12
27
|
"bin": {
|
|
13
28
|
"bastion": "bin/index.js"
|
|
14
29
|
},
|
|
30
|
+
"files": [
|
|
31
|
+
"bin/",
|
|
32
|
+
"LICENSE",
|
|
33
|
+
"README.md"
|
|
34
|
+
],
|
|
15
35
|
"publishConfig": {
|
|
16
36
|
"access": "public"
|
|
37
|
+
},
|
|
38
|
+
"scripts": {
|
|
39
|
+
"build": "go build -o ../../bastion main.go"
|
|
17
40
|
}
|
|
18
|
-
}
|
|
41
|
+
}
|