@dinyangetoh/codeplug-cli 0.1.2 → 0.1.3
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/dist/cli/index.js +66 -66
- package/dist/cli/index.js.map +1 -1
- package/package.json +3 -2
package/dist/cli/index.js
CHANGED
|
@@ -1,113 +1,113 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { Command } from
|
|
2
|
+
import { Command } from "commander";
|
|
3
3
|
const program = new Command();
|
|
4
4
|
program
|
|
5
|
-
.name(
|
|
6
|
-
.description(
|
|
7
|
-
.version(
|
|
5
|
+
.name("codeplug")
|
|
6
|
+
.description("The source of truth for codebase understanding & governance")
|
|
7
|
+
.version("0.1.3");
|
|
8
8
|
program
|
|
9
|
-
.command(
|
|
10
|
-
.description(
|
|
11
|
-
.addCommand(new Command(
|
|
12
|
-
.description(
|
|
13
|
-
.option(
|
|
9
|
+
.command("convention")
|
|
10
|
+
.description("Convention discovery, detection, and enforcement")
|
|
11
|
+
.addCommand(new Command("init")
|
|
12
|
+
.description("Detect and confirm coding conventions in the current project")
|
|
13
|
+
.option("--force", "Re-run detection, overwrite existing conventions")
|
|
14
14
|
.action(async (options) => {
|
|
15
|
-
const { handleConventionInit } = await import(
|
|
15
|
+
const { handleConventionInit } = await import("./commands/convention.js");
|
|
16
16
|
await handleConventionInit(options);
|
|
17
17
|
}))
|
|
18
|
-
.addCommand(new Command(
|
|
19
|
-
.description(
|
|
20
|
-
.option(
|
|
21
|
-
.option(
|
|
18
|
+
.addCommand(new Command("audit")
|
|
19
|
+
.description("Run a full compliance report against stored conventions")
|
|
20
|
+
.option("--since <duration>", "Only audit changes in the given time window (e.g. 7d)")
|
|
21
|
+
.option("--ci", "Exit with non-zero code if thresholds are breached")
|
|
22
22
|
.action(async (options) => {
|
|
23
|
-
const { handleConventionAudit } = await import(
|
|
23
|
+
const { handleConventionAudit } = await import("./commands/convention.js");
|
|
24
24
|
await handleConventionAudit(options);
|
|
25
25
|
}))
|
|
26
|
-
.addCommand(new Command(
|
|
27
|
-
.description(
|
|
26
|
+
.addCommand(new Command("drift")
|
|
27
|
+
.description("Check most recent commits for convention drift")
|
|
28
28
|
.action(async () => {
|
|
29
|
-
const { handleConventionDrift } = await import(
|
|
29
|
+
const { handleConventionDrift } = await import("./commands/convention.js");
|
|
30
30
|
await handleConventionDrift();
|
|
31
31
|
}))
|
|
32
|
-
.addCommand(new Command(
|
|
33
|
-
.description(
|
|
34
|
-
.option(
|
|
32
|
+
.addCommand(new Command("score")
|
|
33
|
+
.description("Show current compliance score")
|
|
34
|
+
.option("--trend", "Show score history and trend chart")
|
|
35
35
|
.action(async (options) => {
|
|
36
|
-
const { handleConventionScore } = await import(
|
|
36
|
+
const { handleConventionScore } = await import("./commands/convention.js");
|
|
37
37
|
await handleConventionScore(options);
|
|
38
38
|
}))
|
|
39
|
-
.addCommand(new Command(
|
|
40
|
-
.description(
|
|
41
|
-
.option(
|
|
42
|
-
.option(
|
|
39
|
+
.addCommand(new Command("fix")
|
|
40
|
+
.description("Apply auto-fixes for convention violations")
|
|
41
|
+
.option("--auto", "Apply all safe auto-fixes")
|
|
42
|
+
.option("--id <id>", "Fix a specific finding by ID")
|
|
43
43
|
.action(async (options) => {
|
|
44
|
-
const { handleConventionFix } = await import(
|
|
44
|
+
const { handleConventionFix } = await import("./commands/convention.js");
|
|
45
45
|
await handleConventionFix(options);
|
|
46
46
|
}))
|
|
47
|
-
.addCommand(new Command(
|
|
48
|
-
.description(
|
|
49
|
-
.argument(
|
|
47
|
+
.addCommand(new Command("show")
|
|
48
|
+
.description("Explain findings for a specific commit")
|
|
49
|
+
.argument("<commit>", "Commit hash to inspect")
|
|
50
50
|
.action(async (commit) => {
|
|
51
|
-
const { handleConventionShow } = await import(
|
|
51
|
+
const { handleConventionShow } = await import("./commands/convention.js");
|
|
52
52
|
await handleConventionShow(commit);
|
|
53
53
|
}));
|
|
54
54
|
program
|
|
55
|
-
.command(
|
|
56
|
-
.description(
|
|
57
|
-
.addCommand(new Command(
|
|
58
|
-
.description(
|
|
59
|
-
.option(
|
|
60
|
-
.option(
|
|
61
|
-
.option(
|
|
55
|
+
.command("docs")
|
|
56
|
+
.description("Generate and maintain living documentation")
|
|
57
|
+
.addCommand(new Command("generate")
|
|
58
|
+
.description("Generate documentation from code analysis")
|
|
59
|
+
.option("--doc <name>", "Specific document to generate (e.g. ARCHITECTURE)")
|
|
60
|
+
.option("--audience <level>", "Tune language level (e.g. junior, senior)", "senior")
|
|
61
|
+
.option("--style <style>", "Output style (concise, detailed)", "detailed")
|
|
62
62
|
.action(async (options) => {
|
|
63
|
-
const { handleDocsGenerate } = await import(
|
|
63
|
+
const { handleDocsGenerate } = await import("./commands/docs.js");
|
|
64
64
|
await handleDocsGenerate(options);
|
|
65
65
|
}))
|
|
66
|
-
.addCommand(new Command(
|
|
67
|
-
.description(
|
|
66
|
+
.addCommand(new Command("status")
|
|
67
|
+
.description("Check which generated docs are stale")
|
|
68
68
|
.action(async () => {
|
|
69
|
-
const { handleDocsStatus } = await import(
|
|
69
|
+
const { handleDocsStatus } = await import("./commands/docs.js");
|
|
70
70
|
await handleDocsStatus();
|
|
71
71
|
}))
|
|
72
|
-
.addCommand(new Command(
|
|
73
|
-
.description(
|
|
72
|
+
.addCommand(new Command("update")
|
|
73
|
+
.description("Regenerate only stale document sections")
|
|
74
74
|
.action(async () => {
|
|
75
|
-
const { handleDocsUpdate } = await import(
|
|
75
|
+
const { handleDocsUpdate } = await import("./commands/docs.js");
|
|
76
76
|
await handleDocsUpdate();
|
|
77
77
|
}));
|
|
78
78
|
program
|
|
79
|
-
.command(
|
|
80
|
-
.description(
|
|
81
|
-
.option(
|
|
82
|
-
.option(
|
|
83
|
-
.option(
|
|
84
|
-
.option(
|
|
79
|
+
.command("export")
|
|
80
|
+
.description("Export conventions and context for AI agents and CI")
|
|
81
|
+
.option("--target <target>", "Export target (claude, cursor, copilot)")
|
|
82
|
+
.option("--format <format>", "Export format (json)")
|
|
83
|
+
.option("--all", "Export all targets")
|
|
84
|
+
.option("--check", "Verify exports are up to date")
|
|
85
85
|
.action(async (options) => {
|
|
86
|
-
const { handleExport } = await import(
|
|
86
|
+
const { handleExport } = await import("./commands/export.js");
|
|
87
87
|
await handleExport(options);
|
|
88
88
|
});
|
|
89
89
|
program
|
|
90
|
-
.command(
|
|
91
|
-
.description(
|
|
92
|
-
.addCommand(new Command(
|
|
93
|
-
.description(
|
|
94
|
-
.argument(
|
|
95
|
-
.argument(
|
|
90
|
+
.command("config")
|
|
91
|
+
.description("Manage CodePlug configuration")
|
|
92
|
+
.addCommand(new Command("set")
|
|
93
|
+
.description("Set a configuration value")
|
|
94
|
+
.argument("<key>", "Configuration key (e.g. llm.provider, models.tier)")
|
|
95
|
+
.argument("<value>", "Configuration value")
|
|
96
96
|
.action(async (key, value) => {
|
|
97
|
-
const { handleConfigSet } = await import(
|
|
97
|
+
const { handleConfigSet } = await import("./commands/config.js");
|
|
98
98
|
await handleConfigSet(key, value);
|
|
99
99
|
}))
|
|
100
|
-
.addCommand(new Command(
|
|
101
|
-
.description(
|
|
102
|
-
.argument(
|
|
100
|
+
.addCommand(new Command("get")
|
|
101
|
+
.description("Get a configuration value")
|
|
102
|
+
.argument("<key>", "Configuration key")
|
|
103
103
|
.action(async (key) => {
|
|
104
|
-
const { handleConfigGet } = await import(
|
|
104
|
+
const { handleConfigGet } = await import("./commands/config.js");
|
|
105
105
|
await handleConfigGet(key);
|
|
106
106
|
}))
|
|
107
|
-
.addCommand(new Command(
|
|
108
|
-
.description(
|
|
107
|
+
.addCommand(new Command("list")
|
|
108
|
+
.description("List all configuration values")
|
|
109
109
|
.action(async () => {
|
|
110
|
-
const { handleConfigList } = await import(
|
|
110
|
+
const { handleConfigList } = await import("./commands/config.js");
|
|
111
111
|
await handleConfigList();
|
|
112
112
|
}));
|
|
113
113
|
program.parse();
|
package/dist/cli/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/cli/index.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,MAAM,OAAO,GAAG,IAAI,OAAO,EAAE,CAAC;AAE9B,OAAO;KACJ,IAAI,CAAC,UAAU,CAAC;KAChB,WAAW,CAAC,6DAA6D,CAAC;KAC1E,OAAO,CAAC,OAAO,CAAC,CAAC;AAEpB,OAAO;KACJ,OAAO,CAAC,YAAY,CAAC;KACrB,WAAW,CAAC,kDAAkD,CAAC;KAC/D,UAAU,CACT,IAAI,OAAO,CAAC,MAAM,CAAC;KAChB,WAAW,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/cli/index.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,MAAM,OAAO,GAAG,IAAI,OAAO,EAAE,CAAC;AAE9B,OAAO;KACJ,IAAI,CAAC,UAAU,CAAC;KAChB,WAAW,CAAC,6DAA6D,CAAC;KAC1E,OAAO,CAAC,OAAO,CAAC,CAAC;AAEpB,OAAO;KACJ,OAAO,CAAC,YAAY,CAAC;KACrB,WAAW,CAAC,kDAAkD,CAAC;KAC/D,UAAU,CACT,IAAI,OAAO,CAAC,MAAM,CAAC;KAChB,WAAW,CACV,8DAA8D,CAC/D;KACA,MAAM,CAAC,SAAS,EAAE,kDAAkD,CAAC;KACrE,MAAM,CAAC,KAAK,EAAE,OAAO,EAAE,EAAE;IACxB,MAAM,EAAE,oBAAoB,EAAE,GAC5B,MAAM,MAAM,CAAC,0BAA0B,CAAC,CAAC;IAC3C,MAAM,oBAAoB,CAAC,OAAO,CAAC,CAAC;AACtC,CAAC,CAAC,CACL;KACA,UAAU,CACT,IAAI,OAAO,CAAC,OAAO,CAAC;KACjB,WAAW,CAAC,yDAAyD,CAAC;KACtE,MAAM,CACL,oBAAoB,EACpB,uDAAuD,CACxD;KACA,MAAM,CAAC,MAAM,EAAE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CACL;KACA,UAAU,CACT,IAAI,OAAO,CAAC,MAAM,CAAC;KAChB,WAAW,CAAC,+BAA+B,CAAC;KAC5C,MAAM,CAAC,KAAK,IAAI,EAAE;IACjB,MAAM,EAAE,gBAAgB,EAAE,GAAG,MAAM,MAAM,CAAC,sBAAsB,CAAC,CAAC;IAClE,MAAM,gBAAgB,EAAE,CAAC;AAC3B,CAAC,CAAC,CACL,CAAC;AAEJ,OAAO,CAAC,KAAK,EAAE,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dinyangetoh/codeplug-cli",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.3",
|
|
4
4
|
"description": "The source of truth for codebase understanding & governance",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/cli/index.js",
|
|
@@ -71,5 +71,6 @@
|
|
|
71
71
|
"eslint": "^9.20.0",
|
|
72
72
|
"@eslint/js": "^9.20.0",
|
|
73
73
|
"typescript-eslint": "^8.24.1"
|
|
74
|
-
}
|
|
74
|
+
},
|
|
75
|
+
"packageManager": "yarn@1.22.22+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e"
|
|
75
76
|
}
|