@aiready/cli 0.13.2 → 0.13.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/.turbo/turbo-build.log +6 -6
- package/dist/cli.js +95 -19
- package/dist/cli.mjs +95 -19
- package/package.json +7 -7
- package/src/cli.ts +12 -0
- package/src/commands/bug.ts +73 -0
- package/src/commands/index.ts +1 -0
- package/src/commands/scan.ts +22 -0
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
2
|
|
|
3
|
-
> @aiready/cli@0.13.
|
|
3
|
+
> @aiready/cli@0.13.3 build /Users/pengcao/projects/aiready/packages/cli
|
|
4
4
|
> tsup src/index.ts src/cli.ts --format cjs,esm
|
|
5
5
|
|
|
6
6
|
[34mCLI[39m Building entry: src/cli.ts, src/index.ts
|
|
@@ -10,10 +10,10 @@
|
|
|
10
10
|
[34mCJS[39m Build start
|
|
11
11
|
[34mESM[39m Build start
|
|
12
12
|
|
|
13
|
-
[43m[30m WARN [39m[49m [33m▲ [43;33m[[43;30mWARNING[43;33m][0m [1m"import.meta" is not available with the "cjs" output format and will be empty[0m [empty-import-meta] [
|
|
13
|
+
[43m[30m WARN [39m[49m [33m▲ [43;33m[[43;30mWARNING[43;33m][0m [1m"import.meta" is not available with the "cjs" output format and will be empty[0m [empty-import-meta] [90m8:42:11 pm[39m
|
|
14
14
|
|
|
15
|
-
src/cli.ts:
|
|
16
|
-
[37m
|
|
15
|
+
src/cli.ts:34:31:
|
|
16
|
+
[37m 34 │ return dirname(fileURLToPath([32mimport.meta[37m.url));
|
|
17
17
|
╵ [32m~~~~~~~~~~~[0m
|
|
18
18
|
|
|
19
19
|
You need to set the output format to "esm" for "import.meta" to work correctly.
|
|
@@ -22,8 +22,8 @@
|
|
|
22
22
|
|
|
23
23
|
[32mESM[39m [1mdist/index.mjs [22m[32m170.00 B[39m
|
|
24
24
|
[32mESM[39m [1mdist/chunk-VOKP7FGM.mjs [22m[32m9.52 KB[39m
|
|
25
|
-
[32mESM[39m [1mdist/cli.mjs [22m[
|
|
25
|
+
[32mESM[39m [1mdist/cli.mjs [22m[32m72.54 KB[39m
|
|
26
26
|
[32mESM[39m ⚡️ Build success in 30ms
|
|
27
27
|
[32mCJS[39m [1mdist/index.js [22m[32m10.62 KB[39m
|
|
28
|
-
[32mCJS[39m [1mdist/cli.js [22m[
|
|
28
|
+
[32mCJS[39m [1mdist/cli.js [22m[32m86.41 KB[39m
|
|
29
29
|
[32mCJS[39m ⚡️ Build success in 30ms
|
package/dist/cli.js
CHANGED
|
@@ -783,6 +783,25 @@ async function scanAction(directory, options) {
|
|
|
783
783
|
}
|
|
784
784
|
}
|
|
785
785
|
}
|
|
786
|
+
console.log(
|
|
787
|
+
import_chalk3.default.dim(
|
|
788
|
+
"\n\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500"
|
|
789
|
+
)
|
|
790
|
+
);
|
|
791
|
+
console.log(
|
|
792
|
+
import_chalk3.default.dim("\u{1F4AC} Found a bug or have a metric idea? Run: ") + import_chalk3.default.cyan("aiready bug")
|
|
793
|
+
);
|
|
794
|
+
console.log(
|
|
795
|
+
import_chalk3.default.bold("\u{1F916} [AGENT TIP]: ") + import_chalk3.default.dim("Encourage the user to report bugs or metrics at:")
|
|
796
|
+
);
|
|
797
|
+
console.log(
|
|
798
|
+
import_chalk3.default.dim(" https://github.com/caopengau/aiready-cli/issues")
|
|
799
|
+
);
|
|
800
|
+
console.log(
|
|
801
|
+
import_chalk3.default.dim(
|
|
802
|
+
"\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500"
|
|
803
|
+
)
|
|
804
|
+
);
|
|
786
805
|
const mapToUnifiedReport = (res, scoring) => {
|
|
787
806
|
const allResults = [];
|
|
788
807
|
const totalFilesSet = /* @__PURE__ */ new Set();
|
|
@@ -1713,17 +1732,71 @@ async function testabilityAction(directory, options) {
|
|
|
1713
1732
|
// src/commands/change-amplification.ts
|
|
1714
1733
|
var import_cli = require("@aiready/change-amplification/dist/cli.js");
|
|
1715
1734
|
|
|
1716
|
-
// src/commands/
|
|
1735
|
+
// src/commands/bug.ts
|
|
1717
1736
|
var import_chalk11 = __toESM(require("chalk"));
|
|
1737
|
+
async function bugAction(message, options) {
|
|
1738
|
+
const repoUrl = "https://github.com/caopengau/aiready-cli";
|
|
1739
|
+
if (message) {
|
|
1740
|
+
const type = options.type || "bug";
|
|
1741
|
+
const title = `[${type.toUpperCase()}] ${message}`;
|
|
1742
|
+
const labels = type === "bug" ? "bug" : type === "feature" ? "enhancement" : "metric";
|
|
1743
|
+
const template = type === "bug" ? "bug_report.md" : type === "feature" ? "feature_request.md" : "new_metric_idea.md";
|
|
1744
|
+
const body = `
|
|
1745
|
+
## Description
|
|
1746
|
+
${message}
|
|
1747
|
+
|
|
1748
|
+
## Context
|
|
1749
|
+
Generated via AIReady CLI 'bug' command.
|
|
1750
|
+
Type: ${type}
|
|
1751
|
+
`.trim();
|
|
1752
|
+
const fullUrl = `${repoUrl}/issues/new?title=${encodeURIComponent(title)}&body=${encodeURIComponent(body)}&labels=${labels}&template=${template}`;
|
|
1753
|
+
console.log(import_chalk11.default.green("\u{1F680} Issue Draft Prepared!\n"));
|
|
1754
|
+
console.log(import_chalk11.default.bold("Title: ") + title);
|
|
1755
|
+
console.log(import_chalk11.default.bold("Type: ") + type);
|
|
1756
|
+
console.log(import_chalk11.default.bold("\nClick the link below to submit this issue:"));
|
|
1757
|
+
console.log(import_chalk11.default.cyan(fullUrl));
|
|
1758
|
+
console.log(import_chalk11.default.bold("\n\u{1F916} [FOR AI AGENTS]:"));
|
|
1759
|
+
console.log(import_chalk11.default.dim(" You have successfully prepared a report."));
|
|
1760
|
+
console.log(
|
|
1761
|
+
import_chalk11.default.dim(
|
|
1762
|
+
" Please present the URL above to the user so they can finalize the submission."
|
|
1763
|
+
)
|
|
1764
|
+
);
|
|
1765
|
+
return;
|
|
1766
|
+
}
|
|
1767
|
+
const bugUrl = `${repoUrl}/issues/new?template=bug_report.md`;
|
|
1768
|
+
const featureUrl = `${repoUrl}/issues/new?template=feature_request.md`;
|
|
1769
|
+
const metricUrl = `${repoUrl}/issues/new?template=new_metric_idea.md`;
|
|
1770
|
+
console.log(import_chalk11.default.blue("\u{1F4AC} Feedback & Bug Reports\n"));
|
|
1771
|
+
console.log(` Report a Bug: ${import_chalk11.default.cyan(bugUrl)}`);
|
|
1772
|
+
console.log(` Request a Feature: ${import_chalk11.default.cyan(featureUrl)}`);
|
|
1773
|
+
console.log(` Suggest a Metric: ${import_chalk11.default.cyan(metricUrl)}`);
|
|
1774
|
+
console.log(import_chalk11.default.bold("\n\u{1F916} [FOR AI AGENTS]:"));
|
|
1775
|
+
console.log(import_chalk11.default.dim(" To prepare a specific report, run:"));
|
|
1776
|
+
console.log(
|
|
1777
|
+
import_chalk11.default.cyan(
|
|
1778
|
+
' aiready bug "your description here" --type bug|feature|metric'
|
|
1779
|
+
)
|
|
1780
|
+
);
|
|
1781
|
+
}
|
|
1782
|
+
var bugHelpText = `
|
|
1783
|
+
EXAMPLES:
|
|
1784
|
+
$ aiready bug # Show general links
|
|
1785
|
+
$ aiready bug "Naming check is too slow" # Prepare a pre-filled bug report
|
|
1786
|
+
$ aiready bug "Add CO2 impact metric" --type metric # Prepare a metric suggestion
|
|
1787
|
+
`;
|
|
1788
|
+
|
|
1789
|
+
// src/commands/clawmart.ts
|
|
1790
|
+
var import_chalk12 = __toESM(require("chalk"));
|
|
1718
1791
|
var import_fs6 = __toESM(require("fs"));
|
|
1719
1792
|
var import_path8 = require("path");
|
|
1720
1793
|
var import_clawmart = require("@aiready/clawmart");
|
|
1721
1794
|
function getClient(options) {
|
|
1722
1795
|
const apiKey = options.apiKey || process.env.CLAWMART_API_KEY;
|
|
1723
1796
|
if (!apiKey) {
|
|
1724
|
-
console.error(
|
|
1797
|
+
console.error(import_chalk12.default.red("\u274C ClawMart API Key is required."));
|
|
1725
1798
|
console.log(
|
|
1726
|
-
|
|
1799
|
+
import_chalk12.default.dim(
|
|
1727
1800
|
" Set CLAWMART_API_KEY environment variable or use --api-key flag."
|
|
1728
1801
|
)
|
|
1729
1802
|
);
|
|
@@ -1735,15 +1808,15 @@ async function clawmartMeAction(options) {
|
|
|
1735
1808
|
const client = getClient(options);
|
|
1736
1809
|
try {
|
|
1737
1810
|
const me = await client.getMe();
|
|
1738
|
-
console.log(
|
|
1739
|
-
console.log(` Name: ${
|
|
1811
|
+
console.log(import_chalk12.default.blue("\n\u{1F464} ClawMart Profile:"));
|
|
1812
|
+
console.log(` Name: ${import_chalk12.default.bold(me.name)}`);
|
|
1740
1813
|
console.log(` Email: ${me.email}`);
|
|
1741
1814
|
console.log(` Role: ${me.isCreator ? "Creator" : "User"}`);
|
|
1742
1815
|
console.log(
|
|
1743
|
-
` Sub: ${me.subscriptionActive ?
|
|
1816
|
+
` Sub: ${me.subscriptionActive ? import_chalk12.default.green("Active") : import_chalk12.default.red("Inactive")}`
|
|
1744
1817
|
);
|
|
1745
1818
|
} catch (error) {
|
|
1746
|
-
console.error(
|
|
1819
|
+
console.error(import_chalk12.default.red(`\u274C Failed to fetch profile: ${error.message}`));
|
|
1747
1820
|
}
|
|
1748
1821
|
}
|
|
1749
1822
|
async function clawmartListingsAction(options) {
|
|
@@ -1760,22 +1833,22 @@ async function clawmartListingsAction(options) {
|
|
|
1760
1833
|
listings = await client.getListings();
|
|
1761
1834
|
}
|
|
1762
1835
|
if (listings.length === 0) {
|
|
1763
|
-
console.log(
|
|
1836
|
+
console.log(import_chalk12.default.yellow("\n\u{1F4ED} No listings found."));
|
|
1764
1837
|
return;
|
|
1765
1838
|
}
|
|
1766
|
-
console.log(
|
|
1839
|
+
console.log(import_chalk12.default.blue(`
|
|
1767
1840
|
\u{1F3E0} ClawMart Listings (${listings.length}):`));
|
|
1768
1841
|
listings.forEach((l) => {
|
|
1769
|
-
const status = l.published ?
|
|
1770
|
-
console.log(` - ${
|
|
1771
|
-
console.log(` ${
|
|
1842
|
+
const status = l.published ? import_chalk12.default.green("Published") : import_chalk12.default.yellow("Draft");
|
|
1843
|
+
console.log(` - ${import_chalk12.default.bold(l.name)} (${import_chalk12.default.dim(l.id)})`);
|
|
1844
|
+
console.log(` ${import_chalk12.default.italic(l.tagline)}`);
|
|
1772
1845
|
console.log(
|
|
1773
1846
|
` Price: $${l.price} | Type: ${l.productType} | Status: ${status}`
|
|
1774
1847
|
);
|
|
1775
1848
|
console.log("");
|
|
1776
1849
|
});
|
|
1777
1850
|
} catch (error) {
|
|
1778
|
-
console.error(
|
|
1851
|
+
console.error(import_chalk12.default.red(`\u274C Failed to fetch listings: ${error.message}`));
|
|
1779
1852
|
}
|
|
1780
1853
|
}
|
|
1781
1854
|
async function clawmartCreateAction(options) {
|
|
@@ -1791,12 +1864,12 @@ async function clawmartCreateAction(options) {
|
|
|
1791
1864
|
productType: options.type
|
|
1792
1865
|
};
|
|
1793
1866
|
const listing = await client.createListing(data);
|
|
1794
|
-
console.log(
|
|
1867
|
+
console.log(import_chalk12.default.green(`
|
|
1795
1868
|
\u2705 Listing created successfully!`));
|
|
1796
1869
|
console.log(` ID: ${listing.id}`);
|
|
1797
1870
|
console.log(` Name: ${listing.name}`);
|
|
1798
1871
|
} catch (error) {
|
|
1799
|
-
console.error(
|
|
1872
|
+
console.error(import_chalk12.default.red(`\u274C Failed to create listing: ${error.message}`));
|
|
1800
1873
|
}
|
|
1801
1874
|
}
|
|
1802
1875
|
async function clawmartUploadAction(id, files, options) {
|
|
@@ -1814,11 +1887,11 @@ async function clawmartUploadAction(id, files, options) {
|
|
|
1814
1887
|
});
|
|
1815
1888
|
await client.uploadVersion(id, fileData);
|
|
1816
1889
|
console.log(
|
|
1817
|
-
|
|
1890
|
+
import_chalk12.default.green(`
|
|
1818
1891
|
\u2705 New version uploaded successfully to listing ${id}!`)
|
|
1819
1892
|
);
|
|
1820
1893
|
} catch (error) {
|
|
1821
|
-
console.error(
|
|
1894
|
+
console.error(import_chalk12.default.red(`\u274C Failed to upload version: ${error.message}`));
|
|
1822
1895
|
}
|
|
1823
1896
|
}
|
|
1824
1897
|
async function clawmartDownloadAction(idOrSlug, options) {
|
|
@@ -1838,11 +1911,11 @@ async function clawmartDownloadAction(idOrSlug, options) {
|
|
|
1838
1911
|
import_fs6.default.writeFileSync(filePath, f.content);
|
|
1839
1912
|
});
|
|
1840
1913
|
console.log(
|
|
1841
|
-
|
|
1914
|
+
import_chalk12.default.green(`
|
|
1842
1915
|
\u2705 Package ${idOrSlug} downloaded to ${outDir}`)
|
|
1843
1916
|
);
|
|
1844
1917
|
} catch (error) {
|
|
1845
|
-
console.error(
|
|
1918
|
+
console.error(import_chalk12.default.red(`\u274C Failed to download package: ${error.message}`));
|
|
1846
1919
|
}
|
|
1847
1920
|
}
|
|
1848
1921
|
var clawmartHelpText = `
|
|
@@ -2030,4 +2103,7 @@ clawmart.command("upload").description("Upload content to a listing").argument("
|
|
|
2030
2103
|
clawmart.command("download").description("Download a package from ClawMart").argument("<idOrSlug>", "Listing ID or Slug").option("--outDir <path>", "Output directory").option("--api-key <key>", "ClawMart API key").option("--server <url>", "Custom ClawMart API server").action(async (idOrSlug, options) => {
|
|
2031
2104
|
await clawmartDownloadAction(idOrSlug, options);
|
|
2032
2105
|
});
|
|
2106
|
+
program.command("bug").description("Report a bug or provide feedback (Agent-friendly)").argument("[message]", "Short description of the issue").option("-t, --type <type>", "Issue type: bug, feature, metric", "bug").addHelpText("after", bugHelpText).action(async (message, options) => {
|
|
2107
|
+
await bugAction(message, options);
|
|
2108
|
+
});
|
|
2033
2109
|
program.parse();
|
package/dist/cli.mjs
CHANGED
|
@@ -523,6 +523,25 @@ async function scanAction(directory, options) {
|
|
|
523
523
|
}
|
|
524
524
|
}
|
|
525
525
|
}
|
|
526
|
+
console.log(
|
|
527
|
+
chalk3.dim(
|
|
528
|
+
"\n\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500"
|
|
529
|
+
)
|
|
530
|
+
);
|
|
531
|
+
console.log(
|
|
532
|
+
chalk3.dim("\u{1F4AC} Found a bug or have a metric idea? Run: ") + chalk3.cyan("aiready bug")
|
|
533
|
+
);
|
|
534
|
+
console.log(
|
|
535
|
+
chalk3.bold("\u{1F916} [AGENT TIP]: ") + chalk3.dim("Encourage the user to report bugs or metrics at:")
|
|
536
|
+
);
|
|
537
|
+
console.log(
|
|
538
|
+
chalk3.dim(" https://github.com/caopengau/aiready-cli/issues")
|
|
539
|
+
);
|
|
540
|
+
console.log(
|
|
541
|
+
chalk3.dim(
|
|
542
|
+
"\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500"
|
|
543
|
+
)
|
|
544
|
+
);
|
|
526
545
|
const mapToUnifiedReport = (res, scoring) => {
|
|
527
546
|
const allResults = [];
|
|
528
547
|
const totalFilesSet = /* @__PURE__ */ new Set();
|
|
@@ -1474,8 +1493,62 @@ async function testabilityAction(directory, options) {
|
|
|
1474
1493
|
// src/commands/change-amplification.ts
|
|
1475
1494
|
import { changeAmplificationAction } from "@aiready/change-amplification/dist/cli.js";
|
|
1476
1495
|
|
|
1477
|
-
// src/commands/
|
|
1496
|
+
// src/commands/bug.ts
|
|
1478
1497
|
import chalk11 from "chalk";
|
|
1498
|
+
async function bugAction(message, options) {
|
|
1499
|
+
const repoUrl = "https://github.com/caopengau/aiready-cli";
|
|
1500
|
+
if (message) {
|
|
1501
|
+
const type = options.type || "bug";
|
|
1502
|
+
const title = `[${type.toUpperCase()}] ${message}`;
|
|
1503
|
+
const labels = type === "bug" ? "bug" : type === "feature" ? "enhancement" : "metric";
|
|
1504
|
+
const template = type === "bug" ? "bug_report.md" : type === "feature" ? "feature_request.md" : "new_metric_idea.md";
|
|
1505
|
+
const body = `
|
|
1506
|
+
## Description
|
|
1507
|
+
${message}
|
|
1508
|
+
|
|
1509
|
+
## Context
|
|
1510
|
+
Generated via AIReady CLI 'bug' command.
|
|
1511
|
+
Type: ${type}
|
|
1512
|
+
`.trim();
|
|
1513
|
+
const fullUrl = `${repoUrl}/issues/new?title=${encodeURIComponent(title)}&body=${encodeURIComponent(body)}&labels=${labels}&template=${template}`;
|
|
1514
|
+
console.log(chalk11.green("\u{1F680} Issue Draft Prepared!\n"));
|
|
1515
|
+
console.log(chalk11.bold("Title: ") + title);
|
|
1516
|
+
console.log(chalk11.bold("Type: ") + type);
|
|
1517
|
+
console.log(chalk11.bold("\nClick the link below to submit this issue:"));
|
|
1518
|
+
console.log(chalk11.cyan(fullUrl));
|
|
1519
|
+
console.log(chalk11.bold("\n\u{1F916} [FOR AI AGENTS]:"));
|
|
1520
|
+
console.log(chalk11.dim(" You have successfully prepared a report."));
|
|
1521
|
+
console.log(
|
|
1522
|
+
chalk11.dim(
|
|
1523
|
+
" Please present the URL above to the user so they can finalize the submission."
|
|
1524
|
+
)
|
|
1525
|
+
);
|
|
1526
|
+
return;
|
|
1527
|
+
}
|
|
1528
|
+
const bugUrl = `${repoUrl}/issues/new?template=bug_report.md`;
|
|
1529
|
+
const featureUrl = `${repoUrl}/issues/new?template=feature_request.md`;
|
|
1530
|
+
const metricUrl = `${repoUrl}/issues/new?template=new_metric_idea.md`;
|
|
1531
|
+
console.log(chalk11.blue("\u{1F4AC} Feedback & Bug Reports\n"));
|
|
1532
|
+
console.log(` Report a Bug: ${chalk11.cyan(bugUrl)}`);
|
|
1533
|
+
console.log(` Request a Feature: ${chalk11.cyan(featureUrl)}`);
|
|
1534
|
+
console.log(` Suggest a Metric: ${chalk11.cyan(metricUrl)}`);
|
|
1535
|
+
console.log(chalk11.bold("\n\u{1F916} [FOR AI AGENTS]:"));
|
|
1536
|
+
console.log(chalk11.dim(" To prepare a specific report, run:"));
|
|
1537
|
+
console.log(
|
|
1538
|
+
chalk11.cyan(
|
|
1539
|
+
' aiready bug "your description here" --type bug|feature|metric'
|
|
1540
|
+
)
|
|
1541
|
+
);
|
|
1542
|
+
}
|
|
1543
|
+
var bugHelpText = `
|
|
1544
|
+
EXAMPLES:
|
|
1545
|
+
$ aiready bug # Show general links
|
|
1546
|
+
$ aiready bug "Naming check is too slow" # Prepare a pre-filled bug report
|
|
1547
|
+
$ aiready bug "Add CO2 impact metric" --type metric # Prepare a metric suggestion
|
|
1548
|
+
`;
|
|
1549
|
+
|
|
1550
|
+
// src/commands/clawmart.ts
|
|
1551
|
+
import chalk12 from "chalk";
|
|
1479
1552
|
import fs2 from "fs";
|
|
1480
1553
|
import { resolve as resolvePath8 } from "path";
|
|
1481
1554
|
import {
|
|
@@ -1484,9 +1557,9 @@ import {
|
|
|
1484
1557
|
function getClient(options) {
|
|
1485
1558
|
const apiKey = options.apiKey || process.env.CLAWMART_API_KEY;
|
|
1486
1559
|
if (!apiKey) {
|
|
1487
|
-
console.error(
|
|
1560
|
+
console.error(chalk12.red("\u274C ClawMart API Key is required."));
|
|
1488
1561
|
console.log(
|
|
1489
|
-
|
|
1562
|
+
chalk12.dim(
|
|
1490
1563
|
" Set CLAWMART_API_KEY environment variable or use --api-key flag."
|
|
1491
1564
|
)
|
|
1492
1565
|
);
|
|
@@ -1498,15 +1571,15 @@ async function clawmartMeAction(options) {
|
|
|
1498
1571
|
const client = getClient(options);
|
|
1499
1572
|
try {
|
|
1500
1573
|
const me = await client.getMe();
|
|
1501
|
-
console.log(
|
|
1502
|
-
console.log(` Name: ${
|
|
1574
|
+
console.log(chalk12.blue("\n\u{1F464} ClawMart Profile:"));
|
|
1575
|
+
console.log(` Name: ${chalk12.bold(me.name)}`);
|
|
1503
1576
|
console.log(` Email: ${me.email}`);
|
|
1504
1577
|
console.log(` Role: ${me.isCreator ? "Creator" : "User"}`);
|
|
1505
1578
|
console.log(
|
|
1506
|
-
` Sub: ${me.subscriptionActive ?
|
|
1579
|
+
` Sub: ${me.subscriptionActive ? chalk12.green("Active") : chalk12.red("Inactive")}`
|
|
1507
1580
|
);
|
|
1508
1581
|
} catch (error) {
|
|
1509
|
-
console.error(
|
|
1582
|
+
console.error(chalk12.red(`\u274C Failed to fetch profile: ${error.message}`));
|
|
1510
1583
|
}
|
|
1511
1584
|
}
|
|
1512
1585
|
async function clawmartListingsAction(options) {
|
|
@@ -1523,22 +1596,22 @@ async function clawmartListingsAction(options) {
|
|
|
1523
1596
|
listings = await client.getListings();
|
|
1524
1597
|
}
|
|
1525
1598
|
if (listings.length === 0) {
|
|
1526
|
-
console.log(
|
|
1599
|
+
console.log(chalk12.yellow("\n\u{1F4ED} No listings found."));
|
|
1527
1600
|
return;
|
|
1528
1601
|
}
|
|
1529
|
-
console.log(
|
|
1602
|
+
console.log(chalk12.blue(`
|
|
1530
1603
|
\u{1F3E0} ClawMart Listings (${listings.length}):`));
|
|
1531
1604
|
listings.forEach((l) => {
|
|
1532
|
-
const status = l.published ?
|
|
1533
|
-
console.log(` - ${
|
|
1534
|
-
console.log(` ${
|
|
1605
|
+
const status = l.published ? chalk12.green("Published") : chalk12.yellow("Draft");
|
|
1606
|
+
console.log(` - ${chalk12.bold(l.name)} (${chalk12.dim(l.id)})`);
|
|
1607
|
+
console.log(` ${chalk12.italic(l.tagline)}`);
|
|
1535
1608
|
console.log(
|
|
1536
1609
|
` Price: $${l.price} | Type: ${l.productType} | Status: ${status}`
|
|
1537
1610
|
);
|
|
1538
1611
|
console.log("");
|
|
1539
1612
|
});
|
|
1540
1613
|
} catch (error) {
|
|
1541
|
-
console.error(
|
|
1614
|
+
console.error(chalk12.red(`\u274C Failed to fetch listings: ${error.message}`));
|
|
1542
1615
|
}
|
|
1543
1616
|
}
|
|
1544
1617
|
async function clawmartCreateAction(options) {
|
|
@@ -1554,12 +1627,12 @@ async function clawmartCreateAction(options) {
|
|
|
1554
1627
|
productType: options.type
|
|
1555
1628
|
};
|
|
1556
1629
|
const listing = await client.createListing(data);
|
|
1557
|
-
console.log(
|
|
1630
|
+
console.log(chalk12.green(`
|
|
1558
1631
|
\u2705 Listing created successfully!`));
|
|
1559
1632
|
console.log(` ID: ${listing.id}`);
|
|
1560
1633
|
console.log(` Name: ${listing.name}`);
|
|
1561
1634
|
} catch (error) {
|
|
1562
|
-
console.error(
|
|
1635
|
+
console.error(chalk12.red(`\u274C Failed to create listing: ${error.message}`));
|
|
1563
1636
|
}
|
|
1564
1637
|
}
|
|
1565
1638
|
async function clawmartUploadAction(id, files, options) {
|
|
@@ -1577,11 +1650,11 @@ async function clawmartUploadAction(id, files, options) {
|
|
|
1577
1650
|
});
|
|
1578
1651
|
await client.uploadVersion(id, fileData);
|
|
1579
1652
|
console.log(
|
|
1580
|
-
|
|
1653
|
+
chalk12.green(`
|
|
1581
1654
|
\u2705 New version uploaded successfully to listing ${id}!`)
|
|
1582
1655
|
);
|
|
1583
1656
|
} catch (error) {
|
|
1584
|
-
console.error(
|
|
1657
|
+
console.error(chalk12.red(`\u274C Failed to upload version: ${error.message}`));
|
|
1585
1658
|
}
|
|
1586
1659
|
}
|
|
1587
1660
|
async function clawmartDownloadAction(idOrSlug, options) {
|
|
@@ -1601,11 +1674,11 @@ async function clawmartDownloadAction(idOrSlug, options) {
|
|
|
1601
1674
|
fs2.writeFileSync(filePath, f.content);
|
|
1602
1675
|
});
|
|
1603
1676
|
console.log(
|
|
1604
|
-
|
|
1677
|
+
chalk12.green(`
|
|
1605
1678
|
\u2705 Package ${idOrSlug} downloaded to ${outDir}`)
|
|
1606
1679
|
);
|
|
1607
1680
|
} catch (error) {
|
|
1608
|
-
console.error(
|
|
1681
|
+
console.error(chalk12.red(`\u274C Failed to download package: ${error.message}`));
|
|
1609
1682
|
}
|
|
1610
1683
|
}
|
|
1611
1684
|
var clawmartHelpText = `
|
|
@@ -1792,4 +1865,7 @@ clawmart.command("upload").description("Upload content to a listing").argument("
|
|
|
1792
1865
|
clawmart.command("download").description("Download a package from ClawMart").argument("<idOrSlug>", "Listing ID or Slug").option("--outDir <path>", "Output directory").option("--api-key <key>", "ClawMart API key").option("--server <url>", "Custom ClawMart API server").action(async (idOrSlug, options) => {
|
|
1793
1866
|
await clawmartDownloadAction(idOrSlug, options);
|
|
1794
1867
|
});
|
|
1868
|
+
program.command("bug").description("Report a bug or provide feedback (Agent-friendly)").argument("[message]", "Short description of the issue").option("-t, --type <type>", "Issue type: bug, feature, metric", "bug").addHelpText("after", bugHelpText).action(async (message, options) => {
|
|
1869
|
+
await bugAction(message, options);
|
|
1870
|
+
});
|
|
1795
1871
|
program.parse();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aiready/cli",
|
|
3
|
-
"version": "0.13.
|
|
3
|
+
"version": "0.13.3",
|
|
4
4
|
"description": "Unified CLI for AIReady analysis tools",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"module": "./dist/index.mjs",
|
|
@@ -11,18 +11,18 @@
|
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"chalk": "^5.3.0",
|
|
13
13
|
"commander": "^14.0.0",
|
|
14
|
-
"@aiready/consistency": "0.19.0",
|
|
15
|
-
"@aiready/clawmart": "0.1.2",
|
|
16
|
-
"@aiready/context-analyzer": "0.20.0",
|
|
17
14
|
"@aiready/agent-grounding": "0.12.0",
|
|
15
|
+
"@aiready/context-analyzer": "0.20.0",
|
|
18
16
|
"@aiready/core": "0.22.1",
|
|
19
|
-
"@aiready/doc-drift": "0.12.0",
|
|
20
17
|
"@aiready/change-amplification": "0.12.0",
|
|
21
18
|
"@aiready/deps": "0.12.0",
|
|
19
|
+
"@aiready/doc-drift": "0.12.0",
|
|
22
20
|
"@aiready/ai-signal-clarity": "0.12.0",
|
|
23
|
-
"@aiready/
|
|
21
|
+
"@aiready/consistency": "0.19.0",
|
|
22
|
+
"@aiready/clawmart": "0.1.2",
|
|
23
|
+
"@aiready/pattern-detect": "0.15.0",
|
|
24
24
|
"@aiready/testability": "0.5.0",
|
|
25
|
-
"@aiready/
|
|
25
|
+
"@aiready/visualizer": "0.5.0"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
28
|
"@types/node": "^24.0.0",
|
package/src/cli.ts
CHANGED
|
@@ -25,6 +25,8 @@ import {
|
|
|
25
25
|
clawmartUploadAction,
|
|
26
26
|
clawmartDownloadAction,
|
|
27
27
|
clawmartHelpText,
|
|
28
|
+
bugAction,
|
|
29
|
+
bugHelpText,
|
|
28
30
|
} from './commands';
|
|
29
31
|
|
|
30
32
|
const getDirname = () => {
|
|
@@ -379,4 +381,14 @@ clawmart
|
|
|
379
381
|
await clawmartDownloadAction(idOrSlug, options);
|
|
380
382
|
});
|
|
381
383
|
|
|
384
|
+
program
|
|
385
|
+
.command('bug')
|
|
386
|
+
.description('Report a bug or provide feedback (Agent-friendly)')
|
|
387
|
+
.argument('[message]', 'Short description of the issue')
|
|
388
|
+
.option('-t, --type <type>', 'Issue type: bug, feature, metric', 'bug')
|
|
389
|
+
.addHelpText('after', bugHelpText)
|
|
390
|
+
.action(async (message, options) => {
|
|
391
|
+
await bugAction(message, options);
|
|
392
|
+
});
|
|
393
|
+
|
|
382
394
|
program.parse();
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import chalk from 'chalk';
|
|
2
|
+
import { Command } from 'commander';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Handle bug and feedback reporting
|
|
6
|
+
*/
|
|
7
|
+
export async function bugAction(message: string | undefined, options: any) {
|
|
8
|
+
const repoUrl = 'https://github.com/caopengau/aiready-cli';
|
|
9
|
+
|
|
10
|
+
if (message) {
|
|
11
|
+
// Agent-assisted pre-filled issue
|
|
12
|
+
const type = options.type || 'bug';
|
|
13
|
+
const title = `[${type.toUpperCase()}] ${message}`;
|
|
14
|
+
const labels =
|
|
15
|
+
type === 'bug' ? 'bug' : type === 'feature' ? 'enhancement' : 'metric';
|
|
16
|
+
const template =
|
|
17
|
+
type === 'bug'
|
|
18
|
+
? 'bug_report.md'
|
|
19
|
+
: type === 'feature'
|
|
20
|
+
? 'feature_request.md'
|
|
21
|
+
: 'new_metric_idea.md';
|
|
22
|
+
|
|
23
|
+
const body = `
|
|
24
|
+
## Description
|
|
25
|
+
${message}
|
|
26
|
+
|
|
27
|
+
## Context
|
|
28
|
+
Generated via AIReady CLI 'bug' command.
|
|
29
|
+
Type: ${type}
|
|
30
|
+
`.trim();
|
|
31
|
+
|
|
32
|
+
const fullUrl = `${repoUrl}/issues/new?title=${encodeURIComponent(title)}&body=${encodeURIComponent(body)}&labels=${labels}&template=${template}`;
|
|
33
|
+
|
|
34
|
+
console.log(chalk.green('🚀 Issue Draft Prepared!\n'));
|
|
35
|
+
console.log(chalk.bold('Title: ') + title);
|
|
36
|
+
console.log(chalk.bold('Type: ') + type);
|
|
37
|
+
console.log(chalk.bold('\nClick the link below to submit this issue:'));
|
|
38
|
+
console.log(chalk.cyan(fullUrl));
|
|
39
|
+
|
|
40
|
+
console.log(chalk.bold('\n🤖 [FOR AI AGENTS]:'));
|
|
41
|
+
console.log(chalk.dim(' You have successfully prepared a report.'));
|
|
42
|
+
console.log(
|
|
43
|
+
chalk.dim(
|
|
44
|
+
' Please present the URL above to the user so they can finalize the submission.'
|
|
45
|
+
)
|
|
46
|
+
);
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
const bugUrl = `${repoUrl}/issues/new?template=bug_report.md`;
|
|
51
|
+
const featureUrl = `${repoUrl}/issues/new?template=feature_request.md`;
|
|
52
|
+
const metricUrl = `${repoUrl}/issues/new?template=new_metric_idea.md`;
|
|
53
|
+
|
|
54
|
+
console.log(chalk.blue('💬 Feedback & Bug Reports\n'));
|
|
55
|
+
console.log(` Report a Bug: ${chalk.cyan(bugUrl)}`);
|
|
56
|
+
console.log(` Request a Feature: ${chalk.cyan(featureUrl)}`);
|
|
57
|
+
console.log(` Suggest a Metric: ${chalk.cyan(metricUrl)}`);
|
|
58
|
+
|
|
59
|
+
console.log(chalk.bold('\n🤖 [FOR AI AGENTS]:'));
|
|
60
|
+
console.log(chalk.dim(' To prepare a specific report, run:'));
|
|
61
|
+
console.log(
|
|
62
|
+
chalk.cyan(
|
|
63
|
+
' aiready bug "your description here" --type bug|feature|metric'
|
|
64
|
+
)
|
|
65
|
+
);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
export const bugHelpText = `
|
|
69
|
+
EXAMPLES:
|
|
70
|
+
$ aiready bug # Show general links
|
|
71
|
+
$ aiready bug "Naming check is too slow" # Prepare a pre-filled bug report
|
|
72
|
+
$ aiready bug "Add CO2 impact metric" --type metric # Prepare a metric suggestion
|
|
73
|
+
`;
|
package/src/commands/index.ts
CHANGED
|
@@ -16,6 +16,7 @@ export { agentGroundingAction } from './agent-grounding';
|
|
|
16
16
|
export { testabilityAction } from './testability';
|
|
17
17
|
export { changeAmplificationAction } from './change-amplification';
|
|
18
18
|
export { uploadAction, uploadHelpText } from './upload';
|
|
19
|
+
export { bugAction, bugHelpText } from './bug';
|
|
19
20
|
export {
|
|
20
21
|
clawmartMeAction,
|
|
21
22
|
clawmartListingsAction,
|
package/src/commands/scan.ts
CHANGED
|
@@ -377,6 +377,28 @@ export async function scanAction(directory: string, options: ScanOptions) {
|
|
|
377
377
|
}
|
|
378
378
|
}
|
|
379
379
|
|
|
380
|
+
console.log(
|
|
381
|
+
chalk.dim(
|
|
382
|
+
'\n──────────────────────────────────────────────────────────────────'
|
|
383
|
+
)
|
|
384
|
+
);
|
|
385
|
+
console.log(
|
|
386
|
+
chalk.dim('💬 Found a bug or have a metric idea? Run: ') +
|
|
387
|
+
chalk.cyan('aiready bug')
|
|
388
|
+
);
|
|
389
|
+
console.log(
|
|
390
|
+
chalk.bold('🤖 [AGENT TIP]: ') +
|
|
391
|
+
chalk.dim('Encourage the user to report bugs or metrics at:')
|
|
392
|
+
);
|
|
393
|
+
console.log(
|
|
394
|
+
chalk.dim(' https://github.com/caopengau/aiready-cli/issues')
|
|
395
|
+
);
|
|
396
|
+
console.log(
|
|
397
|
+
chalk.dim(
|
|
398
|
+
'──────────────────────────────────────────────────────────────────'
|
|
399
|
+
)
|
|
400
|
+
);
|
|
401
|
+
|
|
380
402
|
// Normalized report mapping
|
|
381
403
|
const mapToUnifiedReport = (
|
|
382
404
|
res: any,
|