how do I deploy my changes to the cloud using the ...
# ask-ai
e
how do I deploy my changes to the cloud using the cli?
✅ 1
t
Thanks for reaching out, Brian. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
Thanks — I’m responding to your question about deploying changes to the cloud with the LiveKit CLI. Below are the typical, quick steps you can run from your project root to build, upload, and deploy your agent. 1. Ensure you have a
livekit.toml
file in your project root ◦ This file stores agent metadata like
project.subdomain
and
agent.id
. It’s created during initialization or the first deploy. 1. Authenticate the CLI with your LiveKit Cloud account ◦ Run:
Copy code
lk cloud auth
• This links your local environment to your cloud project. 1. Deploy your changes ◦ From the project root run:
Copy code
lk agent deploy
• This builds a new Docker image, uploads it, and deploys the updated agent while preserving the same agent ID. • If your agent lives in a subdirectory, you can provide the working directory:
Copy code
lk agent deploy [working-dir]
1. Verify the deployment ◦ Check status:
Copy code
lk agent status
• Stream logs in real time:
Copy code
lk agent logs
1. Secrets and environment variables ◦ Secrets and environment variables are preserved across deployments. To update them separately, use:
Copy code
lk agent update-secrets
If you want, tell me: • Which directory your agent is in (project root or a subfolder), or • Any errors you see when running
lk agent deploy
(copy-paste the output), and I’ll help troubleshoot the next steps. Sources: Agents Framework | livekit/livekit_composite | DeepWiki | Google AI and LiveKit | LiveKit Documentation | examples/drive-thru | livekit/livekit_composite | DeepWiki
e
so I tried authenticating and am getting Authenticated project [Pennpaper] ┃ Choose a different alias ┃ You've already authenticated a project with the alias "pennpaper". ┃ > pennpaper * project name already exists when i try deploy iget another project accepting the deployment
t
Thanks — I’m responding to the alias conflict and deployment errors you described. I’m sorry this is blocking your deploy; I’ll help you get it unstuck. From your message it sounds like the CLI is telling you an alias "pennpaper" is already registered locally, and when you try to deploy it’s picking the wrong project. To troubleshoot quickly, I need two small pieces of info and then I’ll give the commands to fix it. Quick questions 1. What command did you run to authenticate (the exact
lk ...
command)? 2. What exact command and full output do you get when you run
lk agent deploy
? If you prefer to try a fix now, try these steps: 1. List authenticated projects and their aliases ◦ Run:
Copy code
lk cloud list
• This shows which aliases and projects are currently configured locally. 1. If you see multiple entries using the alias
pennpaper
, either choose a different alias or remove the conflicting one: ◦ To remove an alias you no longer want:
Copy code
lk cloud remove <alias>
Replace
<alias>
with the conflicting name (for example
pennpaper
). This will remove the local reference so you can re-authenticate. 1. Re-authenticate with a different alias (if you want to keep the existing one) ◦ Run:
Copy code
lk cloud auth --alias my-new-alias
Replace
my-new-alias
with something unique (for example
pennpaper-dev
). 1. Confirm your project is the active one before deploying ◦ Run:
Copy code
lk cloud list
and ensure the intended project/alias is the one you’ll use. 1. Deploy from your project root (or specify working-dir) ◦ Run:
Copy code
lk agent deploy
or if agent files are in a subfolder:
Copy code
lk agent deploy path/to/dir
Notes • Removing an alias only affects your local CLI config; it will not delete the cloud project. • If
lk cloud list
shows the correct alias but
lk agent deploy
still targets the wrong project, copy the exact
lk
output and paste it here so I can diagnose further. Tell me the output of
lk cloud list
and the exact
lk agent deploy
error if the steps above don’t resolve it, and I’ll guide you through the next steps. Sources: Voice AI quickstart | LiveKit Documentation | server-sdk-js | livekit/livekit_composite | DeepWiki
e
i tried and it still defaults to another project help me fix this ennpaper-backend % lk agent deploy Using default project [kylianai] ┃ Select an agent user aborted it shows kylian instead of pennpaper
t
Thanks — I see it’s still defaulting to the wrong project (
kylianai
) when you run
lk agent deploy
. Let’s get you deploying to
pennpaper
. I’ll give a few safe options; pick whichever fits your workflow. First, quick diagnostic • Run this and paste the output if anything looks odd:
Copy code
lk cloud list
  lk project list
  cat livekit.toml
This shows which aliases/projects are configured and whether your local
livekit.toml
points to
pennpaper
. Fast fixes (choose one) 1) Deploy with an explicit project flag (no config changes needed) • From your project folder run:
Copy code
lk agent deploy --project pennpaper
• This forces the CLI to use
pennpaper
for this deploy. 2) Temporarily override with an environment variable • In your shell session:
Copy code
export LIVEKIT_PROJECT=pennpaper
  lk agent deploy
• This makes
pennpaper
take priority for the current terminal session. 3) Set
pennpaper
as the CLI default (persistent) • If
pennpaper
is already configured, set it as default:
Copy code
lk project set-default pennpaper
• Or add it and set as default:
Copy code
lk project add pennpaper --set-default
4) Remove the conflicting alias (if you don’t need it locally) • If
kylianai
is an alias you no longer want locally:
Copy code
lk cloud remove kylianai
• Then confirm defaults with:
Copy code
lk cloud list
  lk project list
Notes and checks • Make sure your project root’s
livekit.toml
(if present) has:
Copy code
[project]
  subdomain = "pennpaper"
If it points to
kylianai
, update it and re-run
lk agent deploy
. If these steps don’t fix it, please paste the exact outputs of: •
lk cloud list
•
lk project list
• the
lk agent deploy
command output I’ll use those to pinpoint why the CLI keeps selecting
kylianai
and give the exact command to fix it. Sources: Server-side | livekit/livekit_composite | DeepWiki
e
k agent deploy Using default project [pennpaper] no agents found now what!
t
Thanks — I see you ran
lk agent deploy
and it says: Using default project [pennpaper] no agents found I know that’s frustrating when you expect an agent to be there. Let’s get you back on track. Below are short, clear steps to find or create an agent and then deploy. 1) Confirm you’re in the right folder • In your terminal run:
Copy code
pwd
  ls -la
• Make sure you’re inside the project directory that contains your agent code (look for
package.json
,
pyproject.toml
, or
requirements.txt
). 2) List agents in the pennpaper project • Run:
Copy code
lk agent list --project pennpaper
• If this shows no agents, that means the project currently has no registered agents. 3a) If no agents exist — create one • Create and register a new agent from your project directory:
Copy code
lk agent create --project pennpaper
• This will build and deploy the agent and create a
livekit.toml
in your folder. After it finishes, run:
Copy code
lk agent list --project pennpaper
  lk agent status
Then deploy updates later with:
Copy code
lk agent deploy --project pennpaper
3b) If agents exist but not linked to this directory • If
lk agent list
shows one or more agents, pick the agent ID you want and generate the local config:
Copy code
lk agent config --id <agent-id> --project pennpaper
• That will create/update
livekit.toml
. You can then run:
Copy code
lk agent deploy --project pennpaper
4) Quick deploy shortcut (explicit project) • To avoid any default confusion, you can always deploy explicitly:
Copy code
lk agent deploy --project pennpaper
5) If the CLI still can’t detect an agent or build • Paste the outputs of: ◦
lk agent list --project pennpaper
◦
ls -la
◦
cat livekit.toml
(if it exists) ◦ The exact output from
lk agent create
or
lk agent deploy
you tried • I’ll use those to pinpoint the problem and give the exact next command. If you want, start with
lk agent list --project pennpaper
and paste the output and your current
ls -la
here — I’ll walk you through the right command based on what we see. Sources: examples/drive-thru | livekit/livekit_composite | DeepWiki