@ssm123ssm/vault 0.1.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/index.js ADDED
@@ -0,0 +1,28 @@
1
+ #!/usr/bin/env node
2
+
3
+ const path = require("path");
4
+
5
+ const command = process.argv[2];
6
+
7
+ function showHelp() {
8
+ console.log(`vault <command>
9
+
10
+ Commands:
11
+ link Link a daemon to your dashboard
12
+ add Add a local project path + passphrase
13
+ run Run the daemon (WebSocket listener)
14
+ `);
15
+ }
16
+
17
+ if (!command || command === "help" || command === "--help" || command === "-h") {
18
+ showHelp();
19
+ process.exit(0);
20
+ }
21
+
22
+ if (!["link", "add", "run"].includes(command)) {
23
+ showHelp();
24
+ process.exit(1);
25
+ }
26
+
27
+ const agentCli = path.join(__dirname, "..", "preview-agent.js");
28
+ require(agentCli);
package/package.json ADDED
@@ -0,0 +1,16 @@
1
+ {
2
+ "name": "@ssm123ssm/vault",
3
+ "version": "0.1.1",
4
+ "private": false,
5
+ "description": "Preview Vault agent CLI",
6
+ "bin": {
7
+ "vault": "index.js"
8
+ },
9
+ "scripts": {
10
+ "publish:otp": "node publish-with-otp.js"
11
+ },
12
+ "dependencies": {
13
+ "prompts": "^2.4.2",
14
+ "ws": "^8.18.0"
15
+ }
16
+ }
@@ -0,0 +1,25 @@
1
+ #!/usr/bin/env node
2
+
3
+ const { spawnSync } = require("child_process");
4
+ const prompts = require("prompts");
5
+
6
+ (async () => {
7
+ const response = await prompts({
8
+ type: "password",
9
+ name: "otp",
10
+ message: "npm publish OTP",
11
+ });
12
+
13
+ if (!response.otp) {
14
+ console.error("Missing OTP.");
15
+ process.exit(1);
16
+ }
17
+
18
+ const result = spawnSync(
19
+ "npm",
20
+ ["publish", "--access", "public", "--otp", response.otp],
21
+ { stdio: "inherit" }
22
+ );
23
+
24
+ process.exit(result.status || 0);
25
+ })();