From e31bc3353c020af1ee5d8ec7226335265a73832a Mon Sep 17 00:00:00 2001 From: Boris Starkov Date: Wed, 19 Nov 2025 12:06:44 +0000 Subject: [PATCH] agents add from file --- README.md | 24 ++++++++-- src/agents/commands/add.ts | 77 ++++++++++++++++++++++++-------- src/agents/ui/AgentsHelpView.tsx | 7 +-- 3 files changed, 83 insertions(+), 25 deletions(-) diff --git a/README.md b/README.md index 89f183f..6b53676 100644 --- a/README.md +++ b/README.md @@ -146,8 +146,11 @@ elevenlabs auth login elevenlabs auth logout elevenlabs auth whoami -# Create agent -elevenlabs agents add "Agent Name" [--template customer-service] +# Create agent from template +elevenlabs agents add "Agent Name" [--template customer-service] [--output-path path] + +# Create agent from existing config file +elevenlabs agents add [name] --from-file existing-config.json [--output-path path] # Create webhook tool elevenlabs tools add-webhook "Tool Name" [--config-path path] @@ -277,7 +280,7 @@ elevenlabs agents add "My Agent" --template assistant elevenlabs agents push ``` -**Import Existing:** +**Import Existing from ElevenLabs:** ```bash elevenlabs agents init @@ -286,6 +289,21 @@ elevenlabs agents pull elevenlabs agents push ``` +**Create Agent from Local Config File:** + +```bash +# You have an existing agent config file (e.g., my-template.json) +# Import it and register it with ElevenLabs +elevenlabs agents init +elevenlabs auth login +elevenlabs agents add --from-file my-template.json +# This will: +# - Upload the agent to ElevenLabs +# - Get an agent ID +# - Register it in agents.json +# - Save a copy to agent_configs/ +``` + **Import and Use Tools:** ```bash diff --git a/src/agents/commands/add.ts b/src/agents/commands/add.ts index 249229d..e9091f6 100644 --- a/src/agents/commands/add.ts +++ b/src/agents/commands/add.ts @@ -23,20 +23,22 @@ interface AgentDefinition { } interface AddOptions { - configPath?: string; + outputPath?: string; template?: string; + fromFile?: string; } export function createAddCommand(): Command { return new Command('add') .description('Add a new agent - creates config, uploads to ElevenLabs, and saves ID') .argument('[name]', 'Name of the agent to create') - .option('--config-path ', 'Custom config path (optional)') - .option('--template