@htekdev/actions-debugger 1.0.25 → 1.0.27
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 +45 -4
- package/dist/cli/commands/categories.d.ts +6 -0
- package/dist/cli/commands/categories.d.ts.map +1 -0
- package/dist/cli/commands/categories.js +26 -0
- package/dist/cli/commands/categories.js.map +1 -0
- package/dist/cli/commands/diagnose.d.ts +6 -0
- package/dist/cli/commands/diagnose.d.ts.map +1 -0
- package/dist/cli/commands/diagnose.js +56 -0
- package/dist/cli/commands/diagnose.js.map +1 -0
- package/dist/cli/commands/lookup.d.ts +6 -0
- package/dist/cli/commands/lookup.d.ts.map +1 -0
- package/dist/cli/commands/lookup.js +27 -0
- package/dist/cli/commands/lookup.js.map +1 -0
- package/dist/cli/commands/search.d.ts +6 -0
- package/dist/cli/commands/search.d.ts.map +1 -0
- package/dist/cli/commands/search.js +33 -0
- package/dist/cli/commands/search.js.map +1 -0
- package/dist/cli/commands/suggest.d.ts +6 -0
- package/dist/cli/commands/suggest.d.ts.map +1 -0
- package/dist/cli/commands/suggest.js +27 -0
- package/dist/cli/commands/suggest.js.map +1 -0
- package/dist/cli/main.d.ts +5 -0
- package/dist/cli/main.d.ts.map +1 -0
- package/dist/cli/main.js +20 -0
- package/dist/cli/main.js.map +1 -0
- package/dist/cli/output.d.ts +17 -0
- package/dist/cli/output.d.ts.map +1 -0
- package/dist/cli/output.js +311 -0
- package/dist/cli/output.js.map +1 -0
- package/dist/entry.d.ts +12 -0
- package/dist/entry.d.ts.map +1 -0
- package/dist/entry.js +30 -0
- package/dist/entry.js.map +1 -0
- package/dist/index.d.ts +4 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -30
- package/dist/index.js.map +1 -1
- package/dist/mcp.d.ts +11 -0
- package/dist/mcp.d.ts.map +1 -0
- package/dist/mcp.js +25 -0
- package/dist/mcp.js.map +1 -0
- package/errors/runner-environment/macos-dotnet-root-env-var-removed.yml +90 -0
- package/errors/runner-environment/powershell-76-dotnet10-httpclient-breaking-changes.yml +109 -0
- package/errors/runner-environment/ubuntu-24-04-chrome-148-webdriverio-hang.yml +91 -0
- package/errors/runner-environment/ubuntu-24-04-kernel-read-ahead-kb-io-thrashing.yml +94 -0
- package/package.json +11 -6
package/README.md
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
[](https://www.npmjs.com/package/@htekdev/actions-debugger)
|
|
5
5
|
[](https://opensource.org/licenses/MIT)
|
|
6
6
|
|
|
7
|
-
> 65+ real GitHub Actions errors, queryable by agents. MCP server + Copilot skills + error database.
|
|
7
|
+
> 65+ real GitHub Actions errors, queryable by agents. CLI + MCP server + Copilot skills + error database.
|
|
8
8
|
|
|
9
9
|
**Stop debugging the same CI failures over and over.** This repo packages 65+ real-world GitHub Actions error scenarios — with regex-matchable patterns, root causes, and copy-paste fixes — into formats that both humans and AI agents can consume.
|
|
10
10
|
|
|
@@ -12,13 +12,54 @@
|
|
|
12
12
|
|
|
13
13
|
```
|
|
14
14
|
errors/ → Structured YAML error database (65+ entries)
|
|
15
|
-
src/ → MCP server (TypeScript
|
|
15
|
+
src/ → CLI + MCP server (TypeScript)
|
|
16
16
|
.github/skills/ → Copilot CLI skills for CI debugging
|
|
17
17
|
.github/agents/ → Copilot agent definition
|
|
18
18
|
```
|
|
19
19
|
|
|
20
20
|
## Quick Start
|
|
21
21
|
|
|
22
|
+
### CLI (Zero Install)
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
# Look up an error
|
|
26
|
+
npx @htekdev/actions-debugger lookup "Permission to org/repo.git denied"
|
|
27
|
+
|
|
28
|
+
# Search by keyword
|
|
29
|
+
npx @htekdev/actions-debugger search "OIDC" --category permissions-auth
|
|
30
|
+
|
|
31
|
+
# Diagnose a workflow file
|
|
32
|
+
npx @htekdev/actions-debugger diagnose .github/workflows/ci.yml
|
|
33
|
+
|
|
34
|
+
# Get fix suggestions
|
|
35
|
+
npx @htekdev/actions-debugger suggest-fix "artifact upload fails intermittently"
|
|
36
|
+
|
|
37
|
+
# List all categories
|
|
38
|
+
npx @htekdev/actions-debugger categories
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
#### Output Formats
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
# Text (default for TTY)
|
|
45
|
+
npx @htekdev/actions-debugger lookup "error message"
|
|
46
|
+
|
|
47
|
+
# JSON (default when piped, or explicit)
|
|
48
|
+
npx @htekdev/actions-debugger lookup "error message" --format json
|
|
49
|
+
|
|
50
|
+
# Markdown
|
|
51
|
+
npx @htekdev/actions-debugger lookup "error message" --format md
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
#### Exit Codes
|
|
55
|
+
|
|
56
|
+
| Code | Meaning |
|
|
57
|
+
|------|---------|
|
|
58
|
+
| 0 | Success / matches found |
|
|
59
|
+
| 1 | No matches found |
|
|
60
|
+
| 2 | Invalid input / parse error |
|
|
61
|
+
| 3 | Database load error |
|
|
62
|
+
|
|
22
63
|
### As an MCP Server (Claude Desktop, Copilot CLI, Cursor, etc.)
|
|
23
64
|
|
|
24
65
|
```bash
|
|
@@ -47,10 +88,10 @@ Add to your MCP client config:
|
|
|
47
88
|
|
|
48
89
|
### As a Copilot CLI Skill (No MCP Required)
|
|
49
90
|
|
|
50
|
-
Copy `.github/skills/actions-debugging/SKILL.md` to your repo's `.github/skills/` directory.
|
|
91
|
+
Copy `.github/skills/actions-debugging-cli/SKILL.md` to your repo's `.github/skills/` directory. Any agent with shell access can use the CLI — no MCP config needed.
|
|
51
92
|
|
|
52
93
|
```markdown
|
|
53
|
-
> **Skill reference:** For CI debugging, use the `actions-debugging` skill.
|
|
94
|
+
> **Skill reference:** For CI debugging, use the `actions-debugging-cli` skill.
|
|
54
95
|
```
|
|
55
96
|
|
|
56
97
|
### Programmatic (npm Package)
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"categories.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/categories.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAKzC,wBAAgB,yBAAyB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAiBhE"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CLI command: categories — list all error categories.
|
|
3
|
+
*/
|
|
4
|
+
import { loadErrorDatabase } from "../../db/loader.js";
|
|
5
|
+
import { listCategories } from "../../tools/list-categories.js";
|
|
6
|
+
import { detectFormat, formatCategoriesOutput } from "../output.js";
|
|
7
|
+
export function registerCategoriesCommand(program) {
|
|
8
|
+
program
|
|
9
|
+
.command("categories")
|
|
10
|
+
.description("List all error categories with counts")
|
|
11
|
+
.option("--format <fmt>", "Output format: text, json, md")
|
|
12
|
+
.action(async (opts) => {
|
|
13
|
+
try {
|
|
14
|
+
const db = await loadErrorDatabase();
|
|
15
|
+
const categories = listCategories(db);
|
|
16
|
+
const format = detectFormat(opts.format);
|
|
17
|
+
console.log(formatCategoriesOutput(categories, format));
|
|
18
|
+
process.exit(0);
|
|
19
|
+
}
|
|
20
|
+
catch (err) {
|
|
21
|
+
console.error(`Error: ${err.message}`);
|
|
22
|
+
process.exit(3);
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=categories.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"categories.js","sourceRoot":"","sources":["../../../src/cli/commands/categories.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AACvD,OAAO,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AAChE,OAAO,EAAE,YAAY,EAAE,sBAAsB,EAAE,MAAM,cAAc,CAAC;AAEpE,MAAM,UAAU,yBAAyB,CAAC,OAAgB;IACxD,OAAO;SACJ,OAAO,CAAC,YAAY,CAAC;SACrB,WAAW,CAAC,uCAAuC,CAAC;SACpD,MAAM,CAAC,gBAAgB,EAAE,+BAA+B,CAAC;SACzD,MAAM,CAAC,KAAK,EAAE,IAAyB,EAAE,EAAE;QAC1C,IAAI,CAAC;YACH,MAAM,EAAE,GAAG,MAAM,iBAAiB,EAAE,CAAC;YACrC,MAAM,UAAU,GAAG,cAAc,CAAC,EAAE,CAAC,CAAC;YACtC,MAAM,MAAM,GAAG,YAAY,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;YACzC,OAAO,CAAC,GAAG,CAAC,sBAAsB,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC,CAAC;YACxD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAClB,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,OAAO,CAAC,KAAK,CAAC,UAAW,GAAa,CAAC,OAAO,EAAE,CAAC,CAAC;YAClD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAClB,CAAC;IACH,CAAC,CAAC,CAAC;AACP,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"diagnose.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/diagnose.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAKzC,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CA+B9D"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CLI command: diagnose — analyze a workflow YAML file for common issues.
|
|
3
|
+
*/
|
|
4
|
+
import { readFileSync } from "node:fs";
|
|
5
|
+
import { loadErrorDatabase } from "../../db/loader.js";
|
|
6
|
+
import { diagnoseWorkflow } from "../../tools/diagnose-workflow.js";
|
|
7
|
+
import { detectFormat, formatDiagnoseOutput } from "../output.js";
|
|
8
|
+
export function registerDiagnoseCommand(program) {
|
|
9
|
+
program
|
|
10
|
+
.command("diagnose <file>")
|
|
11
|
+
.description("Analyze a workflow YAML file for common issues")
|
|
12
|
+
.option("--format <fmt>", "Output format: text, json, md")
|
|
13
|
+
.action(async (file, opts) => {
|
|
14
|
+
try {
|
|
15
|
+
let yaml;
|
|
16
|
+
if (file === "-") {
|
|
17
|
+
// Read from stdin
|
|
18
|
+
yaml = await readStdin();
|
|
19
|
+
}
|
|
20
|
+
else {
|
|
21
|
+
try {
|
|
22
|
+
yaml = readFileSync(file, "utf-8");
|
|
23
|
+
}
|
|
24
|
+
catch {
|
|
25
|
+
console.error(`Error: Cannot read file '${file}'`);
|
|
26
|
+
process.exit(2);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
const db = await loadErrorDatabase();
|
|
30
|
+
const findings = diagnoseWorkflow(db, yaml);
|
|
31
|
+
const format = detectFormat(opts.format);
|
|
32
|
+
console.log(formatDiagnoseOutput(findings, format));
|
|
33
|
+
process.exit(findings.length > 0 ? 0 : 0); // 0 even if findings (analysis success)
|
|
34
|
+
}
|
|
35
|
+
catch (err) {
|
|
36
|
+
console.error(`Error: ${err.message}`);
|
|
37
|
+
process.exit(3);
|
|
38
|
+
}
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Read all data from stdin.
|
|
43
|
+
*/
|
|
44
|
+
function readStdin() {
|
|
45
|
+
return new Promise((resolve, reject) => {
|
|
46
|
+
const chunks = [];
|
|
47
|
+
process.stdin.on("data", (chunk) => chunks.push(chunk));
|
|
48
|
+
process.stdin.on("end", () => resolve(Buffer.concat(chunks).toString("utf-8")));
|
|
49
|
+
process.stdin.on("error", reject);
|
|
50
|
+
// If stdin is a TTY (no pipe), show a hint and wait briefly
|
|
51
|
+
if (process.stdin.isTTY) {
|
|
52
|
+
console.error("Reading workflow YAML from stdin... (Ctrl+D to end)");
|
|
53
|
+
}
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
//# sourceMappingURL=diagnose.js.map
|
|
@@ -0,0 +1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AO,EAAE,OAAO,GAAG,IAAI,CAkB5D"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CLI command: lookup — match error message against known issues.
|
|
3
|
+
*/
|
|
4
|
+
import { loadErrorDatabase } from "../../db/loader.js";
|
|
5
|
+
import { lookupError } from "../../tools/lookup-error.js";
|
|
6
|
+
import { detectFormat, formatLookupOutput } from "../output.js";
|
|
7
|
+
export function registerLookupCommand(program) {
|
|
8
|
+
program
|
|
9
|
+
.command("lookup <error_message>")
|
|
10
|
+
.description("Match an error message against known issues")
|
|
11
|
+
.option("--max-results <n>", "Maximum number of results to return", "3")
|
|
12
|
+
.option("--format <fmt>", "Output format: text, json, md")
|
|
13
|
+
.action(async (errorMessage, opts) => {
|
|
14
|
+
try {
|
|
15
|
+
const db = await loadErrorDatabase();
|
|
16
|
+
const results = lookupError(db, errorMessage, parseInt(opts.maxResults, 10));
|
|
17
|
+
const format = detectFormat(opts.format);
|
|
18
|
+
console.log(formatLookupOutput(results, format));
|
|
19
|
+
process.exit(results.length > 0 ? 0 : 1);
|
|
20
|
+
}
|
|
21
|
+
catch (err) {
|
|
22
|
+
console.error(`Error: ${err.message}`);
|
|
23
|
+
process.exit(3);
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=lookup.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lookup.js","sourceRoot":"","sources":["../../../src/cli/commands/lookup.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AACvD,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAC1D,OAAO,EAAE,YAAY,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAEhE,MAAM,UAAU,qBAAqB,CAAC,OAAgB;IACpD,OAAO;SACJ,OAAO,CAAC,wBAAwB,CAAC;SACjC,WAAW,CAAC,6CAA6C,CAAC;SAC1D,MAAM,CAAC,mBAAmB,EAAE,qCAAqC,EAAE,GAAG,CAAC;SACvE,MAAM,CAAC,gBAAgB,EAAE,+BAA+B,CAAC;SACzD,MAAM,CAAC,KAAK,EAAE,YAAoB,EAAE,IAA6C,EAAE,EAAE;QACpF,IAAI,CAAC;YACH,MAAM,EAAE,GAAG,MAAM,iBAAiB,EAAE,CAAC;YACrC,MAAM,OAAO,GAAG,WAAW,CAAC,EAAE,EAAE,YAAY,EAAE,QAAQ,CAAC,IAAI,CAAC,UAAU,EAAE,EAAE,CAAC,CAAC,CAAC;YAC7E,MAAM,MAAM,GAAG,YAAY,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;YACzC,OAAO,CAAC,GAAG,CAAC,kBAAkB,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC,CAAC;YACjD,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAC3C,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,OAAO,CAAC,KAAK,CAAC,UAAW,GAAa,CAAC,OAAO,EAAE,CAAC,CAAC;YAClD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAClB,CAAC;IACH,CAAC,CAAC,CAAC;AACP,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"search.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/search.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAKzC,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAwB5D"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CLI command: search — full-text search across the error database.
|
|
3
|
+
*/
|
|
4
|
+
import { loadErrorDatabase } from "../../db/loader.js";
|
|
5
|
+
import { searchErrors } from "../../tools/search-errors.js";
|
|
6
|
+
import { detectFormat, formatSearchOutput } from "../output.js";
|
|
7
|
+
export function registerSearchCommand(program) {
|
|
8
|
+
program
|
|
9
|
+
.command("search <query>")
|
|
10
|
+
.description("Search error database by keyword")
|
|
11
|
+
.option("--category <cat>", "Filter by category")
|
|
12
|
+
.option("--severity <sev>", "Filter by severity (error, warning, silent-failure, limitation)")
|
|
13
|
+
.option("--max-results <n>", "Maximum number of results to return", "10")
|
|
14
|
+
.option("--format <fmt>", "Output format: text, json, md")
|
|
15
|
+
.action(async (query, opts) => {
|
|
16
|
+
try {
|
|
17
|
+
const db = await loadErrorDatabase();
|
|
18
|
+
const results = searchErrors(db, query, {
|
|
19
|
+
category: opts.category,
|
|
20
|
+
severity: opts.severity,
|
|
21
|
+
maxResults: parseInt(opts.maxResults, 10),
|
|
22
|
+
});
|
|
23
|
+
const format = detectFormat(opts.format);
|
|
24
|
+
console.log(formatSearchOutput(results, format));
|
|
25
|
+
process.exit(results.length > 0 ? 0 : 1);
|
|
26
|
+
}
|
|
27
|
+
catch (err) {
|
|
28
|
+
console.error(`Error: ${err.message}`);
|
|
29
|
+
process.exit(3);
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=search.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"search.js","sourceRoot":"","sources":["../../../src/cli/commands/search.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AACvD,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAC5D,OAAO,EAAE,YAAY,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAEhE,MAAM,UAAU,qBAAqB,CAAC,OAAgB;IACpD,OAAO;SACJ,OAAO,CAAC,gBAAgB,CAAC;SACzB,WAAW,CAAC,kCAAkC,CAAC;SAC/C,MAAM,CAAC,k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E,OAAO,GAAG,IAAI,CAkB7D"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CLI command: suggest-fix — contextual fix suggestions.
|
|
3
|
+
*/
|
|
4
|
+
import { loadErrorDatabase } from "../../db/loader.js";
|
|
5
|
+
import { suggestFix } from "../../tools/suggest-fix.js";
|
|
6
|
+
import { detectFormat, formatSuggestOutput } from "../output.js";
|
|
7
|
+
export function registerSuggestCommand(program) {
|
|
8
|
+
program
|
|
9
|
+
.command("suggest-fix <error_context>")
|
|
10
|
+
.description("Get contextual fix suggestions for an error")
|
|
11
|
+
.option("--category <cat>", "Narrow search to a specific category")
|
|
12
|
+
.option("--format <fmt>", "Output format: text, json, md")
|
|
13
|
+
.action(async (errorContext, opts) => {
|
|
14
|
+
try {
|
|
15
|
+
const db = await loadErrorDatabase();
|
|
16
|
+
const results = suggestFix(db, errorContext, opts.category);
|
|
17
|
+
const format = detectFormat(opts.format);
|
|
18
|
+
console.log(formatSuggestOutput(results, format));
|
|
19
|
+
process.exit(results.length > 0 ? 0 : 1);
|
|
20
|
+
}
|
|
21
|
+
catch (err) {
|
|
22
|
+
console.error(`Error: ${err.message}`);
|
|
23
|
+
process.exit(3);
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=suggest.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"suggest.js","sourceRoot":"","sources":["../../../src/cli/commands/suggest.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AACvD,OAAO,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AACxD,OAAO,EAAE,YAAY,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAEjE,MAAM,UAAU,sBAAsB,CAAC,OAAgB;IACrD,OAAO;SACJ,OAAO,CAAC,6BAA6B,CAAC;SACtC,WAAW,CAAC,6CAA6C,CAAC;SAC1D,MAAM,CAAC,kBAAkB,EAAE,sCAAsC,CAAC;SAClE,MAAM,CAAC,gBAAgB,EAAE,+BAA+B,CAAC;SACzD,MAAM,CAAC,KAAK,EAAE,YAAoB,EAAE,IAA4C,EAAE,EAAE;QACnF,IAAI,CAAC;YACH,MAAM,EAAE,GAAG,MAAM,iBAAiB,EAAE,CAAC;YACrC,MAAM,OAAO,GAAG,UAAU,CAAC,EAAE,EAAE,YAAY,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC;YAC5D,MAAM,MAAM,GAAG,YAAY,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;YACzC,OAAO,CAAC,GAAG,CAAC,mBAAmB,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC,CAAC;YAClD,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAC3C,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,OAAO,CAAC,KAAK,CAAC,UAAW,GAAa,CAAC,OAAO,EAAE,CAAC,CAAC;YAClD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAClB,CAAC;IACH,CAAC,CAAC,CAAC;AACP,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../../src/cli/main.ts"],"names":[],"mappings":"AAAA;;GAEG"}
|
package/dist/cli/main.js
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CLI main — commander program setup and command registration.
|
|
3
|
+
*/
|
|
4
|
+
import { Command } from "commander";
|
|
5
|
+
import { registerLookupCommand } from "./commands/lookup.js";
|
|
6
|
+
import { registerSearchCommand } from "./commands/search.js";
|
|
7
|
+
import { registerDiagnoseCommand } from "./commands/diagnose.js";
|
|
8
|
+
import { registerSuggestCommand } from "./commands/suggest.js";
|
|
9
|
+
import { registerCategoriesCommand } from "./commands/categories.js";
|
|
10
|
+
const program = new Command()
|
|
11
|
+
.name("actions-debugger")
|
|
12
|
+
.description("65+ real GitHub Actions errors, queryable from your terminal")
|
|
13
|
+
.version("1.1.0");
|
|
14
|
+
registerLookupCommand(program);
|
|
15
|
+
registerSearchCommand(program);
|
|
16
|
+
registerDiagnoseCommand(program);
|
|
17
|
+
registerSuggestCommand(program);
|
|
18
|
+
registerCategoriesCommand(program);
|
|
19
|
+
program.parse();
|
|
20
|
+
//# sourceMappingURL=main.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"main.js","sourceRoot":"","sources":["../../src/cli/main.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAC7D,OAAO,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAC7D,OAAO,EAAE,uBAAuB,EAAE,MAAM,wBAAwB,CAAC;AACjE,OAAO,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AAC/D,OAAO,EAAE,yBAAyB,EAAE,MAAM,0BAA0B,CAAC;AAErE,MAAM,OAAO,GAAG,IAAI,OAAO,EAAE;KAC1B,IAAI,CAAC,kBAAkB,CAAC;KACxB,WAAW,CAAC,8DAA8D,CAAC;KAC3E,OAAO,CAAC,OAAO,CAAC,CAAC;AAEpB,qBAAqB,CAAC,OAAO,CAAC,CAAC;AAC/B,qBAAqB,CAAC,OAAO,CAAC,CAAC;AAC/B,uBAAuB,CAAC,OAAO,CAAC,CAAC;AACjC,sBAAsB,CAAC,OAAO,CAAC,CAAC;AAChC,yBAAyB,CAAC,OAAO,CAAC,CAAC;AAEnC,OAAO,CAAC,KAAK,EAAE,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Output formatters for CLI commands.
|
|
3
|
+
* Supports text (human-friendly), json (machine-parseable), and md (markdown).
|
|
4
|
+
*/
|
|
5
|
+
import type { ErrorEntry, DiagnosticFinding, CategoryInfo } from "../db/types.js";
|
|
6
|
+
export type OutputFormat = "text" | "json" | "md";
|
|
7
|
+
/**
|
|
8
|
+
* Detect the appropriate output format.
|
|
9
|
+
* TTY → text, piped → json, or explicit user choice.
|
|
10
|
+
*/
|
|
11
|
+
export declare function detectFormat(explicit?: string): OutputFormat;
|
|
12
|
+
export declare function formatLookupOutput(results: ErrorEntry[], format: OutputFormat): string;
|
|
13
|
+
export declare function formatSearchOutput(results: ErrorEntry[], format: OutputFormat): string;
|
|
14
|
+
export declare function formatDiagnoseOutput(findings: DiagnosticFinding[], format: OutputFormat): string;
|
|
15
|
+
export declare function formatSuggestOutput(results: ErrorEntry[], format: OutputFormat): string;
|
|
16
|
+
export declare function formatCategoriesOutput(categories: CategoryInfo[], format: OutputFormat): string;
|
|
17
|
+
//# sourceMappingURL=output.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"output.d.ts","sourceRoot":"","sources":["../../src/cli/output.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,iBAAiB,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAElF,MAAM,MAAM,YAAY,GAAG,MAAM,GAAG,MAAM,GAAG,IAAI,CAAC;AAElD;;;GAGG;AACH,wBAAgB,YAAY,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,YAAY,CAG5D;AAID,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,UAAU,EAAE,EAAE,MAAM,EAAE,YAAY,GAAG,MAAM,CAQtF;AAuFD,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,UAAU,EAAE,EAAE,MAAM,EAAE,YAAY,GAAG,MAAM,CAQtF;AA8BD,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE,iBAAiB,EAAE,EAAE,MAAM,EAAE,YAAY,GAAG,MAAM,CAQhG;AAuCD,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,UAAU,EAAE,EAAE,MAAM,EAAE,YAAY,GAAG,MAAM,CAQvF;AAqED,wBAAgB,sBAAsB,CAAC,UAAU,EAAE,YAAY,EAAE,EAAE,MAAM,EAAE,YAAY,GAAG,MAAM,CAc/F"}
|