How to update environment variables for agents hosted on LiveKit Cloud

This question originally came up in our Slack community and the thread has been consolidated here for long-term reference.

What’s the best way to update environment variables for agents hosted on LiveKit Cloud?

I ran lk agent update-secrets --secrets-file .env.local but it did not work.

Make sure you’re using the correct syntax with the = sign:

lk agent update-secrets --secrets-file=.env.local

See the documentation for managing secrets: