@nexusbloom/cli 0.1.2 → 0.1.3
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/package.json +1 -1
- package/src/index.js +8 -8
package/package.json
CHANGED
package/src/index.js
CHANGED
|
@@ -57,7 +57,7 @@ program
|
|
|
57
57
|
.action(async (opts, cmd) => {
|
|
58
58
|
const jsonMode = cmd.parent.opts().json || opts.json;
|
|
59
59
|
try {
|
|
60
|
-
|
|
60
|
+
const url = new URL("/api/tools", API_BASE);
|
|
61
61
|
if (opts.search) url.searchParams.set("search", opts.search);
|
|
62
62
|
const res = await fetch(url);
|
|
63
63
|
const { tools } = await res.json();
|
|
@@ -83,10 +83,10 @@ program
|
|
|
83
83
|
.command("search")
|
|
84
84
|
.description("Search for tools")
|
|
85
85
|
.argument("<query>", "Search query")
|
|
86
|
-
.action(async (query, cmd) => {
|
|
87
|
-
const jsonMode = cmd
|
|
86
|
+
.action(async (query, opts, cmd) => {
|
|
87
|
+
const jsonMode = (cmd?.parent?.opts().json) || false;
|
|
88
88
|
try {
|
|
89
|
-
|
|
89
|
+
const url = new URL("/api/tools", API_BASE);
|
|
90
90
|
url.searchParams.set("search", query);
|
|
91
91
|
const res = await fetch(url);
|
|
92
92
|
const { tools } = await res.json();
|
|
@@ -313,8 +313,8 @@ program
|
|
|
313
313
|
.command("chat")
|
|
314
314
|
.description("Describe what you want and let NexusBloom route to the right tools")
|
|
315
315
|
.argument("<message>", "What you want to do")
|
|
316
|
-
.action(async (message, cmd) => {
|
|
317
|
-
const jsonMode = cmd
|
|
316
|
+
.action(async (message, opts, cmd) => {
|
|
317
|
+
const jsonMode = (cmd?.parent?.opts().json) || false;
|
|
318
318
|
try {
|
|
319
319
|
if (!jsonMode) console.log(chalk.dim(" Routing your request..."));
|
|
320
320
|
const res = await fetch(`${API_BASE}/api/v1/route`, {
|
|
@@ -351,8 +351,8 @@ program
|
|
|
351
351
|
.command("info")
|
|
352
352
|
.description("Show tool schema and details")
|
|
353
353
|
.argument("<slug>", "Tool slug")
|
|
354
|
-
.action(async (slug, cmd) => {
|
|
355
|
-
const jsonMode = cmd
|
|
354
|
+
.action(async (slug, opts, cmd) => {
|
|
355
|
+
const jsonMode = (cmd?.parent?.opts().json) || false;
|
|
356
356
|
try {
|
|
357
357
|
const res = await fetch(`${API_BASE}/api/run/${slug}`);
|
|
358
358
|
if (!res.ok) {
|