@react-grab/cli 0.0.81 → 0.0.82
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 +30 -17
- package/dist/cli.js +29 -17
- 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"];
|
|
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,7 +989,8 @@ 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
996
|
if (agent === "none" || agent === "ami") {
|
|
@@ -1084,19 +1086,23 @@ var applyPackageJsonTransform = (result) => {
|
|
|
1084
1086
|
};
|
|
1085
1087
|
|
|
1086
1088
|
// src/commands/add.ts
|
|
1089
|
+
var VERSION = "0.0.82";
|
|
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",
|
|
1096
|
+
amp: "Amp",
|
|
1093
1097
|
ami: "Ami"
|
|
1094
1098
|
};
|
|
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(
|
|
1099
|
+
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)").option("-y, --yes", "skip confirmation prompts", false).option(
|
|
1096
1100
|
"-c, --cwd <cwd>",
|
|
1097
1101
|
"working directory (defaults to current directory)",
|
|
1098
1102
|
process.cwd()
|
|
1099
1103
|
).action(async (agentArg, opts) => {
|
|
1104
|
+
console.log(`${pc__default.default.magenta("\u269B")} ${pc__default.default.bold("React Grab")} ${pc__default.default.gray(VERSION)}`);
|
|
1105
|
+
console.log();
|
|
1100
1106
|
try {
|
|
1101
1107
|
const cwd = opts.cwd;
|
|
1102
1108
|
const isNonInteractive = opts.yes;
|
|
@@ -1112,7 +1118,7 @@ var add = new commander.Command().name("add").description("add an agent integrat
|
|
|
1112
1118
|
process.exit(1);
|
|
1113
1119
|
}
|
|
1114
1120
|
preflightSpinner.succeed();
|
|
1115
|
-
const availableAgents = ["claude-code", "cursor", "opencode", "codex", "gemini", "ami"].filter((agent) => !projectInfo.installedAgents.includes(agent));
|
|
1121
|
+
const availableAgents = ["claude-code", "cursor", "opencode", "codex", "gemini", "amp", "ami"].filter((agent) => !projectInfo.installedAgents.includes(agent));
|
|
1116
1122
|
if (availableAgents.length === 0) {
|
|
1117
1123
|
logger.break();
|
|
1118
1124
|
logger.success("All agent integrations are already installed.");
|
|
@@ -1121,10 +1127,10 @@ var add = new commander.Command().name("add").description("add an agent integrat
|
|
|
1121
1127
|
}
|
|
1122
1128
|
let agentIntegration;
|
|
1123
1129
|
if (agentArg) {
|
|
1124
|
-
if (!["claude-code", "cursor", "opencode", "codex", "gemini", "ami"].includes(agentArg)) {
|
|
1130
|
+
if (!["claude-code", "cursor", "opencode", "codex", "gemini", "amp", "ami"].includes(agentArg)) {
|
|
1125
1131
|
logger.break();
|
|
1126
1132
|
logger.error(`Invalid agent: ${agentArg}`);
|
|
1127
|
-
logger.error("Available agents: claude-code, cursor, opencode, codex, gemini, ami");
|
|
1133
|
+
logger.error("Available agents: claude-code, cursor, opencode, codex, gemini, amp, ami");
|
|
1128
1134
|
logger.break();
|
|
1129
1135
|
process.exit(1);
|
|
1130
1136
|
}
|
|
@@ -1272,7 +1278,7 @@ var add = new commander.Command().name("add").description("add an agent integrat
|
|
|
1272
1278
|
handleError(error);
|
|
1273
1279
|
}
|
|
1274
1280
|
});
|
|
1275
|
-
var
|
|
1281
|
+
var VERSION2 = "0.0.82";
|
|
1276
1282
|
var REPORT_URL = "https://react-grab.com/api/report-cli";
|
|
1277
1283
|
var DOCS_URL = "https://github.com/aidenybai/react-grab";
|
|
1278
1284
|
var reportToCli = async (type, config, error) => {
|
|
@@ -1282,7 +1288,7 @@ var reportToCli = async (type, config, error) => {
|
|
|
1282
1288
|
headers: { "Content-Type": "application/json" },
|
|
1283
1289
|
body: JSON.stringify({
|
|
1284
1290
|
type,
|
|
1285
|
-
version:
|
|
1291
|
+
version: VERSION2,
|
|
1286
1292
|
config,
|
|
1287
1293
|
error: error ? { message: error.message, stack: error.stack } : void 0,
|
|
1288
1294
|
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
@@ -1312,12 +1318,14 @@ var UNSUPPORTED_FRAMEWORK_NAMES = {
|
|
|
1312
1318
|
};
|
|
1313
1319
|
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
1320
|
"-a, --agent <agent>",
|
|
1315
|
-
"agent integration (claude-code, cursor, opencode, codex, gemini, ami)"
|
|
1321
|
+
"agent integration (claude-code, cursor, opencode, codex, gemini, amp, ami)"
|
|
1316
1322
|
).option("--skip-install", "skip package installation", false).option(
|
|
1317
1323
|
"-c, --cwd <cwd>",
|
|
1318
1324
|
"working directory (defaults to current directory)",
|
|
1319
1325
|
process.cwd()
|
|
1320
1326
|
).action(async (opts) => {
|
|
1327
|
+
console.log(`${pc__default.default.magenta("\u269B")} ${pc__default.default.bold("React Grab")} ${pc__default.default.gray(VERSION2)}`);
|
|
1328
|
+
console.log();
|
|
1321
1329
|
try {
|
|
1322
1330
|
const cwd = opts.cwd;
|
|
1323
1331
|
const isNonInteractive = opts.yes;
|
|
@@ -1438,6 +1446,7 @@ var init = new commander.Command().name("init").description("initialize React Gr
|
|
|
1438
1446
|
{ title: "Opencode", value: "opencode" },
|
|
1439
1447
|
{ title: "Codex", value: "codex" },
|
|
1440
1448
|
{ title: "Gemini", value: "gemini" },
|
|
1449
|
+
{ title: "Amp", value: "amp" },
|
|
1441
1450
|
{ title: "Ami", value: "ami" }
|
|
1442
1451
|
]
|
|
1443
1452
|
});
|
|
@@ -1576,6 +1585,7 @@ var init = new commander.Command().name("init").description("initialize React Gr
|
|
|
1576
1585
|
await reportToCli("error", void 0, error);
|
|
1577
1586
|
}
|
|
1578
1587
|
});
|
|
1588
|
+
var VERSION3 = "0.0.82";
|
|
1579
1589
|
var DEFAULT_PROXY_PORT = 2e3;
|
|
1580
1590
|
var REACT_GRAB_SCRIPT = '<script src="//unpkg.com/react-grab/dist/index.global.js"></script>';
|
|
1581
1591
|
var buildProviderScript = (provider) => `<script src="//unpkg.com/${provider}/dist/client.global.js"></script>`;
|
|
@@ -1619,6 +1629,8 @@ var start = new commander.Command().name("start").alias("proxy").description("st
|
|
|
1619
1629
|
"--provider <package>",
|
|
1620
1630
|
"provider package to run via npx (e.g., @react-grab/cursor)"
|
|
1621
1631
|
).action(async (urlArg, opts) => {
|
|
1632
|
+
console.log(`${pc__default.default.magenta("\u269B")} ${pc__default.default.bold("React Grab")} ${pc__default.default.gray(VERSION3)}`);
|
|
1633
|
+
console.log();
|
|
1622
1634
|
let url = urlArg;
|
|
1623
1635
|
let provider = opts.provider;
|
|
1624
1636
|
if (!url) {
|
|
@@ -1645,6 +1657,7 @@ var start = new commander.Command().name("start").alias("proxy").description("st
|
|
|
1645
1657
|
{ title: "Opencode", value: "@react-grab/opencode" },
|
|
1646
1658
|
{ title: "Codex", value: "@react-grab/codex" },
|
|
1647
1659
|
{ title: "Gemini", value: "@react-grab/gemini" },
|
|
1660
|
+
{ title: "Amp", value: "@react-grab/amp" },
|
|
1648
1661
|
{ title: "Ami", value: "@react-grab/ami" }
|
|
1649
1662
|
]
|
|
1650
1663
|
});
|
|
@@ -1793,7 +1806,7 @@ var start = new commander.Command().name("start").alias("proxy").description("st
|
|
|
1793
1806
|
});
|
|
1794
1807
|
|
|
1795
1808
|
// src/cli.ts
|
|
1796
|
-
var
|
|
1809
|
+
var VERSION4 = "0.0.82";
|
|
1797
1810
|
var VERSION_API_URL = "https://react-grab.com/api/version";
|
|
1798
1811
|
process.on("SIGINT", () => process.exit(0));
|
|
1799
1812
|
process.on("SIGTERM", () => process.exit(0));
|
|
@@ -1802,7 +1815,7 @@ try {
|
|
|
1802
1815
|
});
|
|
1803
1816
|
} catch {
|
|
1804
1817
|
}
|
|
1805
|
-
var program = new commander.Command().name("react-grab").description("add React Grab to your project").version(
|
|
1818
|
+
var program = new commander.Command().name("react-grab").description("add React Grab to your project").version(VERSION4, "-v, --version", "display the version number");
|
|
1806
1819
|
program.addCommand(init);
|
|
1807
1820
|
program.addCommand(add);
|
|
1808
1821
|
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"];
|
|
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,7 +981,8 @@ 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
988
|
if (agent === "none" || agent === "ami") {
|
|
@@ -1077,19 +1078,23 @@ var applyPackageJsonTransform = (result) => {
|
|
|
1077
1078
|
};
|
|
1078
1079
|
|
|
1079
1080
|
// src/commands/add.ts
|
|
1081
|
+
var VERSION = "0.0.82";
|
|
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",
|
|
1088
|
+
amp: "Amp",
|
|
1086
1089
|
ami: "Ami"
|
|
1087
1090
|
};
|
|
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(
|
|
1091
|
+
var add = new Command().name("add").description("add an agent integration").argument("[agent]", "agent to add (claude-code, cursor, opencode, codex, gemini, amp, ami)").option("-y, --yes", "skip confirmation prompts", false).option(
|
|
1089
1092
|
"-c, --cwd <cwd>",
|
|
1090
1093
|
"working directory (defaults to current directory)",
|
|
1091
1094
|
process.cwd()
|
|
1092
1095
|
).action(async (agentArg, opts) => {
|
|
1096
|
+
console.log(`${pc.magenta("\u269B")} ${pc.bold("React Grab")} ${pc.gray(VERSION)}`);
|
|
1097
|
+
console.log();
|
|
1093
1098
|
try {
|
|
1094
1099
|
const cwd = opts.cwd;
|
|
1095
1100
|
const isNonInteractive = opts.yes;
|
|
@@ -1105,7 +1110,7 @@ var add = new Command().name("add").description("add an agent integration").argu
|
|
|
1105
1110
|
process.exit(1);
|
|
1106
1111
|
}
|
|
1107
1112
|
preflightSpinner.succeed();
|
|
1108
|
-
const availableAgents = ["claude-code", "cursor", "opencode", "codex", "gemini", "ami"].filter((agent) => !projectInfo.installedAgents.includes(agent));
|
|
1113
|
+
const availableAgents = ["claude-code", "cursor", "opencode", "codex", "gemini", "amp", "ami"].filter((agent) => !projectInfo.installedAgents.includes(agent));
|
|
1109
1114
|
if (availableAgents.length === 0) {
|
|
1110
1115
|
logger.break();
|
|
1111
1116
|
logger.success("All agent integrations are already installed.");
|
|
@@ -1114,10 +1119,10 @@ var add = new Command().name("add").description("add an agent integration").argu
|
|
|
1114
1119
|
}
|
|
1115
1120
|
let agentIntegration;
|
|
1116
1121
|
if (agentArg) {
|
|
1117
|
-
if (!["claude-code", "cursor", "opencode", "codex", "gemini", "ami"].includes(agentArg)) {
|
|
1122
|
+
if (!["claude-code", "cursor", "opencode", "codex", "gemini", "amp", "ami"].includes(agentArg)) {
|
|
1118
1123
|
logger.break();
|
|
1119
1124
|
logger.error(`Invalid agent: ${agentArg}`);
|
|
1120
|
-
logger.error("Available agents: claude-code, cursor, opencode, codex, gemini, ami");
|
|
1125
|
+
logger.error("Available agents: claude-code, cursor, opencode, codex, gemini, amp, ami");
|
|
1121
1126
|
logger.break();
|
|
1122
1127
|
process.exit(1);
|
|
1123
1128
|
}
|
|
@@ -1265,7 +1270,7 @@ var add = new Command().name("add").description("add an agent integration").argu
|
|
|
1265
1270
|
handleError(error);
|
|
1266
1271
|
}
|
|
1267
1272
|
});
|
|
1268
|
-
var
|
|
1273
|
+
var VERSION2 = "0.0.82";
|
|
1269
1274
|
var REPORT_URL = "https://react-grab.com/api/report-cli";
|
|
1270
1275
|
var DOCS_URL = "https://github.com/aidenybai/react-grab";
|
|
1271
1276
|
var reportToCli = async (type, config, error) => {
|
|
@@ -1275,7 +1280,7 @@ var reportToCli = async (type, config, error) => {
|
|
|
1275
1280
|
headers: { "Content-Type": "application/json" },
|
|
1276
1281
|
body: JSON.stringify({
|
|
1277
1282
|
type,
|
|
1278
|
-
version:
|
|
1283
|
+
version: VERSION2,
|
|
1279
1284
|
config,
|
|
1280
1285
|
error: error ? { message: error.message, stack: error.stack } : void 0,
|
|
1281
1286
|
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
@@ -1305,12 +1310,14 @@ var UNSUPPORTED_FRAMEWORK_NAMES = {
|
|
|
1305
1310
|
};
|
|
1306
1311
|
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
1312
|
"-a, --agent <agent>",
|
|
1308
|
-
"agent integration (claude-code, cursor, opencode, codex, gemini, ami)"
|
|
1313
|
+
"agent integration (claude-code, cursor, opencode, codex, gemini, amp, ami)"
|
|
1309
1314
|
).option("--skip-install", "skip package installation", false).option(
|
|
1310
1315
|
"-c, --cwd <cwd>",
|
|
1311
1316
|
"working directory (defaults to current directory)",
|
|
1312
1317
|
process.cwd()
|
|
1313
1318
|
).action(async (opts) => {
|
|
1319
|
+
console.log(`${pc.magenta("\u269B")} ${pc.bold("React Grab")} ${pc.gray(VERSION2)}`);
|
|
1320
|
+
console.log();
|
|
1314
1321
|
try {
|
|
1315
1322
|
const cwd = opts.cwd;
|
|
1316
1323
|
const isNonInteractive = opts.yes;
|
|
@@ -1431,6 +1438,7 @@ var init = new Command().name("init").description("initialize React Grab in your
|
|
|
1431
1438
|
{ title: "Opencode", value: "opencode" },
|
|
1432
1439
|
{ title: "Codex", value: "codex" },
|
|
1433
1440
|
{ title: "Gemini", value: "gemini" },
|
|
1441
|
+
{ title: "Amp", value: "amp" },
|
|
1434
1442
|
{ title: "Ami", value: "ami" }
|
|
1435
1443
|
]
|
|
1436
1444
|
});
|
|
@@ -1569,6 +1577,7 @@ var init = new Command().name("init").description("initialize React Grab in your
|
|
|
1569
1577
|
await reportToCli("error", void 0, error);
|
|
1570
1578
|
}
|
|
1571
1579
|
});
|
|
1580
|
+
var VERSION3 = "0.0.82";
|
|
1572
1581
|
var DEFAULT_PROXY_PORT = 2e3;
|
|
1573
1582
|
var REACT_GRAB_SCRIPT = '<script src="//unpkg.com/react-grab/dist/index.global.js"></script>';
|
|
1574
1583
|
var buildProviderScript = (provider) => `<script src="//unpkg.com/${provider}/dist/client.global.js"></script>`;
|
|
@@ -1612,6 +1621,8 @@ var start = new Command().name("start").alias("proxy").description("start a prox
|
|
|
1612
1621
|
"--provider <package>",
|
|
1613
1622
|
"provider package to run via npx (e.g., @react-grab/cursor)"
|
|
1614
1623
|
).action(async (urlArg, opts) => {
|
|
1624
|
+
console.log(`${pc.magenta("\u269B")} ${pc.bold("React Grab")} ${pc.gray(VERSION3)}`);
|
|
1625
|
+
console.log();
|
|
1615
1626
|
let url = urlArg;
|
|
1616
1627
|
let provider = opts.provider;
|
|
1617
1628
|
if (!url) {
|
|
@@ -1638,6 +1649,7 @@ var start = new Command().name("start").alias("proxy").description("start a prox
|
|
|
1638
1649
|
{ title: "Opencode", value: "@react-grab/opencode" },
|
|
1639
1650
|
{ title: "Codex", value: "@react-grab/codex" },
|
|
1640
1651
|
{ title: "Gemini", value: "@react-grab/gemini" },
|
|
1652
|
+
{ title: "Amp", value: "@react-grab/amp" },
|
|
1641
1653
|
{ title: "Ami", value: "@react-grab/ami" }
|
|
1642
1654
|
]
|
|
1643
1655
|
});
|
|
@@ -1786,7 +1798,7 @@ var start = new Command().name("start").alias("proxy").description("start a prox
|
|
|
1786
1798
|
});
|
|
1787
1799
|
|
|
1788
1800
|
// src/cli.ts
|
|
1789
|
-
var
|
|
1801
|
+
var VERSION4 = "0.0.82";
|
|
1790
1802
|
var VERSION_API_URL = "https://react-grab.com/api/version";
|
|
1791
1803
|
process.on("SIGINT", () => process.exit(0));
|
|
1792
1804
|
process.on("SIGTERM", () => process.exit(0));
|
|
@@ -1795,7 +1807,7 @@ try {
|
|
|
1795
1807
|
});
|
|
1796
1808
|
} catch {
|
|
1797
1809
|
}
|
|
1798
|
-
var program = new Command().name("react-grab").description("add React Grab to your project").version(
|
|
1810
|
+
var program = new Command().name("react-grab").description("add React Grab to your project").version(VERSION4, "-v, --version", "display the version number");
|
|
1799
1811
|
program.addCommand(init);
|
|
1800
1812
|
program.addCommand(add);
|
|
1801
1813
|
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.82",
|
|
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": {
|