@react-grab/cli 0.1.16 → 0.1.17
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/dist/cli.cjs +44 -39
- package/dist/cli.js +44 -39
- package/package.json +1 -1
package/dist/cli.cjs
CHANGED
|
@@ -651,6 +651,7 @@ var spinner = (text, options) => ora__default.default({ text, isSilent: options?
|
|
|
651
651
|
// src/utils/install-mcp.ts
|
|
652
652
|
var SERVER_NAME = "react-grab-mcp";
|
|
653
653
|
var PACKAGE_NAME = "@react-grab/mcp";
|
|
654
|
+
var getXdgConfigHome = () => process2__default.default.env.XDG_CONFIG_HOME || path__default.default.join(os__default.default.homedir(), ".config");
|
|
654
655
|
var getBaseDir = () => {
|
|
655
656
|
const homeDir = os__default.default.homedir();
|
|
656
657
|
if (process2__default.default.platform === "win32") {
|
|
@@ -659,15 +660,13 @@ var getBaseDir = () => {
|
|
|
659
660
|
if (process2__default.default.platform === "darwin") {
|
|
660
661
|
return path__default.default.join(homeDir, "Library", "Application Support");
|
|
661
662
|
}
|
|
662
|
-
return
|
|
663
|
+
return getXdgConfigHome();
|
|
663
664
|
};
|
|
664
665
|
var getZedConfigPath = () => {
|
|
665
|
-
const homeDir = os__default.default.homedir();
|
|
666
666
|
if (process2__default.default.platform === "win32") {
|
|
667
|
-
|
|
668
|
-
return path__default.default.join(appData, "Zed", "settings.json");
|
|
667
|
+
return path__default.default.join(getBaseDir(), "Zed", "settings.json");
|
|
669
668
|
}
|
|
670
|
-
return path__default.default.join(
|
|
669
|
+
return path__default.default.join(os__default.default.homedir(), ".config", "zed", "settings.json");
|
|
671
670
|
};
|
|
672
671
|
var getClients = () => {
|
|
673
672
|
const homeDir = os__default.default.homedir();
|
|
@@ -677,6 +676,23 @@ var getClients = () => {
|
|
|
677
676
|
args: ["-y", PACKAGE_NAME, "--stdio"]
|
|
678
677
|
};
|
|
679
678
|
return [
|
|
679
|
+
{
|
|
680
|
+
name: "Claude Code",
|
|
681
|
+
configPath: path__default.default.join(homeDir, ".claude.json"),
|
|
682
|
+
configKey: "mcpServers",
|
|
683
|
+
format: "json",
|
|
684
|
+
serverConfig: stdioConfig
|
|
685
|
+
},
|
|
686
|
+
{
|
|
687
|
+
name: "Codex",
|
|
688
|
+
configPath: path__default.default.join(
|
|
689
|
+
process2__default.default.env.CODEX_HOME || path__default.default.join(homeDir, ".codex"),
|
|
690
|
+
"config.toml"
|
|
691
|
+
),
|
|
692
|
+
configKey: "mcp_servers",
|
|
693
|
+
format: "toml",
|
|
694
|
+
serverConfig: stdioConfig
|
|
695
|
+
},
|
|
680
696
|
{
|
|
681
697
|
name: "Cursor",
|
|
682
698
|
configPath: path__default.default.join(homeDir, ".cursor", "mcp.json"),
|
|
@@ -684,6 +700,16 @@ var getClients = () => {
|
|
|
684
700
|
format: "json",
|
|
685
701
|
serverConfig: stdioConfig
|
|
686
702
|
},
|
|
703
|
+
{
|
|
704
|
+
name: "OpenCode",
|
|
705
|
+
configPath: path__default.default.join(getXdgConfigHome(), "opencode", "opencode.json"),
|
|
706
|
+
configKey: "mcp",
|
|
707
|
+
format: "json",
|
|
708
|
+
serverConfig: {
|
|
709
|
+
type: "local",
|
|
710
|
+
command: ["npx", "-y", PACKAGE_NAME, "--stdio"]
|
|
711
|
+
}
|
|
712
|
+
},
|
|
687
713
|
{
|
|
688
714
|
name: "VS Code",
|
|
689
715
|
configPath: path__default.default.join(baseDir, "Code", "User", "mcp.json"),
|
|
@@ -691,13 +717,6 @@ var getClients = () => {
|
|
|
691
717
|
format: "json",
|
|
692
718
|
serverConfig: { type: "stdio", ...stdioConfig }
|
|
693
719
|
},
|
|
694
|
-
{
|
|
695
|
-
name: "Claude Code",
|
|
696
|
-
configPath: path__default.default.join(homeDir, ".claude.json"),
|
|
697
|
-
configKey: "mcpServers",
|
|
698
|
-
format: "json",
|
|
699
|
-
serverConfig: stdioConfig
|
|
700
|
-
},
|
|
701
720
|
{
|
|
702
721
|
name: "Amp",
|
|
703
722
|
configPath: path__default.default.join(homeDir, ".config", "amp", "settings.json"),
|
|
@@ -713,13 +732,10 @@ var getClients = () => {
|
|
|
713
732
|
serverConfig: { type: "stdio", ...stdioConfig }
|
|
714
733
|
},
|
|
715
734
|
{
|
|
716
|
-
name: "
|
|
717
|
-
configPath: path__default.default.join(
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
),
|
|
721
|
-
configKey: "mcp_servers",
|
|
722
|
-
format: "toml",
|
|
735
|
+
name: "Windsurf",
|
|
736
|
+
configPath: path__default.default.join(homeDir, ".codeium", "windsurf", "mcp_config.json"),
|
|
737
|
+
configKey: "mcpServers",
|
|
738
|
+
format: "json",
|
|
723
739
|
serverConfig: stdioConfig
|
|
724
740
|
},
|
|
725
741
|
{
|
|
@@ -728,13 +744,6 @@ var getClients = () => {
|
|
|
728
744
|
configKey: "context_servers",
|
|
729
745
|
format: "json",
|
|
730
746
|
serverConfig: { source: "custom", ...stdioConfig, env: {} }
|
|
731
|
-
},
|
|
732
|
-
{
|
|
733
|
-
name: "Windsurf",
|
|
734
|
-
configPath: path__default.default.join(homeDir, ".codeium", "windsurf", "mcp_config.json"),
|
|
735
|
-
configKey: "mcpServers",
|
|
736
|
-
format: "json",
|
|
737
|
-
serverConfig: stdioConfig
|
|
738
747
|
}
|
|
739
748
|
];
|
|
740
749
|
};
|
|
@@ -749,12 +758,9 @@ var JSONC_FORMAT_OPTIONS = {
|
|
|
749
758
|
insertSpaces: true
|
|
750
759
|
};
|
|
751
760
|
var upsertIntoJsonc = (filePath, content, configKey, serverName, serverConfig) => {
|
|
752
|
-
const edits = jsonc__namespace.modify(
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
serverConfig,
|
|
756
|
-
{ formattingOptions: JSONC_FORMAT_OPTIONS }
|
|
757
|
-
);
|
|
761
|
+
const edits = jsonc__namespace.modify(content, [configKey, serverName], serverConfig, {
|
|
762
|
+
formattingOptions: JSONC_FORMAT_OPTIONS
|
|
763
|
+
});
|
|
758
764
|
fs__default.default.writeFileSync(filePath, jsonc__namespace.applyEdits(content, edits));
|
|
759
765
|
};
|
|
760
766
|
var installJsonClient = (client) => {
|
|
@@ -807,8 +813,7 @@ var installMcpServers = (selectedClients) => {
|
|
|
807
813
|
}
|
|
808
814
|
}
|
|
809
815
|
const successCount = results.filter((result) => result.success).length;
|
|
810
|
-
|
|
811
|
-
if (failedCount > 0) {
|
|
816
|
+
if (successCount < results.length) {
|
|
812
817
|
installSpinner.warn(
|
|
813
818
|
`Installed to ${successCount}/${results.length} agents.`
|
|
814
819
|
);
|
|
@@ -2223,7 +2228,7 @@ var previewCdnTransform = (projectRoot, framework, nextRouterType, targetCdnDoma
|
|
|
2223
2228
|
};
|
|
2224
2229
|
|
|
2225
2230
|
// src/commands/add.ts
|
|
2226
|
-
var VERSION = "0.1.
|
|
2231
|
+
var VERSION = "0.1.17";
|
|
2227
2232
|
var formatInstalledAgentNames = (agents) => agents.map((agent) => AGENT_NAMES[agent] || agent).join(", ");
|
|
2228
2233
|
var add = new commander.Command().name("add").alias("install").description("connect React Grab to your agent").argument("[agent]", `agent to connect (${AGENTS.join(", ")}, mcp)`).option("-y, --yes", "skip confirmation prompts", false).option(
|
|
2229
2234
|
"-c, --cwd <cwd>",
|
|
@@ -2584,7 +2589,7 @@ var MAX_KEY_HOLD_DURATION_MS = 2e3;
|
|
|
2584
2589
|
var MAX_CONTEXT_LINES = 50;
|
|
2585
2590
|
|
|
2586
2591
|
// src/commands/configure.ts
|
|
2587
|
-
var VERSION2 = "0.1.
|
|
2592
|
+
var VERSION2 = "0.1.17";
|
|
2588
2593
|
var isMac = process.platform === "darwin";
|
|
2589
2594
|
var META_LABEL = isMac ? "Cmd" : "Win";
|
|
2590
2595
|
var ALT_LABEL = isMac ? "Option" : "Alt";
|
|
@@ -3140,7 +3145,7 @@ var uninstallPackagesWithFeedback = (packages, packageManager, projectRoot) => {
|
|
|
3140
3145
|
};
|
|
3141
3146
|
|
|
3142
3147
|
// src/commands/init.ts
|
|
3143
|
-
var VERSION3 = "0.1.
|
|
3148
|
+
var VERSION3 = "0.1.17";
|
|
3144
3149
|
var REPORT_URL = "https://react-grab.com/api/report-cli";
|
|
3145
3150
|
var DOCS_URL = "https://github.com/aidenybai/react-grab";
|
|
3146
3151
|
var reportToCli = (type, config, error) => {
|
|
@@ -3998,7 +4003,7 @@ var init = new commander.Command().name("init").description("initialize React Gr
|
|
|
3998
4003
|
reportToCli("error", void 0, error);
|
|
3999
4004
|
}
|
|
4000
4005
|
});
|
|
4001
|
-
var VERSION4 = "0.1.
|
|
4006
|
+
var VERSION4 = "0.1.17";
|
|
4002
4007
|
var remove = new commander.Command().name("remove").description("disconnect React Grab from your agent").argument("[agent]", `agent to disconnect (${AGENTS.join(", ")}, mcp)`).option("-y, --yes", "skip confirmation prompts", false).option(
|
|
4003
4008
|
"-c, --cwd <cwd>",
|
|
4004
4009
|
"working directory (defaults to current directory)",
|
|
@@ -4174,7 +4179,7 @@ var remove = new commander.Command().name("remove").description("disconnect Reac
|
|
|
4174
4179
|
});
|
|
4175
4180
|
|
|
4176
4181
|
// src/cli.ts
|
|
4177
|
-
var VERSION5 = "0.1.
|
|
4182
|
+
var VERSION5 = "0.1.17";
|
|
4178
4183
|
var VERSION_API_URL = "https://www.react-grab.com/api/version";
|
|
4179
4184
|
process.on("SIGINT", () => process.exit(0));
|
|
4180
4185
|
process.on("SIGTERM", () => process.exit(0));
|
package/dist/cli.js
CHANGED
|
@@ -618,6 +618,7 @@ var spinner = (text, options) => ora({ text, isSilent: options?.silent });
|
|
|
618
618
|
// src/utils/install-mcp.ts
|
|
619
619
|
var SERVER_NAME = "react-grab-mcp";
|
|
620
620
|
var PACKAGE_NAME = "@react-grab/mcp";
|
|
621
|
+
var getXdgConfigHome = () => process2.env.XDG_CONFIG_HOME || path.join(os.homedir(), ".config");
|
|
621
622
|
var getBaseDir = () => {
|
|
622
623
|
const homeDir = os.homedir();
|
|
623
624
|
if (process2.platform === "win32") {
|
|
@@ -626,15 +627,13 @@ var getBaseDir = () => {
|
|
|
626
627
|
if (process2.platform === "darwin") {
|
|
627
628
|
return path.join(homeDir, "Library", "Application Support");
|
|
628
629
|
}
|
|
629
|
-
return
|
|
630
|
+
return getXdgConfigHome();
|
|
630
631
|
};
|
|
631
632
|
var getZedConfigPath = () => {
|
|
632
|
-
const homeDir = os.homedir();
|
|
633
633
|
if (process2.platform === "win32") {
|
|
634
|
-
|
|
635
|
-
return path.join(appData, "Zed", "settings.json");
|
|
634
|
+
return path.join(getBaseDir(), "Zed", "settings.json");
|
|
636
635
|
}
|
|
637
|
-
return path.join(
|
|
636
|
+
return path.join(os.homedir(), ".config", "zed", "settings.json");
|
|
638
637
|
};
|
|
639
638
|
var getClients = () => {
|
|
640
639
|
const homeDir = os.homedir();
|
|
@@ -644,6 +643,23 @@ var getClients = () => {
|
|
|
644
643
|
args: ["-y", PACKAGE_NAME, "--stdio"]
|
|
645
644
|
};
|
|
646
645
|
return [
|
|
646
|
+
{
|
|
647
|
+
name: "Claude Code",
|
|
648
|
+
configPath: path.join(homeDir, ".claude.json"),
|
|
649
|
+
configKey: "mcpServers",
|
|
650
|
+
format: "json",
|
|
651
|
+
serverConfig: stdioConfig
|
|
652
|
+
},
|
|
653
|
+
{
|
|
654
|
+
name: "Codex",
|
|
655
|
+
configPath: path.join(
|
|
656
|
+
process2.env.CODEX_HOME || path.join(homeDir, ".codex"),
|
|
657
|
+
"config.toml"
|
|
658
|
+
),
|
|
659
|
+
configKey: "mcp_servers",
|
|
660
|
+
format: "toml",
|
|
661
|
+
serverConfig: stdioConfig
|
|
662
|
+
},
|
|
647
663
|
{
|
|
648
664
|
name: "Cursor",
|
|
649
665
|
configPath: path.join(homeDir, ".cursor", "mcp.json"),
|
|
@@ -651,6 +667,16 @@ var getClients = () => {
|
|
|
651
667
|
format: "json",
|
|
652
668
|
serverConfig: stdioConfig
|
|
653
669
|
},
|
|
670
|
+
{
|
|
671
|
+
name: "OpenCode",
|
|
672
|
+
configPath: path.join(getXdgConfigHome(), "opencode", "opencode.json"),
|
|
673
|
+
configKey: "mcp",
|
|
674
|
+
format: "json",
|
|
675
|
+
serverConfig: {
|
|
676
|
+
type: "local",
|
|
677
|
+
command: ["npx", "-y", PACKAGE_NAME, "--stdio"]
|
|
678
|
+
}
|
|
679
|
+
},
|
|
654
680
|
{
|
|
655
681
|
name: "VS Code",
|
|
656
682
|
configPath: path.join(baseDir, "Code", "User", "mcp.json"),
|
|
@@ -658,13 +684,6 @@ var getClients = () => {
|
|
|
658
684
|
format: "json",
|
|
659
685
|
serverConfig: { type: "stdio", ...stdioConfig }
|
|
660
686
|
},
|
|
661
|
-
{
|
|
662
|
-
name: "Claude Code",
|
|
663
|
-
configPath: path.join(homeDir, ".claude.json"),
|
|
664
|
-
configKey: "mcpServers",
|
|
665
|
-
format: "json",
|
|
666
|
-
serverConfig: stdioConfig
|
|
667
|
-
},
|
|
668
687
|
{
|
|
669
688
|
name: "Amp",
|
|
670
689
|
configPath: path.join(homeDir, ".config", "amp", "settings.json"),
|
|
@@ -680,13 +699,10 @@ var getClients = () => {
|
|
|
680
699
|
serverConfig: { type: "stdio", ...stdioConfig }
|
|
681
700
|
},
|
|
682
701
|
{
|
|
683
|
-
name: "
|
|
684
|
-
configPath: path.join(
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
),
|
|
688
|
-
configKey: "mcp_servers",
|
|
689
|
-
format: "toml",
|
|
702
|
+
name: "Windsurf",
|
|
703
|
+
configPath: path.join(homeDir, ".codeium", "windsurf", "mcp_config.json"),
|
|
704
|
+
configKey: "mcpServers",
|
|
705
|
+
format: "json",
|
|
690
706
|
serverConfig: stdioConfig
|
|
691
707
|
},
|
|
692
708
|
{
|
|
@@ -695,13 +711,6 @@ var getClients = () => {
|
|
|
695
711
|
configKey: "context_servers",
|
|
696
712
|
format: "json",
|
|
697
713
|
serverConfig: { source: "custom", ...stdioConfig, env: {} }
|
|
698
|
-
},
|
|
699
|
-
{
|
|
700
|
-
name: "Windsurf",
|
|
701
|
-
configPath: path.join(homeDir, ".codeium", "windsurf", "mcp_config.json"),
|
|
702
|
-
configKey: "mcpServers",
|
|
703
|
-
format: "json",
|
|
704
|
-
serverConfig: stdioConfig
|
|
705
714
|
}
|
|
706
715
|
];
|
|
707
716
|
};
|
|
@@ -716,12 +725,9 @@ var JSONC_FORMAT_OPTIONS = {
|
|
|
716
725
|
insertSpaces: true
|
|
717
726
|
};
|
|
718
727
|
var upsertIntoJsonc = (filePath, content, configKey, serverName, serverConfig) => {
|
|
719
|
-
const edits = jsonc.modify(
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
serverConfig,
|
|
723
|
-
{ formattingOptions: JSONC_FORMAT_OPTIONS }
|
|
724
|
-
);
|
|
728
|
+
const edits = jsonc.modify(content, [configKey, serverName], serverConfig, {
|
|
729
|
+
formattingOptions: JSONC_FORMAT_OPTIONS
|
|
730
|
+
});
|
|
725
731
|
fs.writeFileSync(filePath, jsonc.applyEdits(content, edits));
|
|
726
732
|
};
|
|
727
733
|
var installJsonClient = (client) => {
|
|
@@ -774,8 +780,7 @@ var installMcpServers = (selectedClients) => {
|
|
|
774
780
|
}
|
|
775
781
|
}
|
|
776
782
|
const successCount = results.filter((result) => result.success).length;
|
|
777
|
-
|
|
778
|
-
if (failedCount > 0) {
|
|
783
|
+
if (successCount < results.length) {
|
|
779
784
|
installSpinner.warn(
|
|
780
785
|
`Installed to ${successCount}/${results.length} agents.`
|
|
781
786
|
);
|
|
@@ -2190,7 +2195,7 @@ var previewCdnTransform = (projectRoot, framework, nextRouterType, targetCdnDoma
|
|
|
2190
2195
|
};
|
|
2191
2196
|
|
|
2192
2197
|
// src/commands/add.ts
|
|
2193
|
-
var VERSION = "0.1.
|
|
2198
|
+
var VERSION = "0.1.17";
|
|
2194
2199
|
var formatInstalledAgentNames = (agents) => agents.map((agent) => AGENT_NAMES[agent] || agent).join(", ");
|
|
2195
2200
|
var add = new Command().name("add").alias("install").description("connect React Grab to your agent").argument("[agent]", `agent to connect (${AGENTS.join(", ")}, mcp)`).option("-y, --yes", "skip confirmation prompts", false).option(
|
|
2196
2201
|
"-c, --cwd <cwd>",
|
|
@@ -2551,7 +2556,7 @@ var MAX_KEY_HOLD_DURATION_MS = 2e3;
|
|
|
2551
2556
|
var MAX_CONTEXT_LINES = 50;
|
|
2552
2557
|
|
|
2553
2558
|
// src/commands/configure.ts
|
|
2554
|
-
var VERSION2 = "0.1.
|
|
2559
|
+
var VERSION2 = "0.1.17";
|
|
2555
2560
|
var isMac = process.platform === "darwin";
|
|
2556
2561
|
var META_LABEL = isMac ? "Cmd" : "Win";
|
|
2557
2562
|
var ALT_LABEL = isMac ? "Option" : "Alt";
|
|
@@ -3107,7 +3112,7 @@ var uninstallPackagesWithFeedback = (packages, packageManager, projectRoot) => {
|
|
|
3107
3112
|
};
|
|
3108
3113
|
|
|
3109
3114
|
// src/commands/init.ts
|
|
3110
|
-
var VERSION3 = "0.1.
|
|
3115
|
+
var VERSION3 = "0.1.17";
|
|
3111
3116
|
var REPORT_URL = "https://react-grab.com/api/report-cli";
|
|
3112
3117
|
var DOCS_URL = "https://github.com/aidenybai/react-grab";
|
|
3113
3118
|
var reportToCli = (type, config, error) => {
|
|
@@ -3965,7 +3970,7 @@ var init = new Command().name("init").description("initialize React Grab in your
|
|
|
3965
3970
|
reportToCli("error", void 0, error);
|
|
3966
3971
|
}
|
|
3967
3972
|
});
|
|
3968
|
-
var VERSION4 = "0.1.
|
|
3973
|
+
var VERSION4 = "0.1.17";
|
|
3969
3974
|
var remove = new Command().name("remove").description("disconnect React Grab from your agent").argument("[agent]", `agent to disconnect (${AGENTS.join(", ")}, mcp)`).option("-y, --yes", "skip confirmation prompts", false).option(
|
|
3970
3975
|
"-c, --cwd <cwd>",
|
|
3971
3976
|
"working directory (defaults to current directory)",
|
|
@@ -4141,7 +4146,7 @@ var remove = new Command().name("remove").description("disconnect React Grab fro
|
|
|
4141
4146
|
});
|
|
4142
4147
|
|
|
4143
4148
|
// src/cli.ts
|
|
4144
|
-
var VERSION5 = "0.1.
|
|
4149
|
+
var VERSION5 = "0.1.17";
|
|
4145
4150
|
var VERSION_API_URL = "https://www.react-grab.com/api/version";
|
|
4146
4151
|
process.on("SIGINT", () => process.exit(0));
|
|
4147
4152
|
process.on("SIGTERM", () => process.exit(0));
|