@react-grab/cli 0.0.81 → 0.0.83
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 +2 -1
- package/dist/cli.cjs +36 -21
- package/dist/cli.js +35 -21
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -38,7 +38,7 @@ npx @react-grab/cli -p pnpm -a claude-code -y
|
|
|
38
38
|
| `--framework` | `-f` | Framework to configure | `next`, `vite`, `webpack` |
|
|
39
39
|
| `--package-manager` | `-p` | Package manager to use | `npm`, `yarn`, `pnpm`, `bun` |
|
|
40
40
|
| `--router` | `-r` | Next.js router type | `app`, `pages` |
|
|
41
|
-
| `--agent` | `-a` | Agent integration to add | `claude-code`, `cursor`, `opencode`, `codex`, `gemini`, `none` |
|
|
41
|
+
| `--agent` | `-a` | Agent integration to add | `claude-code`, `cursor`, `opencode`, `codex`, `gemini`, `amp`, `none` |
|
|
42
42
|
| `--yes` | `-y` | Skip all confirmation prompts | - |
|
|
43
43
|
| `--skip-install` | - | Skip package installation (only modify files) | - |
|
|
44
44
|
| `--help` | `-h` | Show help | - |
|
|
@@ -84,6 +84,7 @@ The CLI can optionally set up agent integrations for:
|
|
|
84
84
|
- **Opencode** (`-a opencode`) - Send selected elements to Opencode
|
|
85
85
|
- **Codex** (`-a codex`) - Send selected elements to OpenAI Codex
|
|
86
86
|
- **Gemini** (`-a gemini`) - Send selected elements to Google Gemini CLI
|
|
87
|
+
- **Amp** (`-a amp`) - Send selected elements to Amp
|
|
87
88
|
|
|
88
89
|
## Manual Installation
|
|
89
90
|
|
package/dist/cli.cjs
CHANGED
|
@@ -2,18 +2,19 @@
|
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
4
|
var commander = require('commander');
|
|
5
|
+
var pc = require('picocolors');
|
|
5
6
|
var prompts2 = require('prompts');
|
|
6
7
|
var child_process = require('child_process');
|
|
7
8
|
var fs = require('fs');
|
|
8
9
|
var path = require('path');
|
|
9
10
|
var ni = require('@antfu/ni');
|
|
10
|
-
var colors = require('kleur/colors');
|
|
11
11
|
var ora = require('ora');
|
|
12
12
|
var http = require('http');
|
|
13
13
|
var httpProxyMiddleware = require('http-proxy-middleware');
|
|
14
14
|
|
|
15
15
|
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
16
16
|
|
|
17
|
+
var pc__default = /*#__PURE__*/_interopDefault(pc);
|
|
17
18
|
var prompts2__default = /*#__PURE__*/_interopDefault(prompts2);
|
|
18
19
|
var ora__default = /*#__PURE__*/_interopDefault(ora);
|
|
19
20
|
|
|
@@ -241,7 +242,7 @@ var detectReactGrab = (projectRoot) => {
|
|
|
241
242
|
];
|
|
242
243
|
return filesToCheck.some(hasReactGrabInFile);
|
|
243
244
|
};
|
|
244
|
-
var AGENT_PACKAGES = ["@react-grab/claude-code", "@react-grab/cursor", "@react-grab/opencode", "@react-grab/codex", "@react-grab/gemini"];
|
|
245
|
+
var AGENT_PACKAGES = ["@react-grab/claude-code", "@react-grab/cursor", "@react-grab/opencode", "@react-grab/codex", "@react-grab/gemini", "@react-grab/amp", "@react-grab/ami", "@react-grab/instant"];
|
|
245
246
|
var detectUnsupportedFramework = (projectRoot) => {
|
|
246
247
|
const packageJsonPath = path.join(projectRoot, "package.json");
|
|
247
248
|
if (!fs.existsSync(packageJsonPath)) {
|
|
@@ -391,11 +392,11 @@ ${BOLD}File: ${filePath}${RESET}`);
|
|
|
391
392
|
console.log("\u2500".repeat(60));
|
|
392
393
|
};
|
|
393
394
|
var highlighter = {
|
|
394
|
-
error:
|
|
395
|
-
warn:
|
|
396
|
-
info:
|
|
397
|
-
success:
|
|
398
|
-
dim:
|
|
395
|
+
error: pc__default.default.red,
|
|
396
|
+
warn: pc__default.default.yellow,
|
|
397
|
+
info: pc__default.default.cyan,
|
|
398
|
+
success: pc__default.default.green,
|
|
399
|
+
dim: pc__default.default.dim
|
|
399
400
|
};
|
|
400
401
|
|
|
401
402
|
// src/utils/logger.ts
|
|
@@ -988,14 +989,15 @@ var AGENT_PREFIXES = {
|
|
|
988
989
|
cursor: "npx @react-grab/cursor@latest &&",
|
|
989
990
|
opencode: "npx @react-grab/opencode@latest &&",
|
|
990
991
|
codex: "npx @react-grab/codex@latest &&",
|
|
991
|
-
gemini: "npx @react-grab/gemini@latest &&"
|
|
992
|
+
gemini: "npx @react-grab/gemini@latest &&",
|
|
993
|
+
amp: "npx @react-grab/amp@latest &&"
|
|
992
994
|
};
|
|
993
995
|
var previewPackageJsonTransform = (projectRoot, agent, installedAgents) => {
|
|
994
|
-
if (agent === "none" || agent === "ami") {
|
|
996
|
+
if (agent === "none" || agent === "ami" || agent === "instant") {
|
|
995
997
|
return {
|
|
996
998
|
success: true,
|
|
997
999
|
filePath: "",
|
|
998
|
-
message: agent === "ami" ? "Ami does not require package.json modification
|
|
1000
|
+
message: agent === "ami" || agent === "instant" ? `${agent === "ami" ? "Ami" : "Instant"} does not require package.json modification` : "No agent selected, skipping package.json modification",
|
|
999
1001
|
noChanges: true
|
|
1000
1002
|
};
|
|
1001
1003
|
}
|
|
@@ -1084,19 +1086,24 @@ var applyPackageJsonTransform = (result) => {
|
|
|
1084
1086
|
};
|
|
1085
1087
|
|
|
1086
1088
|
// src/commands/add.ts
|
|
1089
|
+
var VERSION = "0.0.83";
|
|
1087
1090
|
var AGENT_NAMES = {
|
|
1088
1091
|
"claude-code": "Claude Code",
|
|
1089
1092
|
cursor: "Cursor",
|
|
1090
1093
|
opencode: "Opencode",
|
|
1091
1094
|
codex: "Codex",
|
|
1092
1095
|
gemini: "Gemini",
|
|
1093
|
-
|
|
1096
|
+
amp: "Amp",
|
|
1097
|
+
ami: "Ami",
|
|
1098
|
+
instant: "Instant"
|
|
1094
1099
|
};
|
|
1095
|
-
var add = new commander.Command().name("add").description("add an agent integration").argument("[agent]", "agent to add (claude-code, cursor, opencode, codex, gemini, ami)").option("-y, --yes", "skip confirmation prompts", false).option(
|
|
1100
|
+
var add = new commander.Command().name("add").description("add an agent integration").argument("[agent]", "agent to add (claude-code, cursor, opencode, codex, gemini, amp, ami, instant)").option("-y, --yes", "skip confirmation prompts", false).option(
|
|
1096
1101
|
"-c, --cwd <cwd>",
|
|
1097
1102
|
"working directory (defaults to current directory)",
|
|
1098
1103
|
process.cwd()
|
|
1099
1104
|
).action(async (agentArg, opts) => {
|
|
1105
|
+
console.log(`${pc__default.default.magenta("\u269B")} ${pc__default.default.bold("React Grab")} ${pc__default.default.gray(VERSION)}`);
|
|
1106
|
+
console.log();
|
|
1100
1107
|
try {
|
|
1101
1108
|
const cwd = opts.cwd;
|
|
1102
1109
|
const isNonInteractive = opts.yes;
|
|
@@ -1112,7 +1119,7 @@ var add = new commander.Command().name("add").description("add an agent integrat
|
|
|
1112
1119
|
process.exit(1);
|
|
1113
1120
|
}
|
|
1114
1121
|
preflightSpinner.succeed();
|
|
1115
|
-
const availableAgents = ["claude-code", "cursor", "opencode", "codex", "gemini", "ami"].filter((agent) => !projectInfo.installedAgents.includes(agent));
|
|
1122
|
+
const availableAgents = ["claude-code", "cursor", "opencode", "codex", "gemini", "amp", "ami", "instant"].filter((agent) => !projectInfo.installedAgents.includes(agent));
|
|
1116
1123
|
if (availableAgents.length === 0) {
|
|
1117
1124
|
logger.break();
|
|
1118
1125
|
logger.success("All agent integrations are already installed.");
|
|
@@ -1121,10 +1128,10 @@ var add = new commander.Command().name("add").description("add an agent integrat
|
|
|
1121
1128
|
}
|
|
1122
1129
|
let agentIntegration;
|
|
1123
1130
|
if (agentArg) {
|
|
1124
|
-
if (!["claude-code", "cursor", "opencode", "codex", "gemini", "ami"].includes(agentArg)) {
|
|
1131
|
+
if (!["claude-code", "cursor", "opencode", "codex", "gemini", "amp", "ami", "instant"].includes(agentArg)) {
|
|
1125
1132
|
logger.break();
|
|
1126
1133
|
logger.error(`Invalid agent: ${agentArg}`);
|
|
1127
|
-
logger.error("Available agents: claude-code, cursor, opencode, codex, gemini, ami");
|
|
1134
|
+
logger.error("Available agents: claude-code, cursor, opencode, codex, gemini, amp, ami, instant");
|
|
1128
1135
|
logger.break();
|
|
1129
1136
|
process.exit(1);
|
|
1130
1137
|
}
|
|
@@ -1272,7 +1279,7 @@ var add = new commander.Command().name("add").description("add an agent integrat
|
|
|
1272
1279
|
handleError(error);
|
|
1273
1280
|
}
|
|
1274
1281
|
});
|
|
1275
|
-
var
|
|
1282
|
+
var VERSION2 = "0.0.83";
|
|
1276
1283
|
var REPORT_URL = "https://react-grab.com/api/report-cli";
|
|
1277
1284
|
var DOCS_URL = "https://github.com/aidenybai/react-grab";
|
|
1278
1285
|
var reportToCli = async (type, config, error) => {
|
|
@@ -1282,7 +1289,7 @@ var reportToCli = async (type, config, error) => {
|
|
|
1282
1289
|
headers: { "Content-Type": "application/json" },
|
|
1283
1290
|
body: JSON.stringify({
|
|
1284
1291
|
type,
|
|
1285
|
-
version:
|
|
1292
|
+
version: VERSION2,
|
|
1286
1293
|
config,
|
|
1287
1294
|
error: error ? { message: error.message, stack: error.stack } : void 0,
|
|
1288
1295
|
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
@@ -1312,12 +1319,14 @@ var UNSUPPORTED_FRAMEWORK_NAMES = {
|
|
|
1312
1319
|
};
|
|
1313
1320
|
var init = new commander.Command().name("init").description("initialize React Grab in your project").option("-y, --yes", "skip confirmation prompts", false).option("-f, --force", "force overwrite existing config", false).option(
|
|
1314
1321
|
"-a, --agent <agent>",
|
|
1315
|
-
"agent integration (claude-code, cursor, opencode, codex, gemini, ami)"
|
|
1322
|
+
"agent integration (claude-code, cursor, opencode, codex, gemini, amp, ami, instant)"
|
|
1316
1323
|
).option("--skip-install", "skip package installation", false).option(
|
|
1317
1324
|
"-c, --cwd <cwd>",
|
|
1318
1325
|
"working directory (defaults to current directory)",
|
|
1319
1326
|
process.cwd()
|
|
1320
1327
|
).action(async (opts) => {
|
|
1328
|
+
console.log(`${pc__default.default.magenta("\u269B")} ${pc__default.default.bold("React Grab")} ${pc__default.default.gray(VERSION2)}`);
|
|
1329
|
+
console.log();
|
|
1321
1330
|
try {
|
|
1322
1331
|
const cwd = opts.cwd;
|
|
1323
1332
|
const isNonInteractive = opts.yes;
|
|
@@ -1438,7 +1447,9 @@ var init = new commander.Command().name("init").description("initialize React Gr
|
|
|
1438
1447
|
{ title: "Opencode", value: "opencode" },
|
|
1439
1448
|
{ title: "Codex", value: "codex" },
|
|
1440
1449
|
{ title: "Gemini", value: "gemini" },
|
|
1441
|
-
{ title: "
|
|
1450
|
+
{ title: "Amp", value: "amp" },
|
|
1451
|
+
{ title: "Ami", value: "ami" },
|
|
1452
|
+
{ title: "Instant", value: "instant" }
|
|
1442
1453
|
]
|
|
1443
1454
|
});
|
|
1444
1455
|
if (agent === void 0) {
|
|
@@ -1576,6 +1587,7 @@ var init = new commander.Command().name("init").description("initialize React Gr
|
|
|
1576
1587
|
await reportToCli("error", void 0, error);
|
|
1577
1588
|
}
|
|
1578
1589
|
});
|
|
1590
|
+
var VERSION3 = "0.0.83";
|
|
1579
1591
|
var DEFAULT_PROXY_PORT = 2e3;
|
|
1580
1592
|
var REACT_GRAB_SCRIPT = '<script src="//unpkg.com/react-grab/dist/index.global.js"></script>';
|
|
1581
1593
|
var buildProviderScript = (provider) => `<script src="//unpkg.com/${provider}/dist/client.global.js"></script>`;
|
|
@@ -1619,6 +1631,8 @@ var start = new commander.Command().name("start").alias("proxy").description("st
|
|
|
1619
1631
|
"--provider <package>",
|
|
1620
1632
|
"provider package to run via npx (e.g., @react-grab/cursor)"
|
|
1621
1633
|
).action(async (urlArg, opts) => {
|
|
1634
|
+
console.log(`${pc__default.default.magenta("\u269B")} ${pc__default.default.bold("React Grab")} ${pc__default.default.gray(VERSION3)}`);
|
|
1635
|
+
console.log();
|
|
1622
1636
|
let url = urlArg;
|
|
1623
1637
|
let provider = opts.provider;
|
|
1624
1638
|
if (!url) {
|
|
@@ -1645,6 +1659,7 @@ var start = new commander.Command().name("start").alias("proxy").description("st
|
|
|
1645
1659
|
{ title: "Opencode", value: "@react-grab/opencode" },
|
|
1646
1660
|
{ title: "Codex", value: "@react-grab/codex" },
|
|
1647
1661
|
{ title: "Gemini", value: "@react-grab/gemini" },
|
|
1662
|
+
{ title: "Amp", value: "@react-grab/amp" },
|
|
1648
1663
|
{ title: "Ami", value: "@react-grab/ami" }
|
|
1649
1664
|
]
|
|
1650
1665
|
});
|
|
@@ -1793,7 +1808,7 @@ var start = new commander.Command().name("start").alias("proxy").description("st
|
|
|
1793
1808
|
});
|
|
1794
1809
|
|
|
1795
1810
|
// src/cli.ts
|
|
1796
|
-
var
|
|
1811
|
+
var VERSION4 = "0.0.83";
|
|
1797
1812
|
var VERSION_API_URL = "https://react-grab.com/api/version";
|
|
1798
1813
|
process.on("SIGINT", () => process.exit(0));
|
|
1799
1814
|
process.on("SIGTERM", () => process.exit(0));
|
|
@@ -1802,7 +1817,7 @@ try {
|
|
|
1802
1817
|
});
|
|
1803
1818
|
} catch {
|
|
1804
1819
|
}
|
|
1805
|
-
var program = new commander.Command().name("react-grab").description("add React Grab to your project").version(
|
|
1820
|
+
var program = new commander.Command().name("react-grab").description("add React Grab to your project").version(VERSION4, "-v, --version", "display the version number");
|
|
1806
1821
|
program.addCommand(init);
|
|
1807
1822
|
program.addCommand(add);
|
|
1808
1823
|
program.addCommand(start);
|
package/dist/cli.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { Command } from 'commander';
|
|
3
|
+
import pc from 'picocolors';
|
|
3
4
|
import prompts2 from 'prompts';
|
|
4
5
|
import { spawn, execSync } from 'child_process';
|
|
5
6
|
import { existsSync, readFileSync, writeFileSync, accessSync, constants, readdirSync } from 'fs';
|
|
6
7
|
import { join, basename } from 'path';
|
|
7
8
|
import { detect } from '@antfu/ni';
|
|
8
|
-
import { cyan, dim, green, yellow, red } from 'kleur/colors';
|
|
9
9
|
import ora from 'ora';
|
|
10
10
|
import { createServer } from 'http';
|
|
11
11
|
import { createProxyMiddleware, responseInterceptor } from 'http-proxy-middleware';
|
|
@@ -234,7 +234,7 @@ var detectReactGrab = (projectRoot) => {
|
|
|
234
234
|
];
|
|
235
235
|
return filesToCheck.some(hasReactGrabInFile);
|
|
236
236
|
};
|
|
237
|
-
var AGENT_PACKAGES = ["@react-grab/claude-code", "@react-grab/cursor", "@react-grab/opencode", "@react-grab/codex", "@react-grab/gemini"];
|
|
237
|
+
var AGENT_PACKAGES = ["@react-grab/claude-code", "@react-grab/cursor", "@react-grab/opencode", "@react-grab/codex", "@react-grab/gemini", "@react-grab/amp", "@react-grab/ami", "@react-grab/instant"];
|
|
238
238
|
var detectUnsupportedFramework = (projectRoot) => {
|
|
239
239
|
const packageJsonPath = join(projectRoot, "package.json");
|
|
240
240
|
if (!existsSync(packageJsonPath)) {
|
|
@@ -384,11 +384,11 @@ ${BOLD}File: ${filePath}${RESET}`);
|
|
|
384
384
|
console.log("\u2500".repeat(60));
|
|
385
385
|
};
|
|
386
386
|
var highlighter = {
|
|
387
|
-
error: red,
|
|
388
|
-
warn: yellow,
|
|
389
|
-
info: cyan,
|
|
390
|
-
success: green,
|
|
391
|
-
dim
|
|
387
|
+
error: pc.red,
|
|
388
|
+
warn: pc.yellow,
|
|
389
|
+
info: pc.cyan,
|
|
390
|
+
success: pc.green,
|
|
391
|
+
dim: pc.dim
|
|
392
392
|
};
|
|
393
393
|
|
|
394
394
|
// src/utils/logger.ts
|
|
@@ -981,14 +981,15 @@ var AGENT_PREFIXES = {
|
|
|
981
981
|
cursor: "npx @react-grab/cursor@latest &&",
|
|
982
982
|
opencode: "npx @react-grab/opencode@latest &&",
|
|
983
983
|
codex: "npx @react-grab/codex@latest &&",
|
|
984
|
-
gemini: "npx @react-grab/gemini@latest &&"
|
|
984
|
+
gemini: "npx @react-grab/gemini@latest &&",
|
|
985
|
+
amp: "npx @react-grab/amp@latest &&"
|
|
985
986
|
};
|
|
986
987
|
var previewPackageJsonTransform = (projectRoot, agent, installedAgents) => {
|
|
987
|
-
if (agent === "none" || agent === "ami") {
|
|
988
|
+
if (agent === "none" || agent === "ami" || agent === "instant") {
|
|
988
989
|
return {
|
|
989
990
|
success: true,
|
|
990
991
|
filePath: "",
|
|
991
|
-
message: agent === "ami" ? "Ami does not require package.json modification
|
|
992
|
+
message: agent === "ami" || agent === "instant" ? `${agent === "ami" ? "Ami" : "Instant"} does not require package.json modification` : "No agent selected, skipping package.json modification",
|
|
992
993
|
noChanges: true
|
|
993
994
|
};
|
|
994
995
|
}
|
|
@@ -1077,19 +1078,24 @@ var applyPackageJsonTransform = (result) => {
|
|
|
1077
1078
|
};
|
|
1078
1079
|
|
|
1079
1080
|
// src/commands/add.ts
|
|
1081
|
+
var VERSION = "0.0.83";
|
|
1080
1082
|
var AGENT_NAMES = {
|
|
1081
1083
|
"claude-code": "Claude Code",
|
|
1082
1084
|
cursor: "Cursor",
|
|
1083
1085
|
opencode: "Opencode",
|
|
1084
1086
|
codex: "Codex",
|
|
1085
1087
|
gemini: "Gemini",
|
|
1086
|
-
|
|
1088
|
+
amp: "Amp",
|
|
1089
|
+
ami: "Ami",
|
|
1090
|
+
instant: "Instant"
|
|
1087
1091
|
};
|
|
1088
|
-
var add = new Command().name("add").description("add an agent integration").argument("[agent]", "agent to add (claude-code, cursor, opencode, codex, gemini, ami)").option("-y, --yes", "skip confirmation prompts", false).option(
|
|
1092
|
+
var add = new Command().name("add").description("add an agent integration").argument("[agent]", "agent to add (claude-code, cursor, opencode, codex, gemini, amp, ami, instant)").option("-y, --yes", "skip confirmation prompts", false).option(
|
|
1089
1093
|
"-c, --cwd <cwd>",
|
|
1090
1094
|
"working directory (defaults to current directory)",
|
|
1091
1095
|
process.cwd()
|
|
1092
1096
|
).action(async (agentArg, opts) => {
|
|
1097
|
+
console.log(`${pc.magenta("\u269B")} ${pc.bold("React Grab")} ${pc.gray(VERSION)}`);
|
|
1098
|
+
console.log();
|
|
1093
1099
|
try {
|
|
1094
1100
|
const cwd = opts.cwd;
|
|
1095
1101
|
const isNonInteractive = opts.yes;
|
|
@@ -1105,7 +1111,7 @@ var add = new Command().name("add").description("add an agent integration").argu
|
|
|
1105
1111
|
process.exit(1);
|
|
1106
1112
|
}
|
|
1107
1113
|
preflightSpinner.succeed();
|
|
1108
|
-
const availableAgents = ["claude-code", "cursor", "opencode", "codex", "gemini", "ami"].filter((agent) => !projectInfo.installedAgents.includes(agent));
|
|
1114
|
+
const availableAgents = ["claude-code", "cursor", "opencode", "codex", "gemini", "amp", "ami", "instant"].filter((agent) => !projectInfo.installedAgents.includes(agent));
|
|
1109
1115
|
if (availableAgents.length === 0) {
|
|
1110
1116
|
logger.break();
|
|
1111
1117
|
logger.success("All agent integrations are already installed.");
|
|
@@ -1114,10 +1120,10 @@ var add = new Command().name("add").description("add an agent integration").argu
|
|
|
1114
1120
|
}
|
|
1115
1121
|
let agentIntegration;
|
|
1116
1122
|
if (agentArg) {
|
|
1117
|
-
if (!["claude-code", "cursor", "opencode", "codex", "gemini", "ami"].includes(agentArg)) {
|
|
1123
|
+
if (!["claude-code", "cursor", "opencode", "codex", "gemini", "amp", "ami", "instant"].includes(agentArg)) {
|
|
1118
1124
|
logger.break();
|
|
1119
1125
|
logger.error(`Invalid agent: ${agentArg}`);
|
|
1120
|
-
logger.error("Available agents: claude-code, cursor, opencode, codex, gemini, ami");
|
|
1126
|
+
logger.error("Available agents: claude-code, cursor, opencode, codex, gemini, amp, ami, instant");
|
|
1121
1127
|
logger.break();
|
|
1122
1128
|
process.exit(1);
|
|
1123
1129
|
}
|
|
@@ -1265,7 +1271,7 @@ var add = new Command().name("add").description("add an agent integration").argu
|
|
|
1265
1271
|
handleError(error);
|
|
1266
1272
|
}
|
|
1267
1273
|
});
|
|
1268
|
-
var
|
|
1274
|
+
var VERSION2 = "0.0.83";
|
|
1269
1275
|
var REPORT_URL = "https://react-grab.com/api/report-cli";
|
|
1270
1276
|
var DOCS_URL = "https://github.com/aidenybai/react-grab";
|
|
1271
1277
|
var reportToCli = async (type, config, error) => {
|
|
@@ -1275,7 +1281,7 @@ var reportToCli = async (type, config, error) => {
|
|
|
1275
1281
|
headers: { "Content-Type": "application/json" },
|
|
1276
1282
|
body: JSON.stringify({
|
|
1277
1283
|
type,
|
|
1278
|
-
version:
|
|
1284
|
+
version: VERSION2,
|
|
1279
1285
|
config,
|
|
1280
1286
|
error: error ? { message: error.message, stack: error.stack } : void 0,
|
|
1281
1287
|
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
@@ -1305,12 +1311,14 @@ var UNSUPPORTED_FRAMEWORK_NAMES = {
|
|
|
1305
1311
|
};
|
|
1306
1312
|
var init = new Command().name("init").description("initialize React Grab in your project").option("-y, --yes", "skip confirmation prompts", false).option("-f, --force", "force overwrite existing config", false).option(
|
|
1307
1313
|
"-a, --agent <agent>",
|
|
1308
|
-
"agent integration (claude-code, cursor, opencode, codex, gemini, ami)"
|
|
1314
|
+
"agent integration (claude-code, cursor, opencode, codex, gemini, amp, ami, instant)"
|
|
1309
1315
|
).option("--skip-install", "skip package installation", false).option(
|
|
1310
1316
|
"-c, --cwd <cwd>",
|
|
1311
1317
|
"working directory (defaults to current directory)",
|
|
1312
1318
|
process.cwd()
|
|
1313
1319
|
).action(async (opts) => {
|
|
1320
|
+
console.log(`${pc.magenta("\u269B")} ${pc.bold("React Grab")} ${pc.gray(VERSION2)}`);
|
|
1321
|
+
console.log();
|
|
1314
1322
|
try {
|
|
1315
1323
|
const cwd = opts.cwd;
|
|
1316
1324
|
const isNonInteractive = opts.yes;
|
|
@@ -1431,7 +1439,9 @@ var init = new Command().name("init").description("initialize React Grab in your
|
|
|
1431
1439
|
{ title: "Opencode", value: "opencode" },
|
|
1432
1440
|
{ title: "Codex", value: "codex" },
|
|
1433
1441
|
{ title: "Gemini", value: "gemini" },
|
|
1434
|
-
{ title: "
|
|
1442
|
+
{ title: "Amp", value: "amp" },
|
|
1443
|
+
{ title: "Ami", value: "ami" },
|
|
1444
|
+
{ title: "Instant", value: "instant" }
|
|
1435
1445
|
]
|
|
1436
1446
|
});
|
|
1437
1447
|
if (agent === void 0) {
|
|
@@ -1569,6 +1579,7 @@ var init = new Command().name("init").description("initialize React Grab in your
|
|
|
1569
1579
|
await reportToCli("error", void 0, error);
|
|
1570
1580
|
}
|
|
1571
1581
|
});
|
|
1582
|
+
var VERSION3 = "0.0.83";
|
|
1572
1583
|
var DEFAULT_PROXY_PORT = 2e3;
|
|
1573
1584
|
var REACT_GRAB_SCRIPT = '<script src="//unpkg.com/react-grab/dist/index.global.js"></script>';
|
|
1574
1585
|
var buildProviderScript = (provider) => `<script src="//unpkg.com/${provider}/dist/client.global.js"></script>`;
|
|
@@ -1612,6 +1623,8 @@ var start = new Command().name("start").alias("proxy").description("start a prox
|
|
|
1612
1623
|
"--provider <package>",
|
|
1613
1624
|
"provider package to run via npx (e.g., @react-grab/cursor)"
|
|
1614
1625
|
).action(async (urlArg, opts) => {
|
|
1626
|
+
console.log(`${pc.magenta("\u269B")} ${pc.bold("React Grab")} ${pc.gray(VERSION3)}`);
|
|
1627
|
+
console.log();
|
|
1615
1628
|
let url = urlArg;
|
|
1616
1629
|
let provider = opts.provider;
|
|
1617
1630
|
if (!url) {
|
|
@@ -1638,6 +1651,7 @@ var start = new Command().name("start").alias("proxy").description("start a prox
|
|
|
1638
1651
|
{ title: "Opencode", value: "@react-grab/opencode" },
|
|
1639
1652
|
{ title: "Codex", value: "@react-grab/codex" },
|
|
1640
1653
|
{ title: "Gemini", value: "@react-grab/gemini" },
|
|
1654
|
+
{ title: "Amp", value: "@react-grab/amp" },
|
|
1641
1655
|
{ title: "Ami", value: "@react-grab/ami" }
|
|
1642
1656
|
]
|
|
1643
1657
|
});
|
|
@@ -1786,7 +1800,7 @@ var start = new Command().name("start").alias("proxy").description("start a prox
|
|
|
1786
1800
|
});
|
|
1787
1801
|
|
|
1788
1802
|
// src/cli.ts
|
|
1789
|
-
var
|
|
1803
|
+
var VERSION4 = "0.0.83";
|
|
1790
1804
|
var VERSION_API_URL = "https://react-grab.com/api/version";
|
|
1791
1805
|
process.on("SIGINT", () => process.exit(0));
|
|
1792
1806
|
process.on("SIGTERM", () => process.exit(0));
|
|
@@ -1795,7 +1809,7 @@ try {
|
|
|
1795
1809
|
});
|
|
1796
1810
|
} catch {
|
|
1797
1811
|
}
|
|
1798
|
-
var program = new Command().name("react-grab").description("add React Grab to your project").version(
|
|
1812
|
+
var program = new Command().name("react-grab").description("add React Grab to your project").version(VERSION4, "-v, --version", "display the version number");
|
|
1799
1813
|
program.addCommand(init);
|
|
1800
1814
|
program.addCommand(add);
|
|
1801
1815
|
program.addCommand(start);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@react-grab/cli",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.83",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"bin": {
|
|
6
6
|
"react-grab": "./dist/cli.js"
|
|
@@ -24,8 +24,8 @@
|
|
|
24
24
|
"@antfu/ni": "^0.23.0",
|
|
25
25
|
"commander": "^14.0.0",
|
|
26
26
|
"http-proxy-middleware": "^3.0.3",
|
|
27
|
-
"kleur": "^4.1.5",
|
|
28
27
|
"ora": "^8.2.0",
|
|
28
|
+
"picocolors": "^1.1.1",
|
|
29
29
|
"prompts": "^2.4.2"
|
|
30
30
|
},
|
|
31
31
|
"scripts": {
|