how do I deploy a second agent through the cli
# ask-ai
a
how do I deploy a second agent through the cli
t
Thanks for reaching out, Shajahan. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
You're asking how to deploy a second agent through the CLI — here’s a concise step-by-step. 1. Open a terminal and change to the second agent’s project directory:
Copy code
cd /path/to/second-agent-project
1. Authenticate with LiveKit Cloud (if not already):
Copy code
lk cloud auth
1. Create/register the agent:
Copy code
lk agent create
• This registers the agent, assigns a unique ID, and creates a
livekit.toml
if needed. • Ensure this agent has its own directory or a distinct
livekit.toml
. 1. (Optional) Use a custom config or region:
Copy code
lk agent create --config livekit.second-agent.toml --region us-east
1. Verify the agent status:
Copy code
lk agent status
Or specify the agent ID:
Copy code
lk agent status --id <agent_id>
1. List all agents in the project:
Copy code
lk agent list
If you want, tell me the OS and whether you already have a
livekit.toml
or Dockerfile in that directory and I’ll give any next steps specific to your setup. Sources: Deploying to production | LiveKit Docs | Agent deployment CLI reference | LiveKit docs
a
so I already have an existing livekit.toml and dockerfile for my first agent - what do I need to do for the 2nd one?
t
You're already on the right track. Since your first agent already has a
livekit.toml
and
Dockerfile
, for a second agent you need a separate configuration context—either a new directory containing its own
livekit.toml
(and Dockerfile) or a distinct config file name. Quick steps: 1. Copy the first agent’s directory or files into a new folder:
Copy code
cp -r /path/to/first-agent /path/to/second-agent
   cd /path/to/second-agent
1. Update the second agent’s
livekit.toml
so it’s unique (name, any agent-specific settings, region if needed). If you use an auto-generated agent ID later, you don’t need to set an ID manually. 2. If the Dockerfile needs differences (ports, env, image name), modify it now. 3. Authenticate if needed:
Copy code
lk cloud auth
1. Create/register the second agent from that directory:
Copy code
lk agent create
Or specify a custom config file from any directory:
Copy code
lk agent create --config /path/to/second-agent/livekit.toml
1. Verify:
Copy code
lk agent status --id <agent_id>
   lk agent list
Notes: • Each agent should have its own
livekit.toml
or use
--config
to point to a different config. • You can have multiple agents in the same LiveKit Cloud project. • If you’d like, tell me whether the second agent needs different env vars, ports, or region and I’ll suggest exact
livekit.toml
changes.