clygl 1.0.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 +40 -0
- package/bundled-plugins/plugin-gitleaks/dist/config.d.ts +4 -0
- package/bundled-plugins/plugin-gitleaks/dist/config.js +37 -0
- package/bundled-plugins/plugin-gitleaks/dist/index.d.ts +2 -0
- package/bundled-plugins/plugin-gitleaks/dist/index.js +77 -0
- package/bundled-plugins/plugin-gitleaks/dist/scan.d.ts +7 -0
- package/bundled-plugins/plugin-gitleaks/dist/scan.js +76 -0
- package/bundled-plugins/plugin-gitleaks/package.json +20 -0
- package/dist/commands/generate.d.ts +3 -0
- package/dist/commands/generate.d.ts.map +1 -0
- package/dist/commands/generate.js +24 -0
- package/dist/commands/generate.js.map +1 -0
- package/dist/commands/install.d.ts +3 -0
- package/dist/commands/install.d.ts.map +1 -0
- package/dist/commands/install.js +59 -0
- package/dist/commands/install.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +18 -0
- package/dist/index.js.map +1 -0
- package/dist/plugins/config.d.ts +5 -0
- package/dist/plugins/config.d.ts.map +1 -0
- package/dist/plugins/config.js +32 -0
- package/dist/plugins/config.js.map +1 -0
- package/dist/plugins/discover.d.ts +6 -0
- package/dist/plugins/discover.d.ts.map +1 -0
- package/dist/plugins/discover.js +44 -0
- package/dist/plugins/discover.js.map +1 -0
- package/dist/plugins/loader.d.ts +3 -0
- package/dist/plugins/loader.d.ts.map +1 -0
- package/dist/plugins/loader.js +40 -0
- package/dist/plugins/loader.js.map +1 -0
- package/dist/types/plugin.d.ts +8 -0
- package/dist/types/plugin.d.ts.map +1 -0
- package/dist/types/plugin.js +2 -0
- package/dist/types/plugin.js.map +1 -0
- package/package.json +39 -0
package/README.md
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
# clygl
|
|
2
|
+
|
|
3
|
+
Modular CLI dev tool with plugins.
|
|
4
|
+
|
|
5
|
+
## Install (Homebrew)
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
brew tap Charlilyyyy/clygl
|
|
9
|
+
brew install clygl
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
Requires [`clygl` on npm](https://www.npmjs.com/package/clygl) — see [PUBLISH.md](./PUBLISH.md) for first-time release steps.
|
|
13
|
+
|
|
14
|
+
## Quick start
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
clygl --help
|
|
18
|
+
clygl gitleaks savepath src
|
|
19
|
+
clygl gitleaks scan
|
|
20
|
+
clygl install generate
|
|
21
|
+
clygl generate list
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## Optional plugins
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
clygl install generate
|
|
28
|
+
clygl install hello
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
## Development
|
|
32
|
+
|
|
33
|
+
See [guide.md](./guide.md).
|
|
34
|
+
|
|
35
|
+
## Repos
|
|
36
|
+
|
|
37
|
+
| GitHub repo | Purpose |
|
|
38
|
+
|-------------|---------|
|
|
39
|
+
| [Charlilyyyy/clygl](https://github.com/Charlilyyyy/clygl) | Source code (this project) |
|
|
40
|
+
| [Charlilyyyy/homebrew-clygl](https://github.com/Charlilyyyy/homebrew-clygl) | Homebrew tap (`brew tap Charlilyyyy/clygl`) |
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
|
|
2
|
+
import { homedir } from "node:os";
|
|
3
|
+
import { join } from "node:path";
|
|
4
|
+
const CLYGL_HOME = join(homedir(), ".clygl");
|
|
5
|
+
const CONFIG_PATH = join(CLYGL_HOME, "gitleaks.json");
|
|
6
|
+
function ensureClyglHome() {
|
|
7
|
+
if (!existsSync(CLYGL_HOME)) {
|
|
8
|
+
mkdirSync(CLYGL_HOME, { recursive: true });
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
function readConfig() {
|
|
12
|
+
ensureClyglHome();
|
|
13
|
+
if (!existsSync(CONFIG_PATH)) {
|
|
14
|
+
return {};
|
|
15
|
+
}
|
|
16
|
+
return JSON.parse(readFileSync(CONFIG_PATH, "utf8"));
|
|
17
|
+
}
|
|
18
|
+
function writeConfig(config) {
|
|
19
|
+
ensureClyglHome();
|
|
20
|
+
writeFileSync(CONFIG_PATH, `${JSON.stringify(config, null, 2)}\n`);
|
|
21
|
+
}
|
|
22
|
+
export function getSavedScanPath() {
|
|
23
|
+
return readConfig().scanPath;
|
|
24
|
+
}
|
|
25
|
+
export function setSavedScanPath(scanPath) {
|
|
26
|
+
const config = readConfig();
|
|
27
|
+
config.scanPath = scanPath;
|
|
28
|
+
writeConfig(config);
|
|
29
|
+
}
|
|
30
|
+
export function clearSavedScanPath() {
|
|
31
|
+
const config = readConfig();
|
|
32
|
+
delete config.scanPath;
|
|
33
|
+
writeConfig(config);
|
|
34
|
+
}
|
|
35
|
+
export function getConfigPath() {
|
|
36
|
+
return CONFIG_PATH;
|
|
37
|
+
}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { writeFile } from "node:fs/promises";
|
|
2
|
+
import { resolve } from "node:path";
|
|
3
|
+
import { clearSavedScanPath, getConfigPath, getSavedScanPath, setSavedScanPath, } from "./config.js";
|
|
4
|
+
import { scanDirectory } from "./scan.js";
|
|
5
|
+
function resolveScanRoot(cliPath) {
|
|
6
|
+
const pathToUse = cliPath ?? getSavedScanPath() ?? ".";
|
|
7
|
+
return resolve(process.cwd(), pathToUse);
|
|
8
|
+
}
|
|
9
|
+
export function register(program) {
|
|
10
|
+
const gitleaks = program
|
|
11
|
+
.command("gitleaks")
|
|
12
|
+
.description("Scan for secrets and common leak patterns in code");
|
|
13
|
+
gitleaks
|
|
14
|
+
.command("savepath")
|
|
15
|
+
.description("Save default scan directory for scan/report")
|
|
16
|
+
.argument("<path>", "Directory path (e.g. src)")
|
|
17
|
+
.action((scanPath) => {
|
|
18
|
+
setSavedScanPath(scanPath);
|
|
19
|
+
console.log(`Saved gitleaks scan path: ${scanPath}`);
|
|
20
|
+
console.log(`Config: ${getConfigPath()}`);
|
|
21
|
+
console.log("Run `clygl gitleaks scan` to use it.");
|
|
22
|
+
});
|
|
23
|
+
gitleaks
|
|
24
|
+
.command("showpath")
|
|
25
|
+
.description("Show saved scan directory")
|
|
26
|
+
.action(() => {
|
|
27
|
+
const saved = getSavedScanPath();
|
|
28
|
+
if (!saved) {
|
|
29
|
+
console.log("No saved path. Using current directory (.) when you run scan.");
|
|
30
|
+
console.log("Set one with: clygl gitleaks savepath src");
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
33
|
+
console.log(`Saved scan path: ${saved}`);
|
|
34
|
+
console.log(`Resolved from cwd: ${resolve(process.cwd(), saved)}`);
|
|
35
|
+
console.log(`Config: ${getConfigPath()}`);
|
|
36
|
+
});
|
|
37
|
+
gitleaks
|
|
38
|
+
.command("clearpath")
|
|
39
|
+
.description("Remove saved scan directory")
|
|
40
|
+
.action(() => {
|
|
41
|
+
clearSavedScanPath();
|
|
42
|
+
console.log("Cleared saved scan path. scan/report will use . or an explicit path.");
|
|
43
|
+
});
|
|
44
|
+
gitleaks
|
|
45
|
+
.command("scan")
|
|
46
|
+
.description("Scan a directory for potential leaks")
|
|
47
|
+
.argument("[path]", "Directory to scan (uses savepath default if omitted)")
|
|
48
|
+
.action(async (scanPath) => {
|
|
49
|
+
const root = resolveScanRoot(scanPath);
|
|
50
|
+
const findings = await scanDirectory(root);
|
|
51
|
+
if (findings.length === 0) {
|
|
52
|
+
console.log(`No issues found in ${root}`);
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
console.log(`Found ${findings.length} issue(s) in ${root}:`);
|
|
56
|
+
for (const finding of findings) {
|
|
57
|
+
console.log(`- ${finding.file}:${finding.line} [${finding.rule}] ${finding.snippet}`);
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
gitleaks
|
|
61
|
+
.command("report")
|
|
62
|
+
.description("Scan and write a JSON report")
|
|
63
|
+
.argument("[path]", "Directory to scan (uses savepath default if omitted)")
|
|
64
|
+
.option("-o, --output <file>", "Report file path", "gitleaks-report.json")
|
|
65
|
+
.action(async (scanPath, options) => {
|
|
66
|
+
const root = resolveScanRoot(scanPath);
|
|
67
|
+
const findings = await scanDirectory(root);
|
|
68
|
+
const report = {
|
|
69
|
+
scannedAt: new Date().toISOString(),
|
|
70
|
+
root,
|
|
71
|
+
count: findings.length,
|
|
72
|
+
findings,
|
|
73
|
+
};
|
|
74
|
+
await writeFile(options.output, `${JSON.stringify(report, null, 2)}\n`);
|
|
75
|
+
console.log(`Wrote ${findings.length} finding(s) to ${options.output}`);
|
|
76
|
+
});
|
|
77
|
+
}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { readdir, readFile } from "node:fs/promises";
|
|
2
|
+
import { join, relative } from "node:path";
|
|
3
|
+
const SCAN_EXTENSIONS = new Set([
|
|
4
|
+
".ts",
|
|
5
|
+
".tsx",
|
|
6
|
+
".js",
|
|
7
|
+
".jsx",
|
|
8
|
+
".json",
|
|
9
|
+
".env",
|
|
10
|
+
".yaml",
|
|
11
|
+
".yml",
|
|
12
|
+
]);
|
|
13
|
+
const RULES = [
|
|
14
|
+
{
|
|
15
|
+
rule: "hardcoded-secret",
|
|
16
|
+
pattern: /(?:api[_-]?key|secret|password|token|private[_-]?key)\s*[:=]\s*['"][^'"]{8,}['"]/i,
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
rule: "aws-access-key",
|
|
20
|
+
pattern: /AKIA[0-9A-Z]{16}/,
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
rule: "private-key-block",
|
|
24
|
+
pattern: /-----BEGIN (?:RSA |EC |OPENSSH )?PRIVATE KEY-----/,
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
rule: "console-log",
|
|
28
|
+
pattern: /console\.(log|debug|info)\(/,
|
|
29
|
+
},
|
|
30
|
+
];
|
|
31
|
+
async function walkFiles(dir) {
|
|
32
|
+
const entries = await readdir(dir, { withFileTypes: true });
|
|
33
|
+
const files = [];
|
|
34
|
+
for (const entry of entries) {
|
|
35
|
+
if (entry.name.startsWith(".") || entry.name === "node_modules") {
|
|
36
|
+
continue;
|
|
37
|
+
}
|
|
38
|
+
const fullPath = join(dir, entry.name);
|
|
39
|
+
if (entry.isDirectory()) {
|
|
40
|
+
files.push(...(await walkFiles(fullPath)));
|
|
41
|
+
continue;
|
|
42
|
+
}
|
|
43
|
+
const ext = entry.name.includes(".")
|
|
44
|
+
? entry.name.slice(entry.name.lastIndexOf("."))
|
|
45
|
+
: "";
|
|
46
|
+
if (SCAN_EXTENSIONS.has(ext)) {
|
|
47
|
+
files.push(fullPath);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
return files;
|
|
51
|
+
}
|
|
52
|
+
export async function scanDirectory(rootPath) {
|
|
53
|
+
const files = await walkFiles(rootPath);
|
|
54
|
+
const findings = [];
|
|
55
|
+
for (const filePath of files) {
|
|
56
|
+
const content = await readFile(filePath, "utf8");
|
|
57
|
+
const lines = content.split("\n");
|
|
58
|
+
for (let i = 0; i < lines.length; i++) {
|
|
59
|
+
const line = lines[i];
|
|
60
|
+
if (!line)
|
|
61
|
+
continue;
|
|
62
|
+
for (const { rule, pattern } of RULES) {
|
|
63
|
+
if (!pattern.test(line))
|
|
64
|
+
continue;
|
|
65
|
+
findings.push({
|
|
66
|
+
file: relative(rootPath, filePath) || filePath,
|
|
67
|
+
line: i + 1,
|
|
68
|
+
rule,
|
|
69
|
+
snippet: line.trim().slice(0, 120),
|
|
70
|
+
});
|
|
71
|
+
break;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
return findings;
|
|
76
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@clygl/plugin-gitleaks",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Scan code for secrets and sensitive patterns",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "dist/index.js",
|
|
7
|
+
"clyglPlugin": true,
|
|
8
|
+
"scripts": {
|
|
9
|
+
"build": "tsc",
|
|
10
|
+
"typecheck": "tsc --noEmit"
|
|
11
|
+
},
|
|
12
|
+
"peerDependencies": {
|
|
13
|
+
"commander": "^15.0.0"
|
|
14
|
+
},
|
|
15
|
+
"devDependencies": {
|
|
16
|
+
"@types/node": "^25.9.1",
|
|
17
|
+
"commander": "^15.0.0",
|
|
18
|
+
"typescript": "^6.0.3"
|
|
19
|
+
}
|
|
20
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generate.d.ts","sourceRoot":"","sources":["../../src/commands/generate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,OAAO,QA2BvD"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { Command } from "commander";
|
|
2
|
+
export function registerGenerateCommand(program) {
|
|
3
|
+
const generate = program.command("generate");
|
|
4
|
+
generate
|
|
5
|
+
.command("<template_name> [version]")
|
|
6
|
+
.description("Generate a codebase template")
|
|
7
|
+
.action((templateName, version) => {
|
|
8
|
+
const finalVersion = version ?? "latest";
|
|
9
|
+
console.log(`Generating ${templateName} template with version ${finalVersion}`);
|
|
10
|
+
});
|
|
11
|
+
generate
|
|
12
|
+
.command("list")
|
|
13
|
+
.description("List all available templates")
|
|
14
|
+
.action(() => {
|
|
15
|
+
console.log("list of available templates");
|
|
16
|
+
});
|
|
17
|
+
generate
|
|
18
|
+
.command("versions <template_name>")
|
|
19
|
+
.description("List available versions for a template")
|
|
20
|
+
.action((templateName) => {
|
|
21
|
+
console.log(`list of available versions for ${templateName}`);
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=generate.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generate.js","sourceRoot":"","sources":["../../src/commands/generate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,MAAM,UAAU,uBAAuB,CAAC,OAAgB;IACtD,MAAM,QAAQ,GAAG,OAAO,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;IAE7C,QAAQ;SACL,OAAO,CAAC,2BAA2B,CAAC;SACpC,WAAW,CAAC,8BAA8B,CAAC;SAC3C,MAAM,CAAC,CAAC,YAAoB,EAAE,OAAgB,EAAE,EAAE;QACjD,MAAM,YAAY,GAAG,OAAO,IAAI,QAAQ,CAAC;QAEzC,OAAO,CAAC,GAAG,CACT,cAAc,YAAY,0BAA0B,YAAY,EAAE,CACnE,CAAC;IACJ,CAAC,CAAC,CAAC;IAEL,QAAQ;SACL,OAAO,CAAC,MAAM,CAAC;SACf,WAAW,CAAC,8BAA8B,CAAC;SAC3C,MAAM,CAAC,GAAG,EAAE;QACX,OAAO,CAAC,GAAG,CAAC,6BAA6B,CAAC,CAAC;IAC7C,CAAC,CAAC,CAAC;IAEL,QAAQ;SACL,OAAO,CAAC,0BAA0B,CAAC;SACnC,WAAW,CAAC,wCAAwC,CAAC;SACrD,MAAM,CAAC,CAAC,YAAoB,EAAE,EAAE;QAC/B,OAAO,CAAC,GAAG,CAAC,kCAAkC,YAAY,EAAE,CAAC,CAAC;IAChE,CAAC,CAAC,CAAC;AACP,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"install.d.ts","sourceRoot":"","sources":["../../src/commands/install.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAezC,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAwD9D"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { execSync } from "node:child_process";
|
|
2
|
+
import { ensureClyglHome, readInstalledPlugins, resolvePluginPackageName, } from "../plugins/config.js";
|
|
3
|
+
import { readBundledPluginNames } from "../plugins/discover.js";
|
|
4
|
+
function runNpm(args) {
|
|
5
|
+
execSync(`npm ${args.join(" ")}`, {
|
|
6
|
+
stdio: "inherit",
|
|
7
|
+
env: process.env,
|
|
8
|
+
});
|
|
9
|
+
}
|
|
10
|
+
export function registerInstallCommands(program) {
|
|
11
|
+
const plugins = program
|
|
12
|
+
.command("plugins")
|
|
13
|
+
.description("Manage clygl plugins");
|
|
14
|
+
plugins
|
|
15
|
+
.command("list")
|
|
16
|
+
.description("List installed plugins")
|
|
17
|
+
.action(() => {
|
|
18
|
+
ensureClyglHome();
|
|
19
|
+
const bundled = readBundledPluginNames();
|
|
20
|
+
const installed = readInstalledPlugins();
|
|
21
|
+
if (bundled.length > 0) {
|
|
22
|
+
console.log("Bundled with clygl (default):");
|
|
23
|
+
for (const plugin of bundled) {
|
|
24
|
+
console.log(`- ${plugin}`);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
if (installed.length === 0) {
|
|
28
|
+
console.log("No extra plugins in ~/.clygl.");
|
|
29
|
+
console.log("Install optional plugins: clygl install generate | hello");
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
console.log("Installed in ~/.clygl:");
|
|
33
|
+
for (const plugin of installed) {
|
|
34
|
+
console.log(`- ${plugin}`);
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
program
|
|
38
|
+
.command("install <package>")
|
|
39
|
+
.description("Install a clygl plugin package")
|
|
40
|
+
.action((input) => {
|
|
41
|
+
const clyglHome = ensureClyglHome();
|
|
42
|
+
const packageName = resolvePluginPackageName(input);
|
|
43
|
+
console.log(`Installing plugin: ${packageName}`);
|
|
44
|
+
runNpm(["install", packageName, "--prefix", clyglHome]);
|
|
45
|
+
console.log(`Installed ${packageName}`);
|
|
46
|
+
console.log("Run `clygl --help` to see newly available commands.");
|
|
47
|
+
});
|
|
48
|
+
program
|
|
49
|
+
.command("uninstall <package>")
|
|
50
|
+
.description("Uninstall a clygl plugin package")
|
|
51
|
+
.action((input) => {
|
|
52
|
+
const clyglHome = ensureClyglHome();
|
|
53
|
+
const packageName = resolvePluginPackageName(input);
|
|
54
|
+
console.log(`Uninstalling plugin: ${packageName}`);
|
|
55
|
+
runNpm(["uninstall", packageName, "--prefix", clyglHome]);
|
|
56
|
+
console.log(`Uninstalled ${packageName}`);
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
//# sourceMappingURL=install.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"install.js","sourceRoot":"","sources":["../../src/commands/install.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAE9C,OAAO,EACL,eAAe,EACf,oBAAoB,EACpB,wBAAwB,GACzB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AAEhE,SAAS,MAAM,CAAC,IAAc;IAC5B,QAAQ,CAAC,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,EAAE;QAChC,KAAK,EAAE,SAAS;QAChB,GAAG,EAAE,OAAO,CAAC,GAAG;KACjB,CAAC,CAAC;AACL,CAAC;AAED,MAAM,UAAU,uBAAuB,CAAC,OAAgB;IACtD,MAAM,OAAO,GAAG,OAAO;SACpB,OAAO,CAAC,SAAS,CAAC;SAClB,WAAW,CAAC,sBAAsB,CAAC,CAAC;IAEvC,OAAO;SACJ,OAAO,CAAC,MAAM,CAAC;SACf,WAAW,CAAC,wBAAwB,CAAC;SACrC,MAAM,CAAC,GAAG,EAAE;QACX,eAAe,EAAE,CAAC;QAClB,MAAM,OAAO,GAAG,sBAAsB,EAAE,CAAC;QACzC,MAAM,SAAS,GAAG,oBAAoB,EAAE,CAAC;QAEzC,IAAI,OAAO,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YACvB,OAAO,CAAC,GAAG,CAAC,+BAA+B,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,CAAC,CAAC;QAEpD,OAAO,CAAC,GAAG,CAAC,wBAAwB,WAAW,EAAE,CAAC,CAAC;QACnD,MAAM,CAAC,CAAC,WAAW,EAAE,WAAW,EAAE,UAAU,EAAE,SAAS,CAAC,CAAC,CAAC;QAC1D,OAAO,CAAC,GAAG,CAAC,eAAe,WAAW,EAAE,CAAC,CAAC;IAC5C,CAAC,CAAC,CAAC;AACP,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":""}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { Command } from "commander";
|
|
3
|
+
import { registerInstallCommands } from "./commands/install.js";
|
|
4
|
+
import { loadPlugins } from "./plugins/loader.js";
|
|
5
|
+
const program = new Command();
|
|
6
|
+
program
|
|
7
|
+
.name("clygl")
|
|
8
|
+
.description("A modular CLI dev tool")
|
|
9
|
+
.version("1.0.0");
|
|
10
|
+
registerInstallCommands(program);
|
|
11
|
+
const loadedPlugins = await loadPlugins(program);
|
|
12
|
+
if (process.env.CLYGL_DEBUG_PLUGINS === "1") {
|
|
13
|
+
console.error(loadedPlugins.length > 0
|
|
14
|
+
? `Loaded plugins: ${loadedPlugins.join(", ")}`
|
|
15
|
+
: "No plugins loaded.");
|
|
16
|
+
}
|
|
17
|
+
program.parse(process.argv);
|
|
18
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,uBAAuB,EAAE,MAAM,uBAAuB,CAAC;AAChE,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAElD,MAAM,OAAO,GAAG,IAAI,OAAO,EAAE,CAAC;AAE9B,OAAO;KACJ,IAAI,CAAC,OAAO,CAAC;KACb,WAAW,CAAC,wBAAwB,CAAC;KACrC,OAAO,CAAC,OAAO,CAAC,CAAC;AAEpB,uBAAuB,CAAC,OAAO,CAAC,CAAC;AAEjC,MAAM,aAAa,GAAG,MAAM,WAAW,CAAC,OAAO,CAAC,CAAC;AAEjD,IAAI,OAAO,CAAC,GAAG,CAAC,mBAAmB,KAAK,GAAG,EAAE,CAAC;IAC5C,OAAO,CAAC,KAAK,CACX,aAAa,CAAC,MAAM,GAAG,CAAC;QACtB,CAAC,CAAC,mBAAmB,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE;QAC/C,CAAC,CAAC,oBAAoB,CACzB,CAAC;AACJ,CAAC;AAED,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/plugins/config.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,UAAU,QAA4B,CAAC;AAEpD,wBAAgB,eAAe,IAAI,MAAM,CAexC;AAED,wBAAgB,wBAAwB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAU9D;AAED,wBAAgB,oBAAoB,IAAI,MAAM,EAAE,CAY/C"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
|
|
2
|
+
import { homedir } from "node:os";
|
|
3
|
+
import { join } from "node:path";
|
|
4
|
+
export const CLYGL_HOME = join(homedir(), ".clygl");
|
|
5
|
+
export function ensureClyglHome() {
|
|
6
|
+
if (!existsSync(CLYGL_HOME)) {
|
|
7
|
+
mkdirSync(CLYGL_HOME, { recursive: true });
|
|
8
|
+
}
|
|
9
|
+
const manifestPath = join(CLYGL_HOME, "package.json");
|
|
10
|
+
if (!existsSync(manifestPath)) {
|
|
11
|
+
writeFileSync(manifestPath, JSON.stringify({ name: "clygl-plugins", private: true }, null, 2));
|
|
12
|
+
}
|
|
13
|
+
return CLYGL_HOME;
|
|
14
|
+
}
|
|
15
|
+
export function resolvePluginPackageName(input) {
|
|
16
|
+
if (input.startsWith(".") || input.startsWith("/") || input.includes(":\\")) {
|
|
17
|
+
return input;
|
|
18
|
+
}
|
|
19
|
+
if (input.startsWith("@")) {
|
|
20
|
+
return input;
|
|
21
|
+
}
|
|
22
|
+
return `@clygl/plugin-${input}`;
|
|
23
|
+
}
|
|
24
|
+
export function readInstalledPlugins() {
|
|
25
|
+
const manifestPath = join(CLYGL_HOME, "package.json");
|
|
26
|
+
if (!existsSync(manifestPath)) {
|
|
27
|
+
return [];
|
|
28
|
+
}
|
|
29
|
+
const manifest = JSON.parse(readFileSync(manifestPath, "utf8"));
|
|
30
|
+
return Object.keys(manifest.dependencies ?? {}).sort();
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../src/plugins/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAC7E,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,MAAM,CAAC,MAAM,UAAU,GAAG,IAAI,CAAC,OAAO,EAAE,EAAE,QAAQ,CAAC,CAAC;AAEpD,MAAM,UAAU,eAAe;IAC7B,IAAI,CAAC,UAAU,CAAC,UAAU,CAAC,EAAE,CAAC;QAC5B,SAAS,CAAC,UAAU,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IAC7C,CAAC;IAED,MAAM,YAAY,GAAG,IAAI,CAAC,UAAU,EAAE,cAAc,CAAC,CAAC;IAEtD,IAAI,CAAC,UAAU,CAAC,YAAY,CAAC,EAAE,CAAC;QAC9B,aAAa,CACX,YAAY,EACZ,IAAI,CAAC,SAAS,CAAC,EAAE,IAAI,EAAE,eAAe,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC,CAClE,CAAC;IACJ,CAAC;IAED,OAAO,UAAU,CAAC;AACpB,CAAC;AAED,MAAM,UAAU,wBAAwB,CAAC,KAAa;IACpD,IAAI,KAAK,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,KAAK,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC;QAC5E,OAAO,KAAK,CAAC;IACf,CAAC;IAED,IAAI,KAAK,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC;QAC1B,OAAO,KAAK,CAAC;IACf,CAAC;IAED,OAAO,iBAAiB,KAAK,EAAE,CAAC;AAClC,CAAC;AAED,MAAM,UAAU,oBAAoB;IAClC,MAAM,YAAY,GAAG,IAAI,CAAC,UAAU,EAAE,cAAc,CAAC,CAAC;IAEtD,IAAI,CAAC,UAAU,CAAC,YAAY,CAAC,EAAE,CAAC;QAC9B,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,MAAM,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,YAAY,EAAE,MAAM,CAAC,CAE7D,CAAC;IAEF,OAAO,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,YAAY,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC;AACzD,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { ClyglPluginManifest } from "../types/plugin.js";
|
|
2
|
+
export declare function getBundledPluginsDir(): string;
|
|
3
|
+
export declare function readPackageManifest(packageDir: string): ClyglPluginManifest | null;
|
|
4
|
+
export declare function collectPluginDirs(modulesDir: string): string[];
|
|
5
|
+
export declare function readBundledPluginNames(): string[];
|
|
6
|
+
//# sourceMappingURL=discover.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"discover.d.ts","sourceRoot":"","sources":["../../src/plugins/discover.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAE9D,wBAAgB,oBAAoB,IAAI,MAAM,CAE7C;AAED,wBAAgB,mBAAmB,CACjC,UAAU,EAAE,MAAM,GACjB,mBAAmB,GAAG,IAAI,CAQ5B;AAED,wBAAgB,iBAAiB,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,EAAE,CA8B9D;AAED,wBAAgB,sBAAsB,IAAI,MAAM,EAAE,CAKjD"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { existsSync, readdirSync, readFileSync } from "node:fs";
|
|
2
|
+
import { dirname, join } from "node:path";
|
|
3
|
+
import { fileURLToPath } from "node:url";
|
|
4
|
+
export function getBundledPluginsDir() {
|
|
5
|
+
return join(dirname(fileURLToPath(import.meta.url)), "..", "..", "bundled-plugins");
|
|
6
|
+
}
|
|
7
|
+
export function readPackageManifest(packageDir) {
|
|
8
|
+
const manifestPath = join(packageDir, "package.json");
|
|
9
|
+
if (!existsSync(manifestPath)) {
|
|
10
|
+
return null;
|
|
11
|
+
}
|
|
12
|
+
return JSON.parse(readFileSync(manifestPath, "utf8"));
|
|
13
|
+
}
|
|
14
|
+
export function collectPluginDirs(modulesDir) {
|
|
15
|
+
if (!existsSync(modulesDir)) {
|
|
16
|
+
return [];
|
|
17
|
+
}
|
|
18
|
+
const pluginDirs = [];
|
|
19
|
+
for (const entry of readdirSync(modulesDir, { withFileTypes: true })) {
|
|
20
|
+
if (entry.name.startsWith(".")) {
|
|
21
|
+
continue;
|
|
22
|
+
}
|
|
23
|
+
if (entry.name.startsWith("@")) {
|
|
24
|
+
const scopeDir = join(modulesDir, entry.name);
|
|
25
|
+
for (const scopedEntry of readdirSync(scopeDir, { withFileTypes: true })) {
|
|
26
|
+
if (scopedEntry.isDirectory() || scopedEntry.isSymbolicLink()) {
|
|
27
|
+
pluginDirs.push(join(scopeDir, scopedEntry.name));
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
continue;
|
|
31
|
+
}
|
|
32
|
+
if (entry.isDirectory() || entry.isSymbolicLink()) {
|
|
33
|
+
pluginDirs.push(join(modulesDir, entry.name));
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
return pluginDirs;
|
|
37
|
+
}
|
|
38
|
+
export function readBundledPluginNames() {
|
|
39
|
+
return collectPluginDirs(getBundledPluginsDir())
|
|
40
|
+
.map((dir) => readPackageManifest(dir)?.name)
|
|
41
|
+
.filter((name) => Boolean(name))
|
|
42
|
+
.sort();
|
|
43
|
+
}
|
|
44
|
+
//# sourceMappingURL=discover.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"discover.js","sourceRoot":"","sources":["../../src/plugins/discover.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAChE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAGzC,MAAM,UAAU,oBAAoB;IAClC,OAAO,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,iBAAiB,CAAC,CAAC;AACtF,CAAC;AAED,MAAM,UAAU,mBAAmB,CACjC,UAAkB;IAElB,MAAM,YAAY,GAAG,IAAI,CAAC,UAAU,EAAE,cAAc,CAAC,CAAC;IAEtD,IAAI,CAAC,UAAU,CAAC,YAAY,CAAC,EAAE,CAAC;QAC9B,OAAO,IAAI,CAAC;IACd,CAAC;IAED,OAAO,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,YAAY,EAAE,MAAM,CAAC,CAAwB,CAAC;AAC/E,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AAC;SAC5C,MAAM,CAAC,CAAC,IAAI,EAAkB,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;SAC/C,IAAI,EAAE,CAAC;AACZ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"loader.d.ts","sourceRoot":"","sources":["../../src/plugins/loader.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAyCzC,wBAAsB,WAAW,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAsBrE"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { existsSync } from "node:fs";
|
|
2
|
+
import { join } from "node:path";
|
|
3
|
+
import { pathToFileURL } from "node:url";
|
|
4
|
+
import { CLYGL_HOME, ensureClyglHome } from "./config.js";
|
|
5
|
+
import { collectPluginDirs, getBundledPluginsDir, readPackageManifest, } from "./discover.js";
|
|
6
|
+
async function loadPlugin(program, packageDir) {
|
|
7
|
+
const manifest = readPackageManifest(packageDir);
|
|
8
|
+
if (!manifest?.clyglPlugin) {
|
|
9
|
+
return null;
|
|
10
|
+
}
|
|
11
|
+
const entryFile = join(packageDir, manifest.main ?? "index.js");
|
|
12
|
+
if (!existsSync(entryFile)) {
|
|
13
|
+
throw new Error(`Plugin "${manifest.name}" is missing entry file: ${entryFile}`);
|
|
14
|
+
}
|
|
15
|
+
const pluginModule = (await import(pathToFileURL(entryFile).href));
|
|
16
|
+
if (typeof pluginModule.register !== "function") {
|
|
17
|
+
throw new Error(`Plugin "${manifest.name}" must export a register(program) function`);
|
|
18
|
+
}
|
|
19
|
+
pluginModule.register(program);
|
|
20
|
+
return manifest.name;
|
|
21
|
+
}
|
|
22
|
+
export async function loadPlugins(program) {
|
|
23
|
+
ensureClyglHome();
|
|
24
|
+
const userModulesDir = join(CLYGL_HOME, "node_modules");
|
|
25
|
+
const pluginDirs = [
|
|
26
|
+
...collectPluginDirs(getBundledPluginsDir()),
|
|
27
|
+
...collectPluginDirs(userModulesDir),
|
|
28
|
+
];
|
|
29
|
+
const loadedPlugins = [];
|
|
30
|
+
const seen = new Set();
|
|
31
|
+
for (const packageDir of pluginDirs) {
|
|
32
|
+
const pluginName = await loadPlugin(program, packageDir);
|
|
33
|
+
if (pluginName && !seen.has(pluginName)) {
|
|
34
|
+
seen.add(pluginName);
|
|
35
|
+
loadedPlugins.push(pluginName);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
return loadedPlugins;
|
|
39
|
+
}
|
|
40
|
+
//# sourceMappingURL=loader.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"loader.js","sourceRoot":"","sources":["../../src/plugins/loader.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEzC,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAC1D,OAAO,EACL,iBAAiB,EACjB,oBAAoB,EACpB,mBAAmB,GACpB,MAAM,eAAe,CAAC;AAGvB,KAAK,UAAU,UAAU,CACvB,OAAgB,EAChB,UAAkB;IAElB,MAAM,QAAQ,GAAG,mBAAmB,CAAC,UAAU,CAAC,CAAC;IAEjD,IAAI,CAAC,QAAQ,EAAE,WAAW,EAAE,CAAC;QAC3B,OAAO,IAAI,CAAC;IACd,CAAC;IAED,MAAM,SAAS,GAAG,IAAI,CAAC,UAAU,EAAE,QAAQ,CAAC,IAAI,IAAI,UAAU,CAAC,CAAC;IAEhE,IAAI,CAAC,UAAU,CAAC,SAAS,CAAC,EAAE,CAAC;QAC3B,MAAM,IAAI,KAAK,CACb,WAAW,QAAQ,CAAC,IAAI,4BAA4B,SAAS,EAAE,CAChE,CAAC;IACJ,CAAC;IAED,MAAM,YAAY,GAAG,CAAC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E,OAAO,CAAC;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,MAAM,MAAM,mBAAmB,GAAG,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin.js","sourceRoot":"","sources":["../../src/types/plugin.ts"],"names":[],"mappings":""}
|
package/package.json
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "clygl",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "A TypeScript Node.js CLI dev tool",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"bin": {
|
|
7
|
+
"clygl": "dist/index.js"
|
|
8
|
+
},
|
|
9
|
+
"files": [
|
|
10
|
+
"dist",
|
|
11
|
+
"bundled-plugins"
|
|
12
|
+
],
|
|
13
|
+
"scripts": {
|
|
14
|
+
"build": "tsc && node scripts/bundle-default-plugins.mjs",
|
|
15
|
+
"build:cli": "tsc",
|
|
16
|
+
"build:plugins": "node scripts/bundle-default-plugins.mjs",
|
|
17
|
+
"dev": "tsx watch src/index.ts",
|
|
18
|
+
"start": "node dist/index.js",
|
|
19
|
+
"typecheck": "tsc --noEmit",
|
|
20
|
+
"prepublishOnly": "npm run build"
|
|
21
|
+
},
|
|
22
|
+
"keywords": ["cli", "devtools", "plugins"],
|
|
23
|
+
"author": "Mohamad Taufik",
|
|
24
|
+
"license": "ISC",
|
|
25
|
+
"repository": {
|
|
26
|
+
"type": "git",
|
|
27
|
+
"url": "https://github.com/Charlilyyyy/clygl.git"
|
|
28
|
+
},
|
|
29
|
+
"homepage": "https://github.com/Charlilyyyy/clygl#readme",
|
|
30
|
+
"type": "module",
|
|
31
|
+
"devDependencies": {
|
|
32
|
+
"@types/node": "^25.9.1",
|
|
33
|
+
"tsx": "^4.21.0",
|
|
34
|
+
"typescript": "^6.0.3"
|
|
35
|
+
},
|
|
36
|
+
"dependencies": {
|
|
37
|
+
"commander": "^15.0.0"
|
|
38
|
+
}
|
|
39
|
+
}
|