retell-cli 1.4.1 → 1.5.0
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 +3 -3
- package/dist/index.js +78 -9
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -364,7 +364,7 @@ Manage agent-level settings that aren't part of prompts (voice, webhooks, post-c
|
|
|
364
364
|
Get agent configuration including all agent-level settings.
|
|
365
365
|
|
|
366
366
|
**Options:**
|
|
367
|
-
- `--version <number>` - Specific version to retrieve (defaults to latest)
|
|
367
|
+
- `--engine-version <number>` - Specific version to retrieve (defaults to latest)
|
|
368
368
|
- `--fields <fields>` - Comma-separated list of fields to return
|
|
369
369
|
|
|
370
370
|
**Examples:**
|
|
@@ -373,7 +373,7 @@ Get agent configuration including all agent-level settings.
|
|
|
373
373
|
retell agent get agent_123abc
|
|
374
374
|
|
|
375
375
|
# Get specific version
|
|
376
|
-
retell agent get agent_123abc --version 2
|
|
376
|
+
retell agent get agent_123abc --engine-version 2
|
|
377
377
|
|
|
378
378
|
# Get specific fields only
|
|
379
379
|
retell agent get agent_123abc --fields agent_name,post_call_analysis_data
|
|
@@ -394,7 +394,7 @@ Update agent configuration from a JSON file. This is useful for updating agent-l
|
|
|
394
394
|
**Options:**
|
|
395
395
|
- `-f, --file <path>` - Path to JSON file containing agent configuration updates (required)
|
|
396
396
|
- `--dry-run` - Preview changes without applying them
|
|
397
|
-
- `--version <number>` - Specific version to update (defaults to latest draft)
|
|
397
|
+
- `--engine-version <number>` - Specific version to update (defaults to latest draft)
|
|
398
398
|
|
|
399
399
|
**Example JSON for post-call analysis:**
|
|
400
400
|
```json
|
package/dist/index.js
CHANGED
|
@@ -3641,8 +3641,8 @@ async function deleteKnowledgeBaseSourceCommand(knowledgeBaseId, sourceId) {
|
|
|
3641
3641
|
try {
|
|
3642
3642
|
const client = getRetellClient();
|
|
3643
3643
|
const knowledgeBase = await client.knowledgeBase.deleteSource(
|
|
3644
|
-
|
|
3645
|
-
|
|
3644
|
+
sourceId,
|
|
3645
|
+
{ knowledge_base_id: knowledgeBaseId }
|
|
3646
3646
|
);
|
|
3647
3647
|
const output = {
|
|
3648
3648
|
message: "Source deleted successfully",
|
|
@@ -3818,8 +3818,8 @@ async function listPhoneNumbersCommand(options = {}) {
|
|
|
3818
3818
|
phone_number_pretty: pn.phone_number_pretty,
|
|
3819
3819
|
phone_number_type: pn.phone_number_type,
|
|
3820
3820
|
nickname: pn.nickname,
|
|
3821
|
-
|
|
3822
|
-
|
|
3821
|
+
inbound_agents: pn.inbound_agents ?? [],
|
|
3822
|
+
outbound_agents: pn.outbound_agents ?? []
|
|
3823
3823
|
}));
|
|
3824
3824
|
const output = options.fields ? filterFields(
|
|
3825
3825
|
formatted,
|
|
@@ -3847,7 +3847,59 @@ async function getPhoneNumberCommand(phoneNumber, options = {}) {
|
|
|
3847
3847
|
}
|
|
3848
3848
|
|
|
3849
3849
|
// src/commands/phone-numbers/import.ts
|
|
3850
|
+
function parseWeightedAgents(spec) {
|
|
3851
|
+
const entries = spec.split(",").map((s) => s.trim()).filter(Boolean);
|
|
3852
|
+
if (entries.length === 0) {
|
|
3853
|
+
throw new Error("Empty agent spec. Provide at least one agent ID.");
|
|
3854
|
+
}
|
|
3855
|
+
const agents2 = entries.map((entry) => {
|
|
3856
|
+
const parts = entry.split(":");
|
|
3857
|
+
if (parts.length === 1) {
|
|
3858
|
+
return { agent_id: parts[0], weight: -1 };
|
|
3859
|
+
}
|
|
3860
|
+
if (parts.length === 2) {
|
|
3861
|
+
const weight = Number(parts[1]);
|
|
3862
|
+
if (isNaN(weight) || weight <= 0 || weight > 1) {
|
|
3863
|
+
throw new Error(
|
|
3864
|
+
`Invalid weight "${parts[1]}" for agent "${parts[0]}". Weight must be a number between 0 (exclusive) and 1 (inclusive).`
|
|
3865
|
+
);
|
|
3866
|
+
}
|
|
3867
|
+
return { agent_id: parts[0], weight };
|
|
3868
|
+
}
|
|
3869
|
+
throw new Error(`Invalid agent spec "${entry}". Expected format: agent_id or agent_id:weight`);
|
|
3870
|
+
});
|
|
3871
|
+
const allDefault = agents2.every((a) => a.weight === -1);
|
|
3872
|
+
if (allDefault) {
|
|
3873
|
+
const w = 1 / agents2.length;
|
|
3874
|
+
for (const a of agents2) a.weight = w;
|
|
3875
|
+
} else if (agents2.some((a) => a.weight === -1)) {
|
|
3876
|
+
throw new Error(
|
|
3877
|
+
"Cannot mix agents with and without weights. Either specify weights for all agents or none."
|
|
3878
|
+
);
|
|
3879
|
+
}
|
|
3880
|
+
const sum = agents2.reduce((s, a) => s + a.weight, 0);
|
|
3881
|
+
if (Math.abs(sum - 1) > 1e-3) {
|
|
3882
|
+
throw new Error(
|
|
3883
|
+
`Agent weights must sum to 1.0, but got ${sum.toFixed(4)}.`
|
|
3884
|
+
);
|
|
3885
|
+
}
|
|
3886
|
+
return agents2;
|
|
3887
|
+
}
|
|
3850
3888
|
async function importPhoneNumberCommand(options) {
|
|
3889
|
+
if (options.inboundAgent && options.inboundAgents) {
|
|
3890
|
+
process.stderr.write(
|
|
3891
|
+
"Error: --inbound-agent and --inbound-agents are mutually exclusive. Use one or the other.\n"
|
|
3892
|
+
);
|
|
3893
|
+
process.exit(1);
|
|
3894
|
+
return;
|
|
3895
|
+
}
|
|
3896
|
+
if (options.outboundAgent && options.outboundAgents) {
|
|
3897
|
+
process.stderr.write(
|
|
3898
|
+
"Error: --outbound-agent and --outbound-agents are mutually exclusive. Use one or the other.\n"
|
|
3899
|
+
);
|
|
3900
|
+
process.exit(1);
|
|
3901
|
+
return;
|
|
3902
|
+
}
|
|
3851
3903
|
try {
|
|
3852
3904
|
const client = getRetellClient();
|
|
3853
3905
|
const importParams = {
|
|
@@ -3858,10 +3910,26 @@ async function importPhoneNumberCommand(options) {
|
|
|
3858
3910
|
importParams.nickname = options.nickname;
|
|
3859
3911
|
}
|
|
3860
3912
|
if (options.inboundAgent) {
|
|
3861
|
-
importParams.
|
|
3913
|
+
importParams.inbound_agents = [
|
|
3914
|
+
{ agent_id: options.inboundAgent, weight: 1 }
|
|
3915
|
+
];
|
|
3916
|
+
} else if (options.inboundAgents) {
|
|
3917
|
+
importParams.inbound_agents = parseWeightedAgents(options.inboundAgents);
|
|
3862
3918
|
}
|
|
3863
3919
|
if (options.outboundAgent) {
|
|
3864
|
-
importParams.
|
|
3920
|
+
importParams.outbound_agents = [
|
|
3921
|
+
{ agent_id: options.outboundAgent, weight: 1 }
|
|
3922
|
+
];
|
|
3923
|
+
} else if (options.outboundAgents) {
|
|
3924
|
+
importParams.outbound_agents = parseWeightedAgents(
|
|
3925
|
+
options.outboundAgents
|
|
3926
|
+
);
|
|
3927
|
+
}
|
|
3928
|
+
if (options.inboundSmsAgents) {
|
|
3929
|
+
importParams.inbound_sms_agents = parseWeightedAgents(options.inboundSmsAgents);
|
|
3930
|
+
}
|
|
3931
|
+
if (options.outboundSmsAgents) {
|
|
3932
|
+
importParams.outbound_sms_agents = parseWeightedAgents(options.outboundSmsAgents);
|
|
3865
3933
|
}
|
|
3866
3934
|
if (options.sipUsername) {
|
|
3867
3935
|
importParams.sip_trunk_auth_username = options.sipUsername;
|
|
@@ -4694,7 +4762,7 @@ phoneNumbers.command("list").description("List all phone numbers").option("--fie
|
|
|
4694
4762
|
`
|
|
4695
4763
|
Examples:
|
|
4696
4764
|
$ retell phone-numbers list
|
|
4697
|
-
$ retell phone-numbers list --fields phone_number,nickname,
|
|
4765
|
+
$ retell phone-numbers list --fields phone_number,nickname,inbound_agents
|
|
4698
4766
|
`
|
|
4699
4767
|
).action(async (options) => {
|
|
4700
4768
|
await listPhoneNumbersCommand(options);
|
|
@@ -4704,18 +4772,19 @@ phoneNumbers.command("get <phone_number>").description("Get phone number details
|
|
|
4704
4772
|
`
|
|
4705
4773
|
Examples:
|
|
4706
4774
|
$ retell phone-numbers get +14157774444
|
|
4707
|
-
$ retell phone-numbers get +14157774444 --fields phone_number,
|
|
4775
|
+
$ retell phone-numbers get +14157774444 --fields phone_number,inbound_agents
|
|
4708
4776
|
`
|
|
4709
4777
|
).action(async (phoneNumber, options) => {
|
|
4710
4778
|
await getPhoneNumberCommand(phoneNumber, options);
|
|
4711
4779
|
});
|
|
4712
|
-
phoneNumbers.command("import").description("Import a phone number from custom telephony").requiredOption("--number <number>", "Phone number in E.164 format").requiredOption("--termination-uri <uri>", "SIP trunk termination URI").option("--nickname <name>", "Friendly name for reference").option("--inbound-agent <id>", "
|
|
4780
|
+
phoneNumbers.command("import").description("Import a phone number from custom telephony").requiredOption("--number <number>", "Phone number in E.164 format").requiredOption("--termination-uri <uri>", "SIP trunk termination URI").option("--nickname <name>", "Friendly name for reference").option("--inbound-agent <id>", "Single agent for inbound calls (shorthand for weight 1)").option("--outbound-agent <id>", "Single agent for outbound calls (shorthand for weight 1)").option("--inbound-agents <spec>", "Weighted inbound agents (format: id:weight,id:weight)").option("--outbound-agents <spec>", "Weighted outbound agents (format: id:weight,id:weight)").option("--inbound-sms-agents <spec>", "Weighted inbound SMS agents (format: id:weight,id:weight)").option("--outbound-sms-agents <spec>", "Weighted outbound SMS agents (format: id:weight,id:weight)").option("--sip-username <user>", "SIP trunk auth username").option("--sip-password <pass>", "SIP trunk auth password").option("--fields <fields>", "Comma-separated list of fields to return").addHelpText(
|
|
4713
4781
|
"after",
|
|
4714
4782
|
`
|
|
4715
4783
|
Examples:
|
|
4716
4784
|
$ retell phone-numbers import --number +14157774444 --termination-uri someuri.pstn.twilio.com
|
|
4717
4785
|
$ retell phone-numbers import --number +14157774444 --termination-uri someuri.pstn.twilio.com --nickname "Support Line"
|
|
4718
4786
|
$ retell phone-numbers import --number +14157774444 --termination-uri someuri.pstn.twilio.com --inbound-agent agent_xxx
|
|
4787
|
+
$ retell phone-numbers import --number +14157774444 --termination-uri someuri.pstn.twilio.com --inbound-agents "agent_1:0.6,agent_2:0.4"
|
|
4719
4788
|
`
|
|
4720
4789
|
).action(async (options) => {
|
|
4721
4790
|
await importPhoneNumberCommand(options);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "retell-cli",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.5.0",
|
|
4
4
|
"description": "Community CLI for Retell AI - efficient access to transcripts, agents, and prompts for AI assistants without MCP overhead",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"bin": {
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
"commander": "^14.0.0",
|
|
55
55
|
"dotenv": "^17.0.0",
|
|
56
56
|
"microdiff": "^1.5.0",
|
|
57
|
-
"retell-sdk": "^
|
|
57
|
+
"retell-sdk": "^5.10.3",
|
|
58
58
|
"zod": "^3.25.0"
|
|
59
59
|
},
|
|
60
60
|
"devDependencies": {
|