Repository navigation
feat(skills): offer to install skills on first run - #1056
JackNDwyer wants to merge 2 commits into
Conversation
|
|
| out.Warnf("Couldn't save your answer to the CLI config: %v", perr) | ||
| } | ||
| } | ||
| if err != nil || !ok { |
There was a problem hiding this comment.
This also catches huh.ErrUserAborted, so Ctrl+C = permanent no but command still runs.
Repro w/ lk token create: and Ctrl+C at the prompt, the token still gets created and skills_prompted: true gets written. I feeel like this would be bad if the command was lk agent deploy?
IMO check for the abort first, skip persisting, and return an err so initLogger stops the command (confirmUntracked already does this for the same case).
There was a problem hiding this comment.
Thanks @ShayneP. I’ll fix it: check for huh.ErrUserAborted first, don’t save the answer, and return the error so initLogger stops the command (same as confirmUntracked).
There was a problem hiding this comment.
This now handles your change request: Ctrl+C at the skills prompt cancels the command and doesn't save an answer. I verified that with your lk token create repro, and tests pass
When a coding agent is on the machine and no LiveKit skills are installed, lk asks once, in a terminal, whether to install them globally (lk skills install --global). It runs before any sign-in, so API-key and self-hosted users see it too. Runs without a terminal or with --yes print a one-line tip instead and never wait for input; CI, --quiet, --json and LK_NO_SKILLS_PROMPT=1 skip it entirely. The answer is saved in the CLI config so it's asked only once. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Cancelling the first-run skills prompt with Ctrl+C was treated as a permanent no: the answer was saved and the command went on to run. Now it cancels the command, like any other lk prompt, and nothing is saved, so the prompt comes back next time. A prompt that fails to show is also no longer saved as an answer. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
c16f232 to
875daec
Compare
What
lkasks once whether to install them globally. Yes runs the same install aslk skills install --global.lk project addand self-hosted users see it too.--yes(for example, a coding agent callinglk), it prints a one-line tip instead. CI,--quiet,--jsonandLK_NO_SKILLS_PROMPT=1skip it entirely.skills_prompted), so it's asked only once. Declining also stops the tip.skillscommands, help, version and completion, andlk agent init, which has its own skills offer.Why
Coding agents building LiveKit agents often don't have LiveKit's skills (DEVX-840), especially when starting from an empty folder, where no repo file can point them there. This installs the skills when the CLI is first used, however it was installed (Homebrew can't run this step itself). Ticket: DEVX-843. The cross-platform curl installer from the same ticket is in #1057.
Pairs with the template-side change in livekit-examples/agent-starter-python#114 and livekit-examples/agent-starter-node#75.
How to verify
HOME=$(mktemp -d) sh -c 'mkdir $HOME/.claude && lk token create --list --api-key k --api-secret s'. Expect the prompt. Yes installs seven skills into~/.claude/skillsand adds the Docs MCP server, then the command runs. No prints a skip line, then the command runs.HOME: no prompt.</dev/null(no terminal) on a freshHOME: oneTip:line on stderr, no prompt. Add--quiet,CI=1orLK_NO_SKILLS_PROMPT=1: no tip.Unit tests cover the decision table, the installed-skills check, and resolving the leaf command from the root
Beforehook. I tested both prompt answers and the non-interactive paths with a local build; the prompt was driven throughscriptrather than a real terminal.🤖 Generated with Claude Code