@agent-nexus/cli 0.1.0 → 0.1.2
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/index.js +179 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -9,6 +9,9 @@ var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
|
9
9
|
var __esm = (fn, res) => function __init() {
|
|
10
10
|
return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
|
|
11
11
|
};
|
|
12
|
+
var __commonJS = (cb, mod) => function __require() {
|
|
13
|
+
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
14
|
+
};
|
|
12
15
|
var __export = (target, all) => {
|
|
13
16
|
for (var name in all)
|
|
14
17
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
@@ -142,6 +145,58 @@ var init_output = __esm({
|
|
|
142
145
|
}
|
|
143
146
|
});
|
|
144
147
|
|
|
148
|
+
// package.json
|
|
149
|
+
var require_package = __commonJS({
|
|
150
|
+
"package.json"(exports2, module2) {
|
|
151
|
+
module2.exports = {
|
|
152
|
+
name: "@agent-nexus/cli",
|
|
153
|
+
version: "0.1.2",
|
|
154
|
+
description: "Official CLI for the Nexus AI agent platform.",
|
|
155
|
+
license: "MIT",
|
|
156
|
+
keywords: [
|
|
157
|
+
"nexus",
|
|
158
|
+
"nexusgpt",
|
|
159
|
+
"ai-agents",
|
|
160
|
+
"cli",
|
|
161
|
+
"typescript"
|
|
162
|
+
],
|
|
163
|
+
repository: {
|
|
164
|
+
type: "git",
|
|
165
|
+
url: "https://github.com/nexusgpt/nexus",
|
|
166
|
+
directory: "packages/cli"
|
|
167
|
+
},
|
|
168
|
+
homepage: "https://github.com/nexusgpt/nexus/tree/main/packages/cli#readme",
|
|
169
|
+
bin: {
|
|
170
|
+
nexus: "./dist/index.js"
|
|
171
|
+
},
|
|
172
|
+
files: [
|
|
173
|
+
"dist"
|
|
174
|
+
],
|
|
175
|
+
publishConfig: {
|
|
176
|
+
access: "public"
|
|
177
|
+
},
|
|
178
|
+
engines: {
|
|
179
|
+
node: ">=18"
|
|
180
|
+
},
|
|
181
|
+
scripts: {
|
|
182
|
+
build: "tsup",
|
|
183
|
+
dev: "tsup --watch",
|
|
184
|
+
typecheck: "tsc --noEmit",
|
|
185
|
+
prepublishOnly: "pnpm run build"
|
|
186
|
+
},
|
|
187
|
+
dependencies: {
|
|
188
|
+
"@agent-nexus/sdk": "workspace:*",
|
|
189
|
+
commander: "^13.0.0"
|
|
190
|
+
},
|
|
191
|
+
devDependencies: {
|
|
192
|
+
"@types/node": "24.6.2",
|
|
193
|
+
tsup: "^8.5.0",
|
|
194
|
+
typescript: "^5.8.3"
|
|
195
|
+
}
|
|
196
|
+
};
|
|
197
|
+
}
|
|
198
|
+
});
|
|
199
|
+
|
|
145
200
|
// src/index.ts
|
|
146
201
|
var import_commander = require("commander");
|
|
147
202
|
|
|
@@ -2511,6 +2566,128 @@ Examples:
|
|
|
2511
2566
|
});
|
|
2512
2567
|
}
|
|
2513
2568
|
|
|
2569
|
+
// src/commands/phone-number.ts
|
|
2570
|
+
init_output();
|
|
2571
|
+
function registerPhoneNumberCommands(program2) {
|
|
2572
|
+
const phoneNumber = program2.command("phone-number").description("Search, buy, and manage phone numbers for SMS/Voice deployments");
|
|
2573
|
+
phoneNumber.command("search").description("Search available phone numbers for purchase").requiredOption("--country <code>", "ISO country code (e.g. US, GB, BE)").option("--type <type>", "Number type: local or mobile", "local").option("--sms", "Require SMS capability").option("--mms", "Require MMS capability").option("--voice", "Require voice capability").option("--area-code <code>", "Filter by area code").addHelpText(
|
|
2574
|
+
"after",
|
|
2575
|
+
`
|
|
2576
|
+
Examples:
|
|
2577
|
+
$ nexus phone-number search --country US --sms --voice
|
|
2578
|
+
$ nexus phone-number search --country GB --type mobile --json`
|
|
2579
|
+
).action(async (opts) => {
|
|
2580
|
+
try {
|
|
2581
|
+
const client = createClient(program2.optsWithGlobals());
|
|
2582
|
+
const result = await client.phoneNumbers.searchAvailable({
|
|
2583
|
+
country: opts.country,
|
|
2584
|
+
type: opts.type,
|
|
2585
|
+
sms: opts.sms ?? false,
|
|
2586
|
+
mms: opts.mms ?? false,
|
|
2587
|
+
voice: opts.voice ?? false,
|
|
2588
|
+
areaCode: opts.areaCode
|
|
2589
|
+
});
|
|
2590
|
+
printTable(result, [
|
|
2591
|
+
{ key: "phoneNumber", label: "PHONE NUMBER", width: 20 },
|
|
2592
|
+
{ key: "friendlyName", label: "FRIENDLY NAME", width: 25 },
|
|
2593
|
+
{ key: "price", label: "PRICE", width: 10 },
|
|
2594
|
+
{ key: "currency", label: "CURRENCY", width: 10 }
|
|
2595
|
+
]);
|
|
2596
|
+
} catch (err) {
|
|
2597
|
+
process.exitCode = handleError(err);
|
|
2598
|
+
}
|
|
2599
|
+
});
|
|
2600
|
+
phoneNumber.command("buy").description("Purchase a phone number").requiredOption("--phone-number <number>", "Phone number to buy (E.164 format)").requiredOption("--country <code>", "ISO country code").requiredOption("--price <price>", "Monthly price").option("--connection-id <id>", "ApiKeyConnection ID for subaccount purchase").addHelpText(
|
|
2601
|
+
"after",
|
|
2602
|
+
`
|
|
2603
|
+
Examples:
|
|
2604
|
+
$ nexus phone-number buy --phone-number +12025551234 --country US --price 1.15
|
|
2605
|
+
$ nexus phone-number buy --phone-number +442071234567 --country GB --price 1.00 --json`
|
|
2606
|
+
).action(async (opts) => {
|
|
2607
|
+
try {
|
|
2608
|
+
const client = createClient(program2.optsWithGlobals());
|
|
2609
|
+
const result = await client.phoneNumbers.buy({
|
|
2610
|
+
phoneNumber: opts.phoneNumber,
|
|
2611
|
+
country: opts.country,
|
|
2612
|
+
price: opts.price,
|
|
2613
|
+
connectionId: opts.connectionId
|
|
2614
|
+
});
|
|
2615
|
+
printRecord(result, [
|
|
2616
|
+
{ key: "id", label: "ID" },
|
|
2617
|
+
{ key: "number", label: "Number" },
|
|
2618
|
+
{ key: "friendlyName", label: "Friendly Name" },
|
|
2619
|
+
{ key: "countryCode", label: "Country" },
|
|
2620
|
+
{ key: "price", label: "Price" },
|
|
2621
|
+
{ key: "region", label: "Region" }
|
|
2622
|
+
]);
|
|
2623
|
+
printSuccess("Phone number purchased successfully");
|
|
2624
|
+
} catch (err) {
|
|
2625
|
+
process.exitCode = handleError(err);
|
|
2626
|
+
}
|
|
2627
|
+
});
|
|
2628
|
+
phoneNumber.command("list").description("List your organization's phone numbers").addHelpText(
|
|
2629
|
+
"after",
|
|
2630
|
+
`
|
|
2631
|
+
Examples:
|
|
2632
|
+
$ nexus phone-number list
|
|
2633
|
+
$ nexus phone-number list --json`
|
|
2634
|
+
).action(async () => {
|
|
2635
|
+
try {
|
|
2636
|
+
const client = createClient(program2.optsWithGlobals());
|
|
2637
|
+
const result = await client.phoneNumbers.list();
|
|
2638
|
+
printTable(result, [
|
|
2639
|
+
{ key: "id", label: "ID", width: 36 },
|
|
2640
|
+
{ key: "number", label: "NUMBER", width: 18 },
|
|
2641
|
+
{ key: "friendlyName", label: "NAME", width: 20 },
|
|
2642
|
+
{ key: "countryCode", label: "COUNTRY", width: 10 },
|
|
2643
|
+
{ key: "price", label: "PRICE", width: 10 },
|
|
2644
|
+
{ key: "region", label: "REGION", width: 8 }
|
|
2645
|
+
]);
|
|
2646
|
+
} catch (err) {
|
|
2647
|
+
process.exitCode = handleError(err);
|
|
2648
|
+
}
|
|
2649
|
+
});
|
|
2650
|
+
phoneNumber.command("get").description("Get phone number details").argument("<id>", "Phone number ID").addHelpText(
|
|
2651
|
+
"after",
|
|
2652
|
+
`
|
|
2653
|
+
Examples:
|
|
2654
|
+
$ nexus phone-number get abc-123
|
|
2655
|
+
$ nexus phone-number get abc-123 --json`
|
|
2656
|
+
).action(async (id) => {
|
|
2657
|
+
try {
|
|
2658
|
+
const client = createClient(program2.optsWithGlobals());
|
|
2659
|
+
const result = await client.phoneNumbers.get(id);
|
|
2660
|
+
printRecord(result, [
|
|
2661
|
+
{ key: "id", label: "ID" },
|
|
2662
|
+
{ key: "number", label: "Number" },
|
|
2663
|
+
{ key: "friendlyName", label: "Friendly Name" },
|
|
2664
|
+
{ key: "countryCode", label: "Country" },
|
|
2665
|
+
{ key: "price", label: "Price" },
|
|
2666
|
+
{ key: "sid", label: "Twilio SID" },
|
|
2667
|
+
{ key: "region", label: "Region" },
|
|
2668
|
+
{ key: "createdAt", label: "Created" }
|
|
2669
|
+
]);
|
|
2670
|
+
} catch (err) {
|
|
2671
|
+
process.exitCode = handleError(err);
|
|
2672
|
+
}
|
|
2673
|
+
});
|
|
2674
|
+
phoneNumber.command("release").description("Release a purchased phone number").argument("<id>", "Phone number ID").addHelpText(
|
|
2675
|
+
"after",
|
|
2676
|
+
`
|
|
2677
|
+
Examples:
|
|
2678
|
+
$ nexus phone-number release abc-123
|
|
2679
|
+
$ nexus phone-number release abc-123 --json`
|
|
2680
|
+
).action(async (id) => {
|
|
2681
|
+
try {
|
|
2682
|
+
const client = createClient(program2.optsWithGlobals());
|
|
2683
|
+
await client.phoneNumbers.release(id);
|
|
2684
|
+
printSuccess(`Phone number ${id} released successfully`);
|
|
2685
|
+
} catch (err) {
|
|
2686
|
+
process.exitCode = handleError(err);
|
|
2687
|
+
}
|
|
2688
|
+
});
|
|
2689
|
+
}
|
|
2690
|
+
|
|
2514
2691
|
// src/commands/prompt-assistant.ts
|
|
2515
2692
|
init_output();
|
|
2516
2693
|
function registerPromptAssistantCommands(program2) {
|
|
@@ -3948,7 +4125,7 @@ function formatUpdateMessage(current, latest) {
|
|
|
3948
4125
|
}
|
|
3949
4126
|
|
|
3950
4127
|
// src/index.ts
|
|
3951
|
-
var VERSION =
|
|
4128
|
+
var { version: VERSION } = require_package();
|
|
3952
4129
|
var program = new import_commander.Command().name("nexus").description("Official CLI for the Nexus AI agent platform").version(VERSION, "-v, --version").option("--json", "Output as JSON").option("--api-key <key>", "Override API key for this invocation").option("--base-url <url>", "Override API base URL").hook("preAction", (thisCommand) => {
|
|
3953
4130
|
const opts = thisCommand.optsWithGlobals();
|
|
3954
4131
|
if (opts.json) setJsonMode(true);
|
|
@@ -3978,6 +4155,7 @@ registerTemplateCommands(program);
|
|
|
3978
4155
|
registerExternalToolCommands(program);
|
|
3979
4156
|
registerPromptAssistantCommands(program);
|
|
3980
4157
|
registerModelCommands(program);
|
|
4158
|
+
registerPhoneNumberCommands(program);
|
|
3981
4159
|
if (process.argv.length <= 2) {
|
|
3982
4160
|
program.help();
|
|
3983
4161
|
}
|