Show one tip on first start, document completion setup in the CLI - #495
Open
joe4dev wants to merge 8 commits into
Open
Show one tip on first start, document completion setup in the CLI#495joe4dev wants to merge 8 commits into
joe4dev wants to merge 8 commits into
Conversation
joe4dev
force-pushed
the
devx-821-enforce-max-one-tip
branch
2 times, most recently
from
September 8, 2026 14:33
55008c9 to
2f6fbbe
Compare
1 task
joe4dev
force-pushed
the
devx-821-enforce-max-one-tip
branch
from
September 9, 2026 12:44
2f6fbbe to
2360c8a
Compare
joe4dev
marked this pull request as ready for review
September 9, 2026 12:51
gtsiolis
reviewed
Sep 10, 2026
joe4dev
marked this pull request as draft
September 10, 2026 19:03
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
joe4dev
force-pushed
the
devx-821-enforce-max-one-tip
branch
from
September 11, 2026 13:44
4f82c9d to
8f02787
Compare
joe4dev
marked this pull request as ready for review
September 11, 2026 13:45
gtsiolis
approved these changes
Sep 11, 2026
Co-authored-by: George Tsiolis <tsiolis.g@gmail.com>
Co-authored-by: George Tsiolis <tsiolis.g@gmail.com>
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Motivation
#484 introduced a UX regression by rendering two tips on the first lstk startup (shell completion + rotation tip). Furthermore, the review also flagged the long docs URL as poor terminal UX.
Solution
One tip per run, enforced structurally rather than by convention.
selectTip(newinternal/container/tips.go) is the only place that decides which tip to show, and it returns one string, not a list. The first-run completion tip outranks the rotating per-emulator tips: first run happens once per install, while the rotating tips come back on every later start.container.Startis the only place that emits it. Its body moved to an unexportedstart, leaving the public entry point a thin wrapper around the single emit.emitPostStartPointersno longer emits a tip, andinternal/uino longer emits one either —RunOptions.CompletionTipis replaced byStartOptions.FirstRun.Adding a tip now means ranking it inside
selectTip; there is nowhere else to put it. The rule is written up under "Post-start tips" inCLAUDE.md.The tip names a command instead of linking to docs.
A URL in terminal output can't be clicked, rots, and drifts from an already-shipped binary. So
lstk completionnow carries the setup instructions itself; the per-shell subcommands forward to it, andlstk docsrenders it, which makes the CLI the source and the docs site the follower.User-visible change: a first interactive start shows the completion tip and nothing else. Every other run is unchanged, rotation included.
Shell completion
Bare
lstk completion(andlstk completion --help) now prints:Every recipe is the same shape: the current-session command, or that same command appended to the shell's startup file.
Optional alternatives considered and dropped
Verified on macOS 15 / Apple Silicon.
lstk completion zsh > "${fpath[1]}/_lstk"fpath[1]is root-owned on stock macOS (/usr/local/share/zsh/site-functions), so a normal user getspermission denied. It doesn't exist on stock macOS yieldingzsh: no such file or directory. Under oh-my-zsh it is a plugin directory. On my private mac, it points to~/.docker/completionslstk completion zsh > $(brew --prefix)/share/zsh/site-functions/_lstk$fpath(defaultfpath[1]is the Intel prefix while Homebrew sits at/opt/homebrew). It needs Homebrew's own zsh, orFPATH="$(brew --prefix)/share/zsh/site-functions:${FPATH}"beforecompinit.lstk completion bash > /etc/bash_completion.d/lstkand the$(brew --prefix)/etc/bash_completion.d/lstkvariantevalform does not — lstk's script ships its own_get_comp_words_by_reffallback (DEVX-950). They only buy lazy loading on first Tab instead of sourcing at every shell start.[[ $commands[lstk] ]] && source <(lstk completion zsh)command not found: lstkin every new shell after an uninstall, but roughly doubles the length of each line. Happy to add it to bash and zsh if reviewers prefer.Two things that look optional but are not:
compinitline is required. Cobra's generated script callscompdefon line 2, andcompdefdoes not exist untilcompinithas run — without it you getcompdef: command not foundand nothing registers. A duplicatecompinit(oh-my-zsh already runs one) is harmless. Sourcing costs ~8 ms per shell start.Out-File -Encoding utf8rather than>>, which writes UTF-16LE on PowerShell 5.1 and leaves a profile the shell cannot parse.Docs
The CLI is now the source of truth for shell-completion setup, and the docs site should follow it rather than the reverse.
Handled in localstack/localstack-docs#937, which rewrites the Shell completions section to match
lstk completion— the page currently recommends${fpath[1]}and the Homebrewsite-functionspath for zsh (neither works on stock macOS — see the table above), omits the requiredcompinitstep, and has no PowerShell instructions. The same section is duplicated on the Azure page; that PR updates both.No new command, flag, or env var. The first-start tip no longer links to the docs, so the
#shell-completionsanchor is no longer referenced from the CLI.Manual Testing
First startup tip
No more docs link and adjusted message:

Shell Completions
Review
Human review advised — it changes user-facing output and help text on the shared start path, and @gtsiolis raised the original concern on #484, so it's worth confirming this is the resolution he had in mind.
Related
Towards DEVX-821
Docs PR with synchronized shell completion changes: localstack/localstack-docs#937