@scalekit-inc/cli 0.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 ADDED
@@ -0,0 +1,47 @@
1
+ # ScaleKit CLI
2
+
3
+ Command-line tool for the ScaleKit auth stack.
4
+
5
+ [![npm version](https://img.shields.io/npm/v/@scalekit-inc/cli?style=flat-square)](https://www.npmjs.com/package/@scalekit-inc/cli)
6
+ [![Node.js](https://img.shields.io/badge/Node.js->=20-3c873a?style=flat-square)](https://nodejs.org)
7
+ [![License](https://img.shields.io/badge/License-MIT-blue?style=flat-square)](LICENSE)
8
+
9
+ ## Installation
10
+
11
+ ```bash
12
+ npm install -g @scalekit-inc/cli
13
+ ```
14
+
15
+ Or with pnpm:
16
+
17
+ ```bash
18
+ pnpm add -g @scalekit-inc/cli
19
+ ```
20
+
21
+ ## Usage
22
+
23
+ ```bash
24
+ scalekit [command] [options]
25
+ ```
26
+
27
+ A shorter alias is also available:
28
+
29
+ ```bash
30
+ sk [command] [options]
31
+ ```
32
+
33
+ ### Options
34
+
35
+ ```
36
+ -V, --version output the version number
37
+ --plain disable colors and styling
38
+ -h, --help display help for command
39
+ ```
40
+
41
+ > [!TIP]
42
+ > Set the `NO_COLOR` environment variable to disable colors in all output,
43
+ > or pass `--plain` for a single invocation.
44
+
45
+ ## Requirements
46
+
47
+ - Node.js >= 20
package/bin/cli.js ADDED
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ import "../dist/index.js";
package/dist/index.js ADDED
@@ -0,0 +1,68 @@
1
+ // src/index.ts
2
+ import cfonts from "cfonts";
3
+ import { Command } from "commander";
4
+
5
+ // src/core/help.ts
6
+ import pc from "picocolors";
7
+ function formatHeader(cmd) {
8
+ const desc = cmd.description();
9
+ const title = desc ? `${cmd.name()} \u2014 ${desc}` : cmd.name();
10
+ return pc.bold(pc.cyan(title));
11
+ }
12
+ function formatUsage(cmd) {
13
+ return [pc.bold("USAGE"), ` $ ${cmd.name()} ${cmd.usage()}`].join("\n");
14
+ }
15
+ function formatCommands(cmd, helper) {
16
+ const commands = helper.visibleCommands(cmd);
17
+ if (commands.length === 0) return null;
18
+ const pad = Math.max(...commands.map((c) => c.name().length)) + 2;
19
+ const lines = commands.map(
20
+ (sub) => ` ${pc.bold(sub.name().padEnd(pad))}${pc.dim(sub.description())}`
21
+ );
22
+ return [pc.bold("COMMANDS"), ...lines].join("\n");
23
+ }
24
+ function formatOptions(cmd, helper) {
25
+ const options = helper.visibleOptions(cmd);
26
+ if (options.length === 0) return null;
27
+ const pad = Math.max(...options.map((o) => helper.optionTerm(o).length)) + 2;
28
+ const lines = options.map(
29
+ (opt) => ` ${pc.yellow(helper.optionTerm(opt).padEnd(pad))}${pc.dim(opt.description)}`
30
+ );
31
+ return [pc.bold("OPTIONS"), ...lines].join("\n");
32
+ }
33
+ function scalekitHelp() {
34
+ return {
35
+ formatHelp(cmd, helper) {
36
+ const sections = [
37
+ formatHeader(cmd),
38
+ formatUsage(cmd),
39
+ formatCommands(cmd, helper),
40
+ formatOptions(cmd, helper)
41
+ ].filter(Boolean);
42
+ return `${sections.join("\n\n")}
43
+ `;
44
+ }
45
+ };
46
+ }
47
+
48
+ // src/index.ts
49
+ function showBanner() {
50
+ if (process.env.NO_COLOR || process.argv.includes("--plain")) {
51
+ return;
52
+ }
53
+ cfonts.say("ScaleKit", {
54
+ font: "chrome",
55
+ align: "left",
56
+ colors: ["cyan", "white", "blue"],
57
+ letterSpacing: 1,
58
+ space: true
59
+ });
60
+ }
61
+ var program = new Command();
62
+ program.name("scalekit").description("Auth stack for the agentic era").version("0.1.0").option("--plain", "disable colors and styling (also respects NO_COLOR env)").configureHelp(scalekitHelp()).addHelpCommand(false);
63
+ program.action(() => {
64
+ showBanner();
65
+ program.help();
66
+ });
67
+ program.parse();
68
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/index.ts","../src/core/help.ts"],"sourcesContent":["import cfonts from \"cfonts\";\nimport { Command } from \"commander\";\nimport { scalekitHelp } from \"./core/help.js\";\n\nfunction showBanner() {\n\tif (process.env.NO_COLOR || process.argv.includes(\"--plain\")) {\n\t\treturn;\n\t}\n\n\tcfonts.say(\"ScaleKit\", {\n\t\tfont: \"chrome\",\n\t\talign: \"left\",\n\t\tcolors: [\"cyan\", \"white\", \"blue\"],\n\t\tletterSpacing: 1,\n\t\tspace: true,\n\t});\n}\n\nconst program = new Command();\n\nprogram\n\t.name(\"scalekit\")\n\t.description(\"Auth stack for the agentic era\")\n\t.version(\"0.1.0\")\n\t.option(\"--plain\", \"disable colors and styling (also respects NO_COLOR env)\")\n\t.configureHelp(scalekitHelp())\n\t.addHelpCommand(false);\n\nprogram.action(() => {\n\tshowBanner();\n\tprogram.help();\n});\n\nprogram.parse();\n","import type { Command, Help } from \"commander\";\nimport pc from \"picocolors\";\n\nfunction formatHeader(cmd: Command): string {\n\tconst desc = cmd.description();\n\tconst title = desc ? `${cmd.name()} — ${desc}` : cmd.name();\n\treturn pc.bold(pc.cyan(title));\n}\n\nfunction formatUsage(cmd: Command): string {\n\treturn [pc.bold(\"USAGE\"), ` $ ${cmd.name()} ${cmd.usage()}`].join(\"\\n\");\n}\n\nfunction formatCommands(cmd: Command, helper: Help): string | null {\n\tconst commands = helper.visibleCommands(cmd);\n\tif (commands.length === 0) return null;\n\n\tconst pad = Math.max(...commands.map((c) => c.name().length)) + 2;\n\tconst lines = commands.map(\n\t\t(sub) => ` ${pc.bold(sub.name().padEnd(pad))}${pc.dim(sub.description())}`,\n\t);\n\n\treturn [pc.bold(\"COMMANDS\"), ...lines].join(\"\\n\");\n}\n\nfunction formatOptions(cmd: Command, helper: Help): string | null {\n\tconst options = helper.visibleOptions(cmd);\n\tif (options.length === 0) return null;\n\n\tconst pad = Math.max(...options.map((o) => helper.optionTerm(o).length)) + 2;\n\tconst lines = options.map(\n\t\t(opt) =>\n\t\t\t` ${pc.yellow(helper.optionTerm(opt).padEnd(pad))}${pc.dim(opt.description)}`,\n\t);\n\n\treturn [pc.bold(\"OPTIONS\"), ...lines].join(\"\\n\");\n}\n\nexport function scalekitHelp() {\n\treturn {\n\t\tformatHelp(cmd: Command, helper: Help): string {\n\t\t\tconst sections = [\n\t\t\t\tformatHeader(cmd),\n\t\t\t\tformatUsage(cmd),\n\t\t\t\tformatCommands(cmd, helper),\n\t\t\t\tformatOptions(cmd, helper),\n\t\t\t].filter(Boolean);\n\n\t\t\treturn `${sections.join(\"\\n\\n\")}\\n`;\n\t\t},\n\t};\n}\n"],"mappings":";AAAA,OAAO,YAAY;AACnB,SAAS,eAAe;;;ACAxB,OAAO,QAAQ;AAEf,SAAS,aAAa,KAAsB;AAC3C,QAAM,OAAO,IAAI,YAAY;AAC7B,QAAM,QAAQ,OAAO,GAAG,IAAI,KAAK,CAAC,WAAM,IAAI,KAAK,IAAI,KAAK;AAC1D,SAAO,GAAG,KAAK,GAAG,KAAK,KAAK,CAAC;AAC9B;AAEA,SAAS,YAAY,KAAsB;AAC1C,SAAO,CAAC,GAAG,KAAK,OAAO,GAAG,OAAO,IAAI,KAAK,CAAC,IAAI,IAAI,MAAM,CAAC,EAAE,EAAE,KAAK,IAAI;AACxE;AAEA,SAAS,eAAe,KAAc,QAA6B;AAClE,QAAM,WAAW,OAAO,gBAAgB,GAAG;AAC3C,MAAI,SAAS,WAAW,EAAG,QAAO;AAElC,QAAM,MAAM,KAAK,IAAI,GAAG,SAAS,IAAI,CAAC,MAAM,EAAE,KAAK,EAAE,MAAM,CAAC,IAAI;AAChE,QAAM,QAAQ,SAAS;AAAA,IACtB,CAAC,QAAQ,KAAK,GAAG,KAAK,IAAI,KAAK,EAAE,OAAO,GAAG,CAAC,CAAC,GAAG,GAAG,IAAI,IAAI,YAAY,CAAC,CAAC;AAAA,EAC1E;AAEA,SAAO,CAAC,GAAG,KAAK,UAAU,GAAG,GAAG,KAAK,EAAE,KAAK,IAAI;AACjD;AAEA,SAAS,cAAc,KAAc,QAA6B;AACjE,QA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/package.json ADDED
@@ -0,0 +1,48 @@
1
+ {
2
+ "name": "@scalekit-inc/cli",
3
+ "version": "0.1.0",
4
+ "description": "Scalekit CLI",
5
+ "type": "module",
6
+ "bin": {
7
+ "scalekit": "./bin/cli.js",
8
+ "sk": "./bin/cli.js"
9
+ },
10
+ "files": [
11
+ "bin",
12
+ "dist"
13
+ ],
14
+ "engines": {
15
+ "node": ">=20"
16
+ },
17
+ "scripts": {
18
+ "build": "tsup",
19
+ "dev": "tsup --watch",
20
+ "lint": "biome check .",
21
+ "lint:fix": "biome check --write .",
22
+ "publint": "publint",
23
+ "prepublishOnly": "npm run build && npm run publint",
24
+ "release": "np --any-branch"
25
+ },
26
+ "keywords": [
27
+ "scalekit",
28
+ "cli",
29
+ "auth"
30
+ ],
31
+ "publishConfig": {
32
+ "access": "public"
33
+ },
34
+ "license": "MIT",
35
+ "dependencies": {
36
+ "cfonts": "^3.3.1",
37
+ "commander": "^14.0.3",
38
+ "picocolors": "^1.1.1"
39
+ },
40
+ "devDependencies": {
41
+ "@biomejs/biome": "^2.4.15",
42
+ "@types/node": "^25.7.0",
43
+ "np": "^11.2.0",
44
+ "publint": "^0.3.20",
45
+ "tsup": "^8.5.1",
46
+ "typescript": "^6.0.3"
47
+ }
48
+ }