@react-grab/cli 0.0.80 → 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 +4 -1
- package/dist/cli.cjs +38 -17
- package/dist/cli.js +37 -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`, `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 | - |
|
|
@@ -82,6 +82,9 @@ The CLI can optionally set up agent integrations for:
|
|
|
82
82
|
- **Claude Code** (`-a claude-code`) - Send selected elements to Claude Code
|
|
83
83
|
- **Cursor** (`-a cursor`) - Send selected elements to Cursor
|
|
84
84
|
- **Opencode** (`-a opencode`) - Send selected elements to Opencode
|
|
85
|
+
- **Codex** (`-a codex`) - Send selected elements to OpenAI Codex
|
|
86
|
+
- **Gemini** (`-a gemini`) - Send selected elements to Google Gemini CLI
|
|
87
|
+
- **Amp** (`-a amp`) - Send selected elements to Amp
|
|
85
88
|
|
|
86
89
|
## Manual Installation
|
|
87
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"];
|
|
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
|
|
@@ -986,7 +987,10 @@ var applyTransform = (result) => {
|
|
|
986
987
|
var AGENT_PREFIXES = {
|
|
987
988
|
"claude-code": "npx @react-grab/claude-code@latest &&",
|
|
988
989
|
cursor: "npx @react-grab/cursor@latest &&",
|
|
989
|
-
opencode: "npx @react-grab/opencode@latest &&"
|
|
990
|
+
opencode: "npx @react-grab/opencode@latest &&",
|
|
991
|
+
codex: "npx @react-grab/codex@latest &&",
|
|
992
|
+
gemini: "npx @react-grab/gemini@latest &&",
|
|
993
|
+
amp: "npx @react-grab/amp@latest &&"
|
|
990
994
|
};
|
|
991
995
|
var previewPackageJsonTransform = (projectRoot, agent, installedAgents) => {
|
|
992
996
|
if (agent === "none" || agent === "ami") {
|
|
@@ -1082,17 +1086,23 @@ var applyPackageJsonTransform = (result) => {
|
|
|
1082
1086
|
};
|
|
1083
1087
|
|
|
1084
1088
|
// src/commands/add.ts
|
|
1089
|
+
var VERSION = "0.0.82";
|
|
1085
1090
|
var AGENT_NAMES = {
|
|
1086
1091
|
"claude-code": "Claude Code",
|
|
1087
1092
|
cursor: "Cursor",
|
|
1088
1093
|
opencode: "Opencode",
|
|
1094
|
+
codex: "Codex",
|
|
1095
|
+
gemini: "Gemini",
|
|
1096
|
+
amp: "Amp",
|
|
1089
1097
|
ami: "Ami"
|
|
1090
1098
|
};
|
|
1091
|
-
var add = new commander.Command().name("add").description("add an agent integration").argument("[agent]", "agent to add (claude-code, cursor, opencode, 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(
|
|
1092
1100
|
"-c, --cwd <cwd>",
|
|
1093
1101
|
"working directory (defaults to current directory)",
|
|
1094
1102
|
process.cwd()
|
|
1095
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();
|
|
1096
1106
|
try {
|
|
1097
1107
|
const cwd = opts.cwd;
|
|
1098
1108
|
const isNonInteractive = opts.yes;
|
|
@@ -1108,7 +1118,7 @@ var add = new commander.Command().name("add").description("add an agent integrat
|
|
|
1108
1118
|
process.exit(1);
|
|
1109
1119
|
}
|
|
1110
1120
|
preflightSpinner.succeed();
|
|
1111
|
-
const availableAgents = ["claude-code", "cursor", "opencode", "ami"].filter((agent) => !projectInfo.installedAgents.includes(agent));
|
|
1121
|
+
const availableAgents = ["claude-code", "cursor", "opencode", "codex", "gemini", "amp", "ami"].filter((agent) => !projectInfo.installedAgents.includes(agent));
|
|
1112
1122
|
if (availableAgents.length === 0) {
|
|
1113
1123
|
logger.break();
|
|
1114
1124
|
logger.success("All agent integrations are already installed.");
|
|
@@ -1117,10 +1127,10 @@ var add = new commander.Command().name("add").description("add an agent integrat
|
|
|
1117
1127
|
}
|
|
1118
1128
|
let agentIntegration;
|
|
1119
1129
|
if (agentArg) {
|
|
1120
|
-
if (!["claude-code", "cursor", "opencode", "ami"].includes(agentArg)) {
|
|
1130
|
+
if (!["claude-code", "cursor", "opencode", "codex", "gemini", "amp", "ami"].includes(agentArg)) {
|
|
1121
1131
|
logger.break();
|
|
1122
1132
|
logger.error(`Invalid agent: ${agentArg}`);
|
|
1123
|
-
logger.error("Available agents: claude-code, cursor, opencode, ami");
|
|
1133
|
+
logger.error("Available agents: claude-code, cursor, opencode, codex, gemini, amp, ami");
|
|
1124
1134
|
logger.break();
|
|
1125
1135
|
process.exit(1);
|
|
1126
1136
|
}
|
|
@@ -1268,7 +1278,7 @@ var add = new commander.Command().name("add").description("add an agent integrat
|
|
|
1268
1278
|
handleError(error);
|
|
1269
1279
|
}
|
|
1270
1280
|
});
|
|
1271
|
-
var
|
|
1281
|
+
var VERSION2 = "0.0.82";
|
|
1272
1282
|
var REPORT_URL = "https://react-grab.com/api/report-cli";
|
|
1273
1283
|
var DOCS_URL = "https://github.com/aidenybai/react-grab";
|
|
1274
1284
|
var reportToCli = async (type, config, error) => {
|
|
@@ -1278,7 +1288,7 @@ var reportToCli = async (type, config, error) => {
|
|
|
1278
1288
|
headers: { "Content-Type": "application/json" },
|
|
1279
1289
|
body: JSON.stringify({
|
|
1280
1290
|
type,
|
|
1281
|
-
version:
|
|
1291
|
+
version: VERSION2,
|
|
1282
1292
|
config,
|
|
1283
1293
|
error: error ? { message: error.message, stack: error.stack } : void 0,
|
|
1284
1294
|
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
@@ -1308,12 +1318,14 @@ var UNSUPPORTED_FRAMEWORK_NAMES = {
|
|
|
1308
1318
|
};
|
|
1309
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(
|
|
1310
1320
|
"-a, --agent <agent>",
|
|
1311
|
-
"agent integration (claude-code, cursor, opencode, ami)"
|
|
1321
|
+
"agent integration (claude-code, cursor, opencode, codex, gemini, amp, ami)"
|
|
1312
1322
|
).option("--skip-install", "skip package installation", false).option(
|
|
1313
1323
|
"-c, --cwd <cwd>",
|
|
1314
1324
|
"working directory (defaults to current directory)",
|
|
1315
1325
|
process.cwd()
|
|
1316
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();
|
|
1317
1329
|
try {
|
|
1318
1330
|
const cwd = opts.cwd;
|
|
1319
1331
|
const isNonInteractive = opts.yes;
|
|
@@ -1432,6 +1444,9 @@ var init = new commander.Command().name("init").description("initialize React Gr
|
|
|
1432
1444
|
{ title: "Claude Code", value: "claude-code" },
|
|
1433
1445
|
{ title: "Cursor", value: "cursor" },
|
|
1434
1446
|
{ title: "Opencode", value: "opencode" },
|
|
1447
|
+
{ title: "Codex", value: "codex" },
|
|
1448
|
+
{ title: "Gemini", value: "gemini" },
|
|
1449
|
+
{ title: "Amp", value: "amp" },
|
|
1435
1450
|
{ title: "Ami", value: "ami" }
|
|
1436
1451
|
]
|
|
1437
1452
|
});
|
|
@@ -1570,6 +1585,7 @@ var init = new commander.Command().name("init").description("initialize React Gr
|
|
|
1570
1585
|
await reportToCli("error", void 0, error);
|
|
1571
1586
|
}
|
|
1572
1587
|
});
|
|
1588
|
+
var VERSION3 = "0.0.82";
|
|
1573
1589
|
var DEFAULT_PROXY_PORT = 2e3;
|
|
1574
1590
|
var REACT_GRAB_SCRIPT = '<script src="//unpkg.com/react-grab/dist/index.global.js"></script>';
|
|
1575
1591
|
var buildProviderScript = (provider) => `<script src="//unpkg.com/${provider}/dist/client.global.js"></script>`;
|
|
@@ -1613,6 +1629,8 @@ var start = new commander.Command().name("start").alias("proxy").description("st
|
|
|
1613
1629
|
"--provider <package>",
|
|
1614
1630
|
"provider package to run via npx (e.g., @react-grab/cursor)"
|
|
1615
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();
|
|
1616
1634
|
let url = urlArg;
|
|
1617
1635
|
let provider = opts.provider;
|
|
1618
1636
|
if (!url) {
|
|
@@ -1637,6 +1655,9 @@ var start = new commander.Command().name("start").alias("proxy").description("st
|
|
|
1637
1655
|
{ title: "Claude Code", value: "@react-grab/claude-code" },
|
|
1638
1656
|
{ title: "Cursor", value: "@react-grab/cursor" },
|
|
1639
1657
|
{ title: "Opencode", value: "@react-grab/opencode" },
|
|
1658
|
+
{ title: "Codex", value: "@react-grab/codex" },
|
|
1659
|
+
{ title: "Gemini", value: "@react-grab/gemini" },
|
|
1660
|
+
{ title: "Amp", value: "@react-grab/amp" },
|
|
1640
1661
|
{ title: "Ami", value: "@react-grab/ami" }
|
|
1641
1662
|
]
|
|
1642
1663
|
});
|
|
@@ -1785,7 +1806,7 @@ var start = new commander.Command().name("start").alias("proxy").description("st
|
|
|
1785
1806
|
});
|
|
1786
1807
|
|
|
1787
1808
|
// src/cli.ts
|
|
1788
|
-
var
|
|
1809
|
+
var VERSION4 = "0.0.82";
|
|
1789
1810
|
var VERSION_API_URL = "https://react-grab.com/api/version";
|
|
1790
1811
|
process.on("SIGINT", () => process.exit(0));
|
|
1791
1812
|
process.on("SIGTERM", () => process.exit(0));
|
|
@@ -1794,7 +1815,7 @@ try {
|
|
|
1794
1815
|
});
|
|
1795
1816
|
} catch {
|
|
1796
1817
|
}
|
|
1797
|
-
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");
|
|
1798
1819
|
program.addCommand(init);
|
|
1799
1820
|
program.addCommand(add);
|
|
1800
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"];
|
|
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
|
|
@@ -979,7 +979,10 @@ var applyTransform = (result) => {
|
|
|
979
979
|
var AGENT_PREFIXES = {
|
|
980
980
|
"claude-code": "npx @react-grab/claude-code@latest &&",
|
|
981
981
|
cursor: "npx @react-grab/cursor@latest &&",
|
|
982
|
-
opencode: "npx @react-grab/opencode@latest &&"
|
|
982
|
+
opencode: "npx @react-grab/opencode@latest &&",
|
|
983
|
+
codex: "npx @react-grab/codex@latest &&",
|
|
984
|
+
gemini: "npx @react-grab/gemini@latest &&",
|
|
985
|
+
amp: "npx @react-grab/amp@latest &&"
|
|
983
986
|
};
|
|
984
987
|
var previewPackageJsonTransform = (projectRoot, agent, installedAgents) => {
|
|
985
988
|
if (agent === "none" || agent === "ami") {
|
|
@@ -1075,17 +1078,23 @@ var applyPackageJsonTransform = (result) => {
|
|
|
1075
1078
|
};
|
|
1076
1079
|
|
|
1077
1080
|
// src/commands/add.ts
|
|
1081
|
+
var VERSION = "0.0.82";
|
|
1078
1082
|
var AGENT_NAMES = {
|
|
1079
1083
|
"claude-code": "Claude Code",
|
|
1080
1084
|
cursor: "Cursor",
|
|
1081
1085
|
opencode: "Opencode",
|
|
1086
|
+
codex: "Codex",
|
|
1087
|
+
gemini: "Gemini",
|
|
1088
|
+
amp: "Amp",
|
|
1082
1089
|
ami: "Ami"
|
|
1083
1090
|
};
|
|
1084
|
-
var add = new Command().name("add").description("add an agent integration").argument("[agent]", "agent to add (claude-code, cursor, opencode, 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(
|
|
1085
1092
|
"-c, --cwd <cwd>",
|
|
1086
1093
|
"working directory (defaults to current directory)",
|
|
1087
1094
|
process.cwd()
|
|
1088
1095
|
).action(async (agentArg, opts) => {
|
|
1096
|
+
console.log(`${pc.magenta("\u269B")} ${pc.bold("React Grab")} ${pc.gray(VERSION)}`);
|
|
1097
|
+
console.log();
|
|
1089
1098
|
try {
|
|
1090
1099
|
const cwd = opts.cwd;
|
|
1091
1100
|
const isNonInteractive = opts.yes;
|
|
@@ -1101,7 +1110,7 @@ var add = new Command().name("add").description("add an agent integration").argu
|
|
|
1101
1110
|
process.exit(1);
|
|
1102
1111
|
}
|
|
1103
1112
|
preflightSpinner.succeed();
|
|
1104
|
-
const availableAgents = ["claude-code", "cursor", "opencode", "ami"].filter((agent) => !projectInfo.installedAgents.includes(agent));
|
|
1113
|
+
const availableAgents = ["claude-code", "cursor", "opencode", "codex", "gemini", "amp", "ami"].filter((agent) => !projectInfo.installedAgents.includes(agent));
|
|
1105
1114
|
if (availableAgents.length === 0) {
|
|
1106
1115
|
logger.break();
|
|
1107
1116
|
logger.success("All agent integrations are already installed.");
|
|
@@ -1110,10 +1119,10 @@ var add = new Command().name("add").description("add an agent integration").argu
|
|
|
1110
1119
|
}
|
|
1111
1120
|
let agentIntegration;
|
|
1112
1121
|
if (agentArg) {
|
|
1113
|
-
if (!["claude-code", "cursor", "opencode", "ami"].includes(agentArg)) {
|
|
1122
|
+
if (!["claude-code", "cursor", "opencode", "codex", "gemini", "amp", "ami"].includes(agentArg)) {
|
|
1114
1123
|
logger.break();
|
|
1115
1124
|
logger.error(`Invalid agent: ${agentArg}`);
|
|
1116
|
-
logger.error("Available agents: claude-code, cursor, opencode, ami");
|
|
1125
|
+
logger.error("Available agents: claude-code, cursor, opencode, codex, gemini, amp, ami");
|
|
1117
1126
|
logger.break();
|
|
1118
1127
|
process.exit(1);
|
|
1119
1128
|
}
|
|
@@ -1261,7 +1270,7 @@ var add = new Command().name("add").description("add an agent integration").argu
|
|
|
1261
1270
|
handleError(error);
|
|
1262
1271
|
}
|
|
1263
1272
|
});
|
|
1264
|
-
var
|
|
1273
|
+
var VERSION2 = "0.0.82";
|
|
1265
1274
|
var REPORT_URL = "https://react-grab.com/api/report-cli";
|
|
1266
1275
|
var DOCS_URL = "https://github.com/aidenybai/react-grab";
|
|
1267
1276
|
var reportToCli = async (type, config, error) => {
|
|
@@ -1271,7 +1280,7 @@ var reportToCli = async (type, config, error) => {
|
|
|
1271
1280
|
headers: { "Content-Type": "application/json" },
|
|
1272
1281
|
body: JSON.stringify({
|
|
1273
1282
|
type,
|
|
1274
|
-
version:
|
|
1283
|
+
version: VERSION2,
|
|
1275
1284
|
config,
|
|
1276
1285
|
error: error ? { message: error.message, stack: error.stack } : void 0,
|
|
1277
1286
|
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
@@ -1301,12 +1310,14 @@ var UNSUPPORTED_FRAMEWORK_NAMES = {
|
|
|
1301
1310
|
};
|
|
1302
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(
|
|
1303
1312
|
"-a, --agent <agent>",
|
|
1304
|
-
"agent integration (claude-code, cursor, opencode, ami)"
|
|
1313
|
+
"agent integration (claude-code, cursor, opencode, codex, gemini, amp, ami)"
|
|
1305
1314
|
).option("--skip-install", "skip package installation", false).option(
|
|
1306
1315
|
"-c, --cwd <cwd>",
|
|
1307
1316
|
"working directory (defaults to current directory)",
|
|
1308
1317
|
process.cwd()
|
|
1309
1318
|
).action(async (opts) => {
|
|
1319
|
+
console.log(`${pc.magenta("\u269B")} ${pc.bold("React Grab")} ${pc.gray(VERSION2)}`);
|
|
1320
|
+
console.log();
|
|
1310
1321
|
try {
|
|
1311
1322
|
const cwd = opts.cwd;
|
|
1312
1323
|
const isNonInteractive = opts.yes;
|
|
@@ -1425,6 +1436,9 @@ var init = new Command().name("init").description("initialize React Grab in your
|
|
|
1425
1436
|
{ title: "Claude Code", value: "claude-code" },
|
|
1426
1437
|
{ title: "Cursor", value: "cursor" },
|
|
1427
1438
|
{ title: "Opencode", value: "opencode" },
|
|
1439
|
+
{ title: "Codex", value: "codex" },
|
|
1440
|
+
{ title: "Gemini", value: "gemini" },
|
|
1441
|
+
{ title: "Amp", value: "amp" },
|
|
1428
1442
|
{ title: "Ami", value: "ami" }
|
|
1429
1443
|
]
|
|
1430
1444
|
});
|
|
@@ -1563,6 +1577,7 @@ var init = new Command().name("init").description("initialize React Grab in your
|
|
|
1563
1577
|
await reportToCli("error", void 0, error);
|
|
1564
1578
|
}
|
|
1565
1579
|
});
|
|
1580
|
+
var VERSION3 = "0.0.82";
|
|
1566
1581
|
var DEFAULT_PROXY_PORT = 2e3;
|
|
1567
1582
|
var REACT_GRAB_SCRIPT = '<script src="//unpkg.com/react-grab/dist/index.global.js"></script>';
|
|
1568
1583
|
var buildProviderScript = (provider) => `<script src="//unpkg.com/${provider}/dist/client.global.js"></script>`;
|
|
@@ -1606,6 +1621,8 @@ var start = new Command().name("start").alias("proxy").description("start a prox
|
|
|
1606
1621
|
"--provider <package>",
|
|
1607
1622
|
"provider package to run via npx (e.g., @react-grab/cursor)"
|
|
1608
1623
|
).action(async (urlArg, opts) => {
|
|
1624
|
+
console.log(`${pc.magenta("\u269B")} ${pc.bold("React Grab")} ${pc.gray(VERSION3)}`);
|
|
1625
|
+
console.log();
|
|
1609
1626
|
let url = urlArg;
|
|
1610
1627
|
let provider = opts.provider;
|
|
1611
1628
|
if (!url) {
|
|
@@ -1630,6 +1647,9 @@ var start = new Command().name("start").alias("proxy").description("start a prox
|
|
|
1630
1647
|
{ title: "Claude Code", value: "@react-grab/claude-code" },
|
|
1631
1648
|
{ title: "Cursor", value: "@react-grab/cursor" },
|
|
1632
1649
|
{ title: "Opencode", value: "@react-grab/opencode" },
|
|
1650
|
+
{ title: "Codex", value: "@react-grab/codex" },
|
|
1651
|
+
{ title: "Gemini", value: "@react-grab/gemini" },
|
|
1652
|
+
{ title: "Amp", value: "@react-grab/amp" },
|
|
1633
1653
|
{ title: "Ami", value: "@react-grab/ami" }
|
|
1634
1654
|
]
|
|
1635
1655
|
});
|
|
@@ -1778,7 +1798,7 @@ var start = new Command().name("start").alias("proxy").description("start a prox
|
|
|
1778
1798
|
});
|
|
1779
1799
|
|
|
1780
1800
|
// src/cli.ts
|
|
1781
|
-
var
|
|
1801
|
+
var VERSION4 = "0.0.82";
|
|
1782
1802
|
var VERSION_API_URL = "https://react-grab.com/api/version";
|
|
1783
1803
|
process.on("SIGINT", () => process.exit(0));
|
|
1784
1804
|
process.on("SIGTERM", () => process.exit(0));
|
|
@@ -1787,7 +1807,7 @@ try {
|
|
|
1787
1807
|
});
|
|
1788
1808
|
} catch {
|
|
1789
1809
|
}
|
|
1790
|
-
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");
|
|
1791
1811
|
program.addCommand(init);
|
|
1792
1812
|
program.addCommand(add);
|
|
1793
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": {
|