livekit-cli
livekit-cli copied to clipboard
fix(agent): register --id flag on `agent deploy`
Summary
lk agent deploy resolves the target agent via getAgentID, which reads
cmd.String("id") — but the deploy subcommand never registered the --id flag
(unlike config, status, restart, and rollback). As a result
lk agent deploy --id CA_XXX failed at flag-parse time with
flag provided but not defined: --id, and the id lookup was effectively dead code
on the deploy path.
This adds idFlag(false) to the deploy command's flags, matching the sibling
subcommands. --id remains optional and falls back to livekit.toml as before.
Test
TestAgentDeployRegistersIDFlagintrospects the realagent deploycommand and asserts it registers--id(fails before this change).- Verified
lk agent deploy --helpnow lists--id;go test ./cmd/lk/andgofmtpass.
Thanks to @MSameerAbbas for the precise diagnosis in the issue.
Fixes #830