This question originally came up in our Slack community and the thread has been consolidated here for long-term reference.
Has anyone been able to update an existing agent’s name via the CLI? Is that supported yet?
I tried:
lk agent update CA_****** --name "new-agent-name"
but it never worked.
You can’t specify the agent name through the CLI directly. The agent name must be set in your agent code, then you redeploy.
For the newer AgentSession approach:
For WorkerOptions:
cli.run_app(
WorkerOptions(
entrypoint_fnc=entrypoint,
agent_name="your-agent-name"
)
)
For dev/prod separation: The recommended approach is to create separate LiveKit projects for dev and prod environments, rather than trying to use agent names for this purpose. This provides better isolation and prevents accidental production impact during testing.