diff --git a/src/cli/program/register.agent.ts b/src/cli/program/register.agent.ts index e5847f3c164..e0914589c95 100644 --- a/src/cli/program/register.agent.ts +++ b/src/cli/program/register.agent.ts @@ -26,6 +26,7 @@ export function registerAgentCommands(program: Command, args: { agentChannelOpti .requiredOption("-m, --message ", "Message body for the agent") .option("-t, --to ", "Recipient number in E.164 used to derive the session key") .option("--session-id ", "Use an explicit session id") + .option("--session-key ", "Use an explicit session key") .option("--agent ", "Agent id (overrides routing bindings)") .option("--thinking ", "Thinking level: off | minimal | low | medium | high | xhigh") .option("--verbose ", "Persist agent verbose level for the session") diff --git a/src/commands/agent-via-gateway.ts b/src/commands/agent-via-gateway.ts index a44caa3f3bf..05079f6b446 100644 --- a/src/commands/agent-via-gateway.ts +++ b/src/commands/agent-via-gateway.ts @@ -37,6 +37,7 @@ export type AgentCliOpts = { agent?: string; to?: string; sessionId?: string; + sessionKey?: string; thinking?: string; verbose?: string; json?: boolean; @@ -89,8 +90,10 @@ export async function agentViaGatewayCommand(opts: AgentCliOpts, runtime: Runtim if (!body) { throw new Error("Message (--message) is required"); } - if (!opts.to && !opts.sessionId && !opts.agent) { - throw new Error("Pass --to , --session-id, or --agent to choose a session"); + if (!opts.to && !opts.sessionId && !opts.sessionKey && !opts.agent) { + throw new Error( + "Pass --to , --session-id, --session-key, or --agent to choose a session", + ); } const cfg = loadConfig(); @@ -115,6 +118,7 @@ export async function agentViaGatewayCommand(opts: AgentCliOpts, runtime: Runtim agentId, to: opts.to, sessionId: opts.sessionId, + sessionKey: opts.sessionKey, }).sessionKey; const channel = normalizeMessageChannel(opts.channel);