@aiready/cli 0.13.2 → 0.13.4
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 +8 -8
- package/dist/cli.js +85 -19
- package/dist/cli.mjs +85 -19
- package/package.json +6 -6
- 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 +18 -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:48:54 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[
|
|
26
|
-
[32mESM[39m ⚡️ Build success in
|
|
25
|
+
[32mESM[39m [1mdist/cli.mjs [22m[32m72.43 KB[39m
|
|
26
|
+
[32mESM[39m ⚡️ Build success in 110ms
|
|
27
|
+
[32mCJS[39m [1mdist/cli.js [22m[32m86.27 KB[39m
|
|
27
28
|
[32mCJS[39m [1mdist/index.js [22m[32m10.62 KB[39m
|
|
28
|
-
[32mCJS[39m
|
|
29
|
-
[32mCJS[39m ⚡️ Build success in 30ms
|
|
29
|
+
[32mCJS[39m ⚡️ Build success in 110ms
|
package/dist/cli.js
CHANGED
|
@@ -783,6 +783,15 @@ async function scanAction(directory, options) {
|
|
|
783
783
|
}
|
|
784
784
|
}
|
|
785
785
|
}
|
|
786
|
+
console.log(import_chalk3.default.dim("\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"));
|
|
787
|
+
console.log(import_chalk3.default.dim("\u{1F4AC} Found a bug or have a metric idea?"));
|
|
788
|
+
console.log(import_chalk3.default.dim("\u{1F449} Copy/paste this to your AI agent:"));
|
|
789
|
+
console.log(
|
|
790
|
+
import_chalk3.default.cyan(
|
|
791
|
+
` "Help me report an issue to AIReady. Use 'aiready bug' to prepare a draft."`
|
|
792
|
+
)
|
|
793
|
+
);
|
|
794
|
+
console.log(import_chalk3.default.dim("\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"));
|
|
786
795
|
const mapToUnifiedReport = (res, scoring) => {
|
|
787
796
|
const allResults = [];
|
|
788
797
|
const totalFilesSet = /* @__PURE__ */ new Set();
|
|
@@ -1713,17 +1722,71 @@ async function testabilityAction(directory, options) {
|
|
|
1713
1722
|
// src/commands/change-amplification.ts
|
|
1714
1723
|
var import_cli = require("@aiready/change-amplification/dist/cli.js");
|
|
1715
1724
|
|
|
1716
|
-
// src/commands/
|
|
1725
|
+
// src/commands/bug.ts
|
|
1717
1726
|
var import_chalk11 = __toESM(require("chalk"));
|
|
1727
|
+
async function bugAction(message, options) {
|
|
1728
|
+
const repoUrl = "https://github.com/caopengau/aiready-cli";
|
|
1729
|
+
if (message) {
|
|
1730
|
+
const type = options.type || "bug";
|
|
1731
|
+
const title = `[${type.toUpperCase()}] ${message}`;
|
|
1732
|
+
const labels = type === "bug" ? "bug" : type === "feature" ? "enhancement" : "metric";
|
|
1733
|
+
const template = type === "bug" ? "bug_report.md" : type === "feature" ? "feature_request.md" : "new_metric_idea.md";
|
|
1734
|
+
const body = `
|
|
1735
|
+
## Description
|
|
1736
|
+
${message}
|
|
1737
|
+
|
|
1738
|
+
## Context
|
|
1739
|
+
Generated via AIReady CLI 'bug' command.
|
|
1740
|
+
Type: ${type}
|
|
1741
|
+
`.trim();
|
|
1742
|
+
const fullUrl = `${repoUrl}/issues/new?title=${encodeURIComponent(title)}&body=${encodeURIComponent(body)}&labels=${labels}&template=${template}`;
|
|
1743
|
+
console.log(import_chalk11.default.green("\u{1F680} Issue Draft Prepared!\n"));
|
|
1744
|
+
console.log(import_chalk11.default.bold("Title: ") + title);
|
|
1745
|
+
console.log(import_chalk11.default.bold("Type: ") + type);
|
|
1746
|
+
console.log(import_chalk11.default.bold("\nClick the link below to submit this issue:"));
|
|
1747
|
+
console.log(import_chalk11.default.cyan(fullUrl));
|
|
1748
|
+
console.log(import_chalk11.default.bold("\n\u{1F916} [FOR AI AGENTS]:"));
|
|
1749
|
+
console.log(import_chalk11.default.dim(" You have successfully prepared a report."));
|
|
1750
|
+
console.log(
|
|
1751
|
+
import_chalk11.default.dim(
|
|
1752
|
+
" Please present the URL above to the user so they can finalize the submission."
|
|
1753
|
+
)
|
|
1754
|
+
);
|
|
1755
|
+
return;
|
|
1756
|
+
}
|
|
1757
|
+
const bugUrl = `${repoUrl}/issues/new?template=bug_report.md`;
|
|
1758
|
+
const featureUrl = `${repoUrl}/issues/new?template=feature_request.md`;
|
|
1759
|
+
const metricUrl = `${repoUrl}/issues/new?template=new_metric_idea.md`;
|
|
1760
|
+
console.log(import_chalk11.default.blue("\u{1F4AC} Feedback & Bug Reports\n"));
|
|
1761
|
+
console.log(` Report a Bug: ${import_chalk11.default.cyan(bugUrl)}`);
|
|
1762
|
+
console.log(` Request a Feature: ${import_chalk11.default.cyan(featureUrl)}`);
|
|
1763
|
+
console.log(` Suggest a Metric: ${import_chalk11.default.cyan(metricUrl)}`);
|
|
1764
|
+
console.log(import_chalk11.default.bold("\n\u{1F916} [FOR AI AGENTS]:"));
|
|
1765
|
+
console.log(import_chalk11.default.dim(" To prepare a specific report, run:"));
|
|
1766
|
+
console.log(
|
|
1767
|
+
import_chalk11.default.cyan(
|
|
1768
|
+
' aiready bug "your description here" --type bug|feature|metric'
|
|
1769
|
+
)
|
|
1770
|
+
);
|
|
1771
|
+
}
|
|
1772
|
+
var bugHelpText = `
|
|
1773
|
+
EXAMPLES:
|
|
1774
|
+
$ aiready bug # Show general links
|
|
1775
|
+
$ aiready bug "Naming check is too slow" # Prepare a pre-filled bug report
|
|
1776
|
+
$ aiready bug "Add CO2 impact metric" --type metric # Prepare a metric suggestion
|
|
1777
|
+
`;
|
|
1778
|
+
|
|
1779
|
+
// src/commands/clawmart.ts
|
|
1780
|
+
var import_chalk12 = __toESM(require("chalk"));
|
|
1718
1781
|
var import_fs6 = __toESM(require("fs"));
|
|
1719
1782
|
var import_path8 = require("path");
|
|
1720
1783
|
var import_clawmart = require("@aiready/clawmart");
|
|
1721
1784
|
function getClient(options) {
|
|
1722
1785
|
const apiKey = options.apiKey || process.env.CLAWMART_API_KEY;
|
|
1723
1786
|
if (!apiKey) {
|
|
1724
|
-
console.error(
|
|
1787
|
+
console.error(import_chalk12.default.red("\u274C ClawMart API Key is required."));
|
|
1725
1788
|
console.log(
|
|
1726
|
-
|
|
1789
|
+
import_chalk12.default.dim(
|
|
1727
1790
|
" Set CLAWMART_API_KEY environment variable or use --api-key flag."
|
|
1728
1791
|
)
|
|
1729
1792
|
);
|
|
@@ -1735,15 +1798,15 @@ async function clawmartMeAction(options) {
|
|
|
1735
1798
|
const client = getClient(options);
|
|
1736
1799
|
try {
|
|
1737
1800
|
const me = await client.getMe();
|
|
1738
|
-
console.log(
|
|
1739
|
-
console.log(` Name: ${
|
|
1801
|
+
console.log(import_chalk12.default.blue("\n\u{1F464} ClawMart Profile:"));
|
|
1802
|
+
console.log(` Name: ${import_chalk12.default.bold(me.name)}`);
|
|
1740
1803
|
console.log(` Email: ${me.email}`);
|
|
1741
1804
|
console.log(` Role: ${me.isCreator ? "Creator" : "User"}`);
|
|
1742
1805
|
console.log(
|
|
1743
|
-
` Sub: ${me.subscriptionActive ?
|
|
1806
|
+
` Sub: ${me.subscriptionActive ? import_chalk12.default.green("Active") : import_chalk12.default.red("Inactive")}`
|
|
1744
1807
|
);
|
|
1745
1808
|
} catch (error) {
|
|
1746
|
-
console.error(
|
|
1809
|
+
console.error(import_chalk12.default.red(`\u274C Failed to fetch profile: ${error.message}`));
|
|
1747
1810
|
}
|
|
1748
1811
|
}
|
|
1749
1812
|
async function clawmartListingsAction(options) {
|
|
@@ -1760,22 +1823,22 @@ async function clawmartListingsAction(options) {
|
|
|
1760
1823
|
listings = await client.getListings();
|
|
1761
1824
|
}
|
|
1762
1825
|
if (listings.length === 0) {
|
|
1763
|
-
console.log(
|
|
1826
|
+
console.log(import_chalk12.default.yellow("\n\u{1F4ED} No listings found."));
|
|
1764
1827
|
return;
|
|
1765
1828
|
}
|
|
1766
|
-
console.log(
|
|
1829
|
+
console.log(import_chalk12.default.blue(`
|
|
1767
1830
|
\u{1F3E0} ClawMart Listings (${listings.length}):`));
|
|
1768
1831
|
listings.forEach((l) => {
|
|
1769
|
-
const status = l.published ?
|
|
1770
|
-
console.log(` - ${
|
|
1771
|
-
console.log(` ${
|
|
1832
|
+
const status = l.published ? import_chalk12.default.green("Published") : import_chalk12.default.yellow("Draft");
|
|
1833
|
+
console.log(` - ${import_chalk12.default.bold(l.name)} (${import_chalk12.default.dim(l.id)})`);
|
|
1834
|
+
console.log(` ${import_chalk12.default.italic(l.tagline)}`);
|
|
1772
1835
|
console.log(
|
|
1773
1836
|
` Price: $${l.price} | Type: ${l.productType} | Status: ${status}`
|
|
1774
1837
|
);
|
|
1775
1838
|
console.log("");
|
|
1776
1839
|
});
|
|
1777
1840
|
} catch (error) {
|
|
1778
|
-
console.error(
|
|
1841
|
+
console.error(import_chalk12.default.red(`\u274C Failed to fetch listings: ${error.message}`));
|
|
1779
1842
|
}
|
|
1780
1843
|
}
|
|
1781
1844
|
async function clawmartCreateAction(options) {
|
|
@@ -1791,12 +1854,12 @@ async function clawmartCreateAction(options) {
|
|
|
1791
1854
|
productType: options.type
|
|
1792
1855
|
};
|
|
1793
1856
|
const listing = await client.createListing(data);
|
|
1794
|
-
console.log(
|
|
1857
|
+
console.log(import_chalk12.default.green(`
|
|
1795
1858
|
\u2705 Listing created successfully!`));
|
|
1796
1859
|
console.log(` ID: ${listing.id}`);
|
|
1797
1860
|
console.log(` Name: ${listing.name}`);
|
|
1798
1861
|
} catch (error) {
|
|
1799
|
-
console.error(
|
|
1862
|
+
console.error(import_chalk12.default.red(`\u274C Failed to create listing: ${error.message}`));
|
|
1800
1863
|
}
|
|
1801
1864
|
}
|
|
1802
1865
|
async function clawmartUploadAction(id, files, options) {
|
|
@@ -1814,11 +1877,11 @@ async function clawmartUploadAction(id, files, options) {
|
|
|
1814
1877
|
});
|
|
1815
1878
|
await client.uploadVersion(id, fileData);
|
|
1816
1879
|
console.log(
|
|
1817
|
-
|
|
1880
|
+
import_chalk12.default.green(`
|
|
1818
1881
|
\u2705 New version uploaded successfully to listing ${id}!`)
|
|
1819
1882
|
);
|
|
1820
1883
|
} catch (error) {
|
|
1821
|
-
console.error(
|
|
1884
|
+
console.error(import_chalk12.default.red(`\u274C Failed to upload version: ${error.message}`));
|
|
1822
1885
|
}
|
|
1823
1886
|
}
|
|
1824
1887
|
async function clawmartDownloadAction(idOrSlug, options) {
|
|
@@ -1838,11 +1901,11 @@ async function clawmartDownloadAction(idOrSlug, options) {
|
|
|
1838
1901
|
import_fs6.default.writeFileSync(filePath, f.content);
|
|
1839
1902
|
});
|
|
1840
1903
|
console.log(
|
|
1841
|
-
|
|
1904
|
+
import_chalk12.default.green(`
|
|
1842
1905
|
\u2705 Package ${idOrSlug} downloaded to ${outDir}`)
|
|
1843
1906
|
);
|
|
1844
1907
|
} catch (error) {
|
|
1845
|
-
console.error(
|
|
1908
|
+
console.error(import_chalk12.default.red(`\u274C Failed to download package: ${error.message}`));
|
|
1846
1909
|
}
|
|
1847
1910
|
}
|
|
1848
1911
|
var clawmartHelpText = `
|
|
@@ -2030,4 +2093,7 @@ clawmart.command("upload").description("Upload content to a listing").argument("
|
|
|
2030
2093
|
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
2094
|
await clawmartDownloadAction(idOrSlug, options);
|
|
2032
2095
|
});
|
|
2096
|
+
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) => {
|
|
2097
|
+
await bugAction(message, options);
|
|
2098
|
+
});
|
|
2033
2099
|
program.parse();
|
package/dist/cli.mjs
CHANGED
|
@@ -523,6 +523,15 @@ async function scanAction(directory, options) {
|
|
|
523
523
|
}
|
|
524
524
|
}
|
|
525
525
|
}
|
|
526
|
+
console.log(chalk3.dim("\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"));
|
|
527
|
+
console.log(chalk3.dim("\u{1F4AC} Found a bug or have a metric idea?"));
|
|
528
|
+
console.log(chalk3.dim("\u{1F449} Copy/paste this to your AI agent:"));
|
|
529
|
+
console.log(
|
|
530
|
+
chalk3.cyan(
|
|
531
|
+
` "Help me report an issue to AIReady. Use 'aiready bug' to prepare a draft."`
|
|
532
|
+
)
|
|
533
|
+
);
|
|
534
|
+
console.log(chalk3.dim("\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"));
|
|
526
535
|
const mapToUnifiedReport = (res, scoring) => {
|
|
527
536
|
const allResults = [];
|
|
528
537
|
const totalFilesSet = /* @__PURE__ */ new Set();
|
|
@@ -1474,8 +1483,62 @@ async function testabilityAction(directory, options) {
|
|
|
1474
1483
|
// src/commands/change-amplification.ts
|
|
1475
1484
|
import { changeAmplificationAction } from "@aiready/change-amplification/dist/cli.js";
|
|
1476
1485
|
|
|
1477
|
-
// src/commands/
|
|
1486
|
+
// src/commands/bug.ts
|
|
1478
1487
|
import chalk11 from "chalk";
|
|
1488
|
+
async function bugAction(message, options) {
|
|
1489
|
+
const repoUrl = "https://github.com/caopengau/aiready-cli";
|
|
1490
|
+
if (message) {
|
|
1491
|
+
const type = options.type || "bug";
|
|
1492
|
+
const title = `[${type.toUpperCase()}] ${message}`;
|
|
1493
|
+
const labels = type === "bug" ? "bug" : type === "feature" ? "enhancement" : "metric";
|
|
1494
|
+
const template = type === "bug" ? "bug_report.md" : type === "feature" ? "feature_request.md" : "new_metric_idea.md";
|
|
1495
|
+
const body = `
|
|
1496
|
+
## Description
|
|
1497
|
+
${message}
|
|
1498
|
+
|
|
1499
|
+
## Context
|
|
1500
|
+
Generated via AIReady CLI 'bug' command.
|
|
1501
|
+
Type: ${type}
|
|
1502
|
+
`.trim();
|
|
1503
|
+
const fullUrl = `${repoUrl}/issues/new?title=${encodeURIComponent(title)}&body=${encodeURIComponent(body)}&labels=${labels}&template=${template}`;
|
|
1504
|
+
console.log(chalk11.green("\u{1F680} Issue Draft Prepared!\n"));
|
|
1505
|
+
console.log(chalk11.bold("Title: ") + title);
|
|
1506
|
+
console.log(chalk11.bold("Type: ") + type);
|
|
1507
|
+
console.log(chalk11.bold("\nClick the link below to submit this issue:"));
|
|
1508
|
+
console.log(chalk11.cyan(fullUrl));
|
|
1509
|
+
console.log(chalk11.bold("\n\u{1F916} [FOR AI AGENTS]:"));
|
|
1510
|
+
console.log(chalk11.dim(" You have successfully prepared a report."));
|
|
1511
|
+
console.log(
|
|
1512
|
+
chalk11.dim(
|
|
1513
|
+
" Please present the URL above to the user so they can finalize the submission."
|
|
1514
|
+
)
|
|
1515
|
+
);
|
|
1516
|
+
return;
|
|
1517
|
+
}
|
|
1518
|
+
const bugUrl = `${repoUrl}/issues/new?template=bug_report.md`;
|
|
1519
|
+
const featureUrl = `${repoUrl}/issues/new?template=feature_request.md`;
|
|
1520
|
+
const metricUrl = `${repoUrl}/issues/new?template=new_metric_idea.md`;
|
|
1521
|
+
console.log(chalk11.blue("\u{1F4AC} Feedback & Bug Reports\n"));
|
|
1522
|
+
console.log(` Report a Bug: ${chalk11.cyan(bugUrl)}`);
|
|
1523
|
+
console.log(` Request a Feature: ${chalk11.cyan(featureUrl)}`);
|
|
1524
|
+
console.log(` Suggest a Metric: ${chalk11.cyan(metricUrl)}`);
|
|
1525
|
+
console.log(chalk11.bold("\n\u{1F916} [FOR AI AGENTS]:"));
|
|
1526
|
+
console.log(chalk11.dim(" To prepare a specific report, run:"));
|
|
1527
|
+
console.log(
|
|
1528
|
+
chalk11.cyan(
|
|
1529
|
+
' aiready bug "your description here" --type bug|feature|metric'
|
|
1530
|
+
)
|
|
1531
|
+
);
|
|
1532
|
+
}
|
|
1533
|
+
var bugHelpText = `
|
|
1534
|
+
EXAMPLES:
|
|
1535
|
+
$ aiready bug # Show general links
|
|
1536
|
+
$ aiready bug "Naming check is too slow" # Prepare a pre-filled bug report
|
|
1537
|
+
$ aiready bug "Add CO2 impact metric" --type metric # Prepare a metric suggestion
|
|
1538
|
+
`;
|
|
1539
|
+
|
|
1540
|
+
// src/commands/clawmart.ts
|
|
1541
|
+
import chalk12 from "chalk";
|
|
1479
1542
|
import fs2 from "fs";
|
|
1480
1543
|
import { resolve as resolvePath8 } from "path";
|
|
1481
1544
|
import {
|
|
@@ -1484,9 +1547,9 @@ import {
|
|
|
1484
1547
|
function getClient(options) {
|
|
1485
1548
|
const apiKey = options.apiKey || process.env.CLAWMART_API_KEY;
|
|
1486
1549
|
if (!apiKey) {
|
|
1487
|
-
console.error(
|
|
1550
|
+
console.error(chalk12.red("\u274C ClawMart API Key is required."));
|
|
1488
1551
|
console.log(
|
|
1489
|
-
|
|
1552
|
+
chalk12.dim(
|
|
1490
1553
|
" Set CLAWMART_API_KEY environment variable or use --api-key flag."
|
|
1491
1554
|
)
|
|
1492
1555
|
);
|
|
@@ -1498,15 +1561,15 @@ async function clawmartMeAction(options) {
|
|
|
1498
1561
|
const client = getClient(options);
|
|
1499
1562
|
try {
|
|
1500
1563
|
const me = await client.getMe();
|
|
1501
|
-
console.log(
|
|
1502
|
-
console.log(` Name: ${
|
|
1564
|
+
console.log(chalk12.blue("\n\u{1F464} ClawMart Profile:"));
|
|
1565
|
+
console.log(` Name: ${chalk12.bold(me.name)}`);
|
|
1503
1566
|
console.log(` Email: ${me.email}`);
|
|
1504
1567
|
console.log(` Role: ${me.isCreator ? "Creator" : "User"}`);
|
|
1505
1568
|
console.log(
|
|
1506
|
-
` Sub: ${me.subscriptionActive ?
|
|
1569
|
+
` Sub: ${me.subscriptionActive ? chalk12.green("Active") : chalk12.red("Inactive")}`
|
|
1507
1570
|
);
|
|
1508
1571
|
} catch (error) {
|
|
1509
|
-
console.error(
|
|
1572
|
+
console.error(chalk12.red(`\u274C Failed to fetch profile: ${error.message}`));
|
|
1510
1573
|
}
|
|
1511
1574
|
}
|
|
1512
1575
|
async function clawmartListingsAction(options) {
|
|
@@ -1523,22 +1586,22 @@ async function clawmartListingsAction(options) {
|
|
|
1523
1586
|
listings = await client.getListings();
|
|
1524
1587
|
}
|
|
1525
1588
|
if (listings.length === 0) {
|
|
1526
|
-
console.log(
|
|
1589
|
+
console.log(chalk12.yellow("\n\u{1F4ED} No listings found."));
|
|
1527
1590
|
return;
|
|
1528
1591
|
}
|
|
1529
|
-
console.log(
|
|
1592
|
+
console.log(chalk12.blue(`
|
|
1530
1593
|
\u{1F3E0} ClawMart Listings (${listings.length}):`));
|
|
1531
1594
|
listings.forEach((l) => {
|
|
1532
|
-
const status = l.published ?
|
|
1533
|
-
console.log(` - ${
|
|
1534
|
-
console.log(` ${
|
|
1595
|
+
const status = l.published ? chalk12.green("Published") : chalk12.yellow("Draft");
|
|
1596
|
+
console.log(` - ${chalk12.bold(l.name)} (${chalk12.dim(l.id)})`);
|
|
1597
|
+
console.log(` ${chalk12.italic(l.tagline)}`);
|
|
1535
1598
|
console.log(
|
|
1536
1599
|
` Price: $${l.price} | Type: ${l.productType} | Status: ${status}`
|
|
1537
1600
|
);
|
|
1538
1601
|
console.log("");
|
|
1539
1602
|
});
|
|
1540
1603
|
} catch (error) {
|
|
1541
|
-
console.error(
|
|
1604
|
+
console.error(chalk12.red(`\u274C Failed to fetch listings: ${error.message}`));
|
|
1542
1605
|
}
|
|
1543
1606
|
}
|
|
1544
1607
|
async function clawmartCreateAction(options) {
|
|
@@ -1554,12 +1617,12 @@ async function clawmartCreateAction(options) {
|
|
|
1554
1617
|
productType: options.type
|
|
1555
1618
|
};
|
|
1556
1619
|
const listing = await client.createListing(data);
|
|
1557
|
-
console.log(
|
|
1620
|
+
console.log(chalk12.green(`
|
|
1558
1621
|
\u2705 Listing created successfully!`));
|
|
1559
1622
|
console.log(` ID: ${listing.id}`);
|
|
1560
1623
|
console.log(` Name: ${listing.name}`);
|
|
1561
1624
|
} catch (error) {
|
|
1562
|
-
console.error(
|
|
1625
|
+
console.error(chalk12.red(`\u274C Failed to create listing: ${error.message}`));
|
|
1563
1626
|
}
|
|
1564
1627
|
}
|
|
1565
1628
|
async function clawmartUploadAction(id, files, options) {
|
|
@@ -1577,11 +1640,11 @@ async function clawmartUploadAction(id, files, options) {
|
|
|
1577
1640
|
});
|
|
1578
1641
|
await client.uploadVersion(id, fileData);
|
|
1579
1642
|
console.log(
|
|
1580
|
-
|
|
1643
|
+
chalk12.green(`
|
|
1581
1644
|
\u2705 New version uploaded successfully to listing ${id}!`)
|
|
1582
1645
|
);
|
|
1583
1646
|
} catch (error) {
|
|
1584
|
-
console.error(
|
|
1647
|
+
console.error(chalk12.red(`\u274C Failed to upload version: ${error.message}`));
|
|
1585
1648
|
}
|
|
1586
1649
|
}
|
|
1587
1650
|
async function clawmartDownloadAction(idOrSlug, options) {
|
|
@@ -1601,11 +1664,11 @@ async function clawmartDownloadAction(idOrSlug, options) {
|
|
|
1601
1664
|
fs2.writeFileSync(filePath, f.content);
|
|
1602
1665
|
});
|
|
1603
1666
|
console.log(
|
|
1604
|
-
|
|
1667
|
+
chalk12.green(`
|
|
1605
1668
|
\u2705 Package ${idOrSlug} downloaded to ${outDir}`)
|
|
1606
1669
|
);
|
|
1607
1670
|
} catch (error) {
|
|
1608
|
-
console.error(
|
|
1671
|
+
console.error(chalk12.red(`\u274C Failed to download package: ${error.message}`));
|
|
1609
1672
|
}
|
|
1610
1673
|
}
|
|
1611
1674
|
var clawmartHelpText = `
|
|
@@ -1792,4 +1855,7 @@ clawmart.command("upload").description("Upload content to a listing").argument("
|
|
|
1792
1855
|
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
1856
|
await clawmartDownloadAction(idOrSlug, options);
|
|
1794
1857
|
});
|
|
1858
|
+
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) => {
|
|
1859
|
+
await bugAction(message, options);
|
|
1860
|
+
});
|
|
1795
1861
|
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.4",
|
|
4
4
|
"description": "Unified CLI for AIReady analysis tools",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"module": "./dist/index.mjs",
|
|
@@ -11,17 +11,17 @@
|
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"chalk": "^5.3.0",
|
|
13
13
|
"commander": "^14.0.0",
|
|
14
|
-
"@aiready/consistency": "0.19.0",
|
|
15
14
|
"@aiready/clawmart": "0.1.2",
|
|
16
15
|
"@aiready/context-analyzer": "0.20.0",
|
|
17
|
-
"@aiready/
|
|
16
|
+
"@aiready/consistency": "0.19.0",
|
|
18
17
|
"@aiready/core": "0.22.1",
|
|
19
|
-
"@aiready/doc-drift": "0.12.0",
|
|
20
|
-
"@aiready/change-amplification": "0.12.0",
|
|
21
18
|
"@aiready/deps": "0.12.0",
|
|
19
|
+
"@aiready/change-amplification": "0.12.0",
|
|
20
|
+
"@aiready/doc-drift": "0.12.0",
|
|
22
21
|
"@aiready/ai-signal-clarity": "0.12.0",
|
|
23
|
-
"@aiready/
|
|
22
|
+
"@aiready/agent-grounding": "0.12.0",
|
|
24
23
|
"@aiready/testability": "0.5.0",
|
|
24
|
+
"@aiready/visualizer": "0.5.0",
|
|
25
25
|
"@aiready/pattern-detect": "0.15.0"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
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,24 @@ 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(chalk.dim('💬 Found a bug or have a metric idea?'));
|
|
386
|
+
console.log(chalk.dim('👉 Copy/paste this to your AI agent:'));
|
|
387
|
+
console.log(
|
|
388
|
+
chalk.cyan(
|
|
389
|
+
` "Help me report an issue to AIReady. Use 'aiready bug' to prepare a draft."`
|
|
390
|
+
)
|
|
391
|
+
);
|
|
392
|
+
console.log(
|
|
393
|
+
chalk.dim(
|
|
394
|
+
'──────────────────────────────────────────────────────────────────'
|
|
395
|
+
)
|
|
396
|
+
);
|
|
397
|
+
|
|
380
398
|
// Normalized report mapping
|
|
381
399
|
const mapToUnifiedReport = (
|
|
382
400
|
res: any,
|