@keywaysh/cli 0.0.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/README.md +42 -0
- package/dist/cli.js +138 -0
- package/package.json +49 -0
package/README.md
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
# Keyway CLI
|
|
2
|
+
|
|
3
|
+
> One link to all your secrets
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install -g @keywaysh/cli
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Usage
|
|
12
|
+
```bash
|
|
13
|
+
# Initialize in your project
|
|
14
|
+
keyway init
|
|
15
|
+
|
|
16
|
+
# Pull secrets from vault
|
|
17
|
+
keyway pull
|
|
18
|
+
|
|
19
|
+
# List all secrets
|
|
20
|
+
keyway list
|
|
21
|
+
|
|
22
|
+
# Add a new secret
|
|
23
|
+
keyway add API_KEY sk_test_123
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## Development
|
|
27
|
+
```bash
|
|
28
|
+
# Install dependencies
|
|
29
|
+
npm install
|
|
30
|
+
|
|
31
|
+
# Run in dev mode
|
|
32
|
+
npm run dev
|
|
33
|
+
|
|
34
|
+
# Build
|
|
35
|
+
npm run build
|
|
36
|
+
|
|
37
|
+
# Test locally
|
|
38
|
+
npm link
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
## License
|
|
42
|
+
MIT
|
package/dist/cli.js
ADDED
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
"use strict";
|
|
3
|
+
var __create = Object.create;
|
|
4
|
+
var __defProp = Object.defineProperty;
|
|
5
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
6
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
8
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
18
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
19
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
20
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
21
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
22
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
23
|
+
mod
|
|
24
|
+
));
|
|
25
|
+
|
|
26
|
+
// src/cli.ts
|
|
27
|
+
var import_commander = require("commander");
|
|
28
|
+
var import_chalk = __toESM(require("chalk"));
|
|
29
|
+
var import_child_process = require("child_process");
|
|
30
|
+
var program = new import_commander.Command();
|
|
31
|
+
var COMING_SOON_MESSAGE = import_chalk.default.cyan(`
|
|
32
|
+
\u{1F6A7} Keyway is coming soon!
|
|
33
|
+
|
|
34
|
+
We're building the simplest way to manage your team's secrets.
|
|
35
|
+
One link in your README = instant access to all secrets.
|
|
36
|
+
|
|
37
|
+
${import_chalk.default.white("Get early access:")} ${import_chalk.default.underline("https://keyway.sh")}
|
|
38
|
+
${import_chalk.default.white("Contact:")} ${import_chalk.default.underline("unlock@keyway.sh")}
|
|
39
|
+
`);
|
|
40
|
+
program.name("keyway").description("One link to all your secrets (Coming Soon)").version("0.0.1");
|
|
41
|
+
program.command("init").description("Initialize Keyway in your project").action(async () => {
|
|
42
|
+
console.log(import_chalk.default.cyan("\n\u{1F511} Keyway Init (Preview)\n"));
|
|
43
|
+
try {
|
|
44
|
+
const gitRemote = (0, import_child_process.execSync)("git remote get-url origin", { encoding: "utf-8" }).trim();
|
|
45
|
+
let repoPath;
|
|
46
|
+
if (gitRemote.includes("github.com")) {
|
|
47
|
+
const match = gitRemote.match(/github\.com[:/](.+?)(\.git)?$/);
|
|
48
|
+
if (match) {
|
|
49
|
+
repoPath = match[1].replace(".git", "");
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
if (repoPath) {
|
|
53
|
+
console.log(import_chalk.default.green("\u2713") + " GitHub repository detected:");
|
|
54
|
+
console.log(` ${import_chalk.default.gray("Repository:")} ${repoPath}`);
|
|
55
|
+
console.log(` ${import_chalk.default.gray("Future vault URL:")} ${import_chalk.default.white(`https://keyway.sh/${repoPath}`)}`);
|
|
56
|
+
console.log();
|
|
57
|
+
console.log(import_chalk.default.yellow("When launched, you'll be able to:"));
|
|
58
|
+
console.log(" \u2022 Store all your secrets securely");
|
|
59
|
+
console.log(" \u2022 Share with your team instantly");
|
|
60
|
+
console.log(" \u2022 Pull secrets with one command");
|
|
61
|
+
console.log();
|
|
62
|
+
console.log(import_chalk.default.gray("Want early access? Visit https://keyway.sh"));
|
|
63
|
+
}
|
|
64
|
+
} catch {
|
|
65
|
+
console.log(import_chalk.default.yellow("No git repository detected"));
|
|
66
|
+
console.log(import_chalk.default.gray("Keyway will work with any GitHub repository"));
|
|
67
|
+
}
|
|
68
|
+
});
|
|
69
|
+
program.command("demo").description("See how Keyway will work").action(() => {
|
|
70
|
+
console.log(import_chalk.default.cyan("\n\u{1F3AC} Keyway Demo\n"));
|
|
71
|
+
console.log("How it will work:\n");
|
|
72
|
+
console.log(import_chalk.default.white("1. Initialize your project:"));
|
|
73
|
+
console.log(import_chalk.default.gray(" $ ") + import_chalk.default.green("keyway init"));
|
|
74
|
+
console.log(import_chalk.default.gray(" \u2713 Vault created at https://keyway.sh/your/repo\n"));
|
|
75
|
+
console.log(import_chalk.default.white("2. Add the link to your README:"));
|
|
76
|
+
console.log(import_chalk.default.gray(" ## \u{1F511} Secrets"));
|
|
77
|
+
console.log(import_chalk.default.gray(" Access vault: https://keyway.sh/your/repo\n"));
|
|
78
|
+
console.log(import_chalk.default.white("3. Team members pull secrets:"));
|
|
79
|
+
console.log(import_chalk.default.gray(" $ ") + import_chalk.default.green("keyway pull"));
|
|
80
|
+
console.log(import_chalk.default.gray(" \u2713 Authenticated via GitHub"));
|
|
81
|
+
console.log(import_chalk.default.gray(" \u2713 Pulled 23 secrets in 12ms\n"));
|
|
82
|
+
console.log(import_chalk.default.white("4. That's it! No more:"));
|
|
83
|
+
console.log(import_chalk.default.gray(' \u274C "Can you send me the .env file?"'));
|
|
84
|
+
console.log(import_chalk.default.gray(" \u274C API keys in Slack"));
|
|
85
|
+
console.log(import_chalk.default.gray(" \u274C Outdated credentials"));
|
|
86
|
+
console.log(import_chalk.default.gray(" \u274C Onboarding delays\n"));
|
|
87
|
+
console.log(import_chalk.default.cyan("Ready to simplify your secret management?"));
|
|
88
|
+
console.log(import_chalk.default.white("Get early access: ") + import_chalk.default.underline("https://keyway.sh"));
|
|
89
|
+
});
|
|
90
|
+
program.command("waitlist").description("Join the early access waitlist").action(() => {
|
|
91
|
+
console.log(import_chalk.default.cyan("\n\u{1F680} Join the Keyway Waitlist\n"));
|
|
92
|
+
console.log("Get early access at: " + import_chalk.default.underline("https://keyway.sh"));
|
|
93
|
+
console.log();
|
|
94
|
+
console.log("Or email us directly: " + import_chalk.default.underline("unlock@keyway.sh"));
|
|
95
|
+
console.log();
|
|
96
|
+
console.log(import_chalk.default.gray("We'll notify you as soon as Keyway is ready!"));
|
|
97
|
+
});
|
|
98
|
+
program.command("why").description("Why we're building Keyway").action(() => {
|
|
99
|
+
console.log(import_chalk.default.cyan("\n\u{1F4A1} Why Keyway?\n"));
|
|
100
|
+
console.log(import_chalk.default.white("The Problem:"));
|
|
101
|
+
console.log(" \u2022 Secrets scattered across Slack, email, and docs");
|
|
102
|
+
console.log(" \u2022 New developer onboarding takes hours");
|
|
103
|
+
console.log(" \u2022 No single source of truth for env variables");
|
|
104
|
+
console.log(" \u2022 Complex solutions like HashiCorp Vault are overkill\n");
|
|
105
|
+
console.log(import_chalk.default.white("Our Solution:"));
|
|
106
|
+
console.log(" \u2022 One link in your README");
|
|
107
|
+
console.log(" \u2022 GitHub access = vault access");
|
|
108
|
+
console.log(" \u2022 Zero-trust architecture");
|
|
109
|
+
console.log(" \u2022 12ms to pull all secrets\n");
|
|
110
|
+
console.log(import_chalk.default.white("Built for:"));
|
|
111
|
+
console.log(" \u2022 Small to medium dev teams");
|
|
112
|
+
console.log(" \u2022 Projects with multiple environments");
|
|
113
|
+
console.log(" \u2022 Teams tired of complexity\n");
|
|
114
|
+
console.log(import_chalk.default.gray("Learn more at https://keyway.sh"));
|
|
115
|
+
});
|
|
116
|
+
program.command("feedback [message...]").description("Send us feedback").action((message) => {
|
|
117
|
+
if (message && message.length > 0) {
|
|
118
|
+
console.log(import_chalk.default.cyan("\n\u{1F4EC} Thank you for your feedback!\n"));
|
|
119
|
+
console.log("Your message: " + import_chalk.default.italic(message.join(" ")));
|
|
120
|
+
console.log();
|
|
121
|
+
console.log("Please email it to: " + import_chalk.default.underline("unlock@keyway.sh"));
|
|
122
|
+
console.log(import_chalk.default.gray("We read every message!"));
|
|
123
|
+
} else {
|
|
124
|
+
console.log(import_chalk.default.cyan("\n\u{1F4EC} We'd love your feedback!\n"));
|
|
125
|
+
console.log("Email us at: " + import_chalk.default.underline("unlock@keyway.sh"));
|
|
126
|
+
console.log();
|
|
127
|
+
console.log("Or use: " + import_chalk.default.gray('keyway feedback "your message here"'));
|
|
128
|
+
}
|
|
129
|
+
});
|
|
130
|
+
program.command("speed").description("Test CLI speed").action(() => {
|
|
131
|
+
const start = Date.now();
|
|
132
|
+
console.log(import_chalk.default.green(`\u26A1 Executed in ${Date.now() - start}ms`));
|
|
133
|
+
});
|
|
134
|
+
program.parse();
|
|
135
|
+
if (!process.argv.slice(2).length) {
|
|
136
|
+
console.log(COMING_SOON_MESSAGE);
|
|
137
|
+
console.log(import_chalk.default.gray("Try: keyway demo"));
|
|
138
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@keywaysh/cli",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"description": "One link to all your secrets",
|
|
5
|
+
"bin": {
|
|
6
|
+
"keyway": "./dist/cli.js"
|
|
7
|
+
},
|
|
8
|
+
"files": [
|
|
9
|
+
"dist"
|
|
10
|
+
],
|
|
11
|
+
"scripts": {
|
|
12
|
+
"dev": "tsx src/cli.ts",
|
|
13
|
+
"build": "tsup",
|
|
14
|
+
"build:watch": "tsup --watch",
|
|
15
|
+
"prepublishOnly": "npm run build"
|
|
16
|
+
},
|
|
17
|
+
"keywords": [
|
|
18
|
+
"secrets",
|
|
19
|
+
"env",
|
|
20
|
+
"keyway",
|
|
21
|
+
"cli",
|
|
22
|
+
"devops"
|
|
23
|
+
],
|
|
24
|
+
"author": "Nicolas Ritouet",
|
|
25
|
+
"license": "MIT",
|
|
26
|
+
"homepage": "https://keyway.sh",
|
|
27
|
+
"repository": {
|
|
28
|
+
"type": "git",
|
|
29
|
+
"url": "https://github.com/keywaysh/cli.git"
|
|
30
|
+
},
|
|
31
|
+
"bugs": {
|
|
32
|
+
"url": "https://github.com/keywaysh/cli/issues"
|
|
33
|
+
},
|
|
34
|
+
"engines": {
|
|
35
|
+
"node": ">=16.0.0"
|
|
36
|
+
},
|
|
37
|
+
"dependencies": {
|
|
38
|
+
"chalk": "^4.1.2",
|
|
39
|
+
"commander": "^14.0.0",
|
|
40
|
+
"dotenv": "^17.2.1",
|
|
41
|
+
"ora": "^8.2.0"
|
|
42
|
+
},
|
|
43
|
+
"devDependencies": {
|
|
44
|
+
"@types/node": "^24.2.0",
|
|
45
|
+
"tsup": "^8.5.0",
|
|
46
|
+
"tsx": "^4.20.3",
|
|
47
|
+
"typescript": "^5.9.2"
|
|
48
|
+
}
|
|
49
|
+
}
|