From 035b8a0fe88640aa36ca0c0e77169d096901fe8a Mon Sep 17 00:00:00 2001 From: Joel Scheuner Date: Thu, 10 Sep 2026 21:04:58 +0200 Subject: [PATCH 1/4] Update lstk shell completions to match the CLI --- .../running-localstack/lstk/index.mdx | 44 +++++++++++++----- .../docs/azure/developer-tools/lstk.mdx | 45 +++++++++++++------ 2 files changed, 64 insertions(+), 25 deletions(-) diff --git a/src/content/docs/aws/developer-tools/running-localstack/lstk/index.mdx b/src/content/docs/aws/developer-tools/running-localstack/lstk/index.mdx index c7a02b28..6eab9ba1 100644 --- a/src/content/docs/aws/developer-tools/running-localstack/lstk/index.mdx +++ b/src/content/docs/aws/developer-tools/running-localstack/lstk/index.mdx @@ -131,7 +131,7 @@ These apply to both interactive and non-interactive (scripted/CI) use, see [Auto `lstk` includes completion scripts for bash, zsh, fish, and powershell. If you installed via Homebrew, completions are set up automatically. -For manual setup: +Run `lstk completion` to print these instructions in your terminal. @@ -140,11 +140,11 @@ For manual setup: # Load in current session eval "$(lstk completion bash)" -# Persist (Linux) -lstk completion bash > /etc/bash_completion.d/lstk +# Load in new sessions (Linux) +echo 'eval "$(lstk completion bash)"' >> ~/.bashrc -# Persist (macOS with Homebrew) -lstk completion bash > $(brew --prefix)/etc/bash_completion.d/lstk +# Load in new sessions (macOS) +echo 'eval "$(lstk completion bash)"' >> ~/.bash_profile ``` :::note @@ -157,15 +157,19 @@ The `lstk` script works with or without the `bash-completion` package (it bundle ```bash # Load in current session +autoload -Uz compinit && compinit source <(lstk completion zsh) -# Persist (Linux) -lstk completion zsh > "${fpath[1]}/_lstk" - -# Persist (macOS with Homebrew) -lstk completion zsh > $(brew --prefix)/share/zsh/site-functions/_lstk +# Load in new sessions (Linux, macOS) +echo 'autoload -Uz compinit && compinit' >> ~/.zshrc +echo 'source <(lstk completion zsh)' >> ~/.zshrc ``` +:::note +The `compinit` line is required, not optional: the generated script calls `compdef`, which does not exist until `compinit` has run. +A second `compinit` is harmless if your `~/.zshrc` already runs one. +::: + @@ -173,14 +177,30 @@ lstk completion zsh > $(brew --prefix)/share/zsh/site-functions/_lstk # Load in current session lstk completion fish | source -# Persist +# Load in new sessions (Linux, macOS) lstk completion fish > ~/.config/fish/completions/lstk.fish ``` + + + +```powershell +# Load in current session +lstk completion powershell | Out-String | Invoke-Expression + +# Load in new sessions (Windows, Linux, macOS) +if (!(Test-Path $PROFILE)) { New-Item -ItemType File -Path $PROFILE -Force } +lstk completion powershell | Out-File -Append -Encoding utf8 $PROFILE +``` + +:::note +Use `Out-File -Encoding utf8` rather than `>>`, which writes UTF-16LE on PowerShell 5.1 and leaves a profile PowerShell cannot parse. +::: + -Restart your shell after persisting completions. +Open a new shell for the changes to take effect. ### `completion` diff --git a/src/content/docs/azure/developer-tools/lstk.mdx b/src/content/docs/azure/developer-tools/lstk.mdx index 36e9b033..1c5c5bf8 100644 --- a/src/content/docs/azure/developer-tools/lstk.mdx +++ b/src/content/docs/azure/developer-tools/lstk.mdx @@ -1438,9 +1438,8 @@ Pair this behavior with a custom [`image`](#custom-container-image) that points `lstk` includes completion scripts for bash, zsh, fish, and powershell. If you installed via Homebrew, completions are set up automatically. -Once completion is enabled, `lstk aws ` also completes AWS services, operations, and parameters using the AWS CLI's own completer. -For manual setup: +Run `lstk completion` to print these instructions in your terminal. @@ -1449,11 +1448,11 @@ For manual setup: # Load in current session eval "$(lstk completion bash)" -# Persist (Linux) -lstk completion bash > /etc/bash_completion.d/lstk +# Load in new sessions (Linux) +echo 'eval "$(lstk completion bash)"' >> ~/.bashrc -# Persist (macOS with Homebrew) -lstk completion bash > $(brew --prefix)/etc/bash_completion.d/lstk +# Load in new sessions (macOS) +echo 'eval "$(lstk completion bash)"' >> ~/.bash_profile ``` :::note @@ -1466,15 +1465,19 @@ The `lstk` script works with or without the `bash-completion` package (it bundle ```bash # Load in current session +autoload -Uz compinit && compinit source <(lstk completion zsh) -# Persist (Linux) -lstk completion zsh > "${fpath[1]}/_lstk" - -# Persist (macOS with Homebrew) -lstk completion zsh > $(brew --prefix)/share/zsh/site-functions/_lstk +# Load in new sessions (Linux, macOS) +echo 'autoload -Uz compinit && compinit' >> ~/.zshrc +echo 'source <(lstk completion zsh)' >> ~/.zshrc ``` +:::note +The `compinit` line is required, not optional: the generated script calls `compdef`, which does not exist until `compinit` has run. +A second `compinit` is harmless if your `~/.zshrc` already runs one. +::: + @@ -1482,14 +1485,30 @@ lstk completion zsh > $(brew --prefix)/share/zsh/site-functions/_lstk # Load in current session lstk completion fish | source -# Persist +# Load in new sessions (Linux, macOS) lstk completion fish > ~/.config/fish/completions/lstk.fish ``` + + + +```powershell +# Load in current session +lstk completion powershell | Out-String | Invoke-Expression + +# Load in new sessions (Windows, Linux, macOS) +if (!(Test-Path $PROFILE)) { New-Item -ItemType File -Path $PROFILE -Force } +lstk completion powershell | Out-File -Append -Encoding utf8 $PROFILE +``` + +:::note +Use `Out-File -Encoding utf8` rather than `>>`, which writes UTF-16LE on PowerShell 5.1 and leaves a profile PowerShell cannot parse. +::: + -Restart your shell after persisting completions. +Open a new shell for the changes to take effect. ## FAQ From 3b113f4eaa0ae44348fa67200aa68568471074a9 Mon Sep 17 00:00:00 2001 From: Joel Scheuner Date: Fri, 11 Sep 2026 16:23:05 +0200 Subject: [PATCH 2/4] Point at lstk completion instead of duplicating the instructions Co-Authored-By: Claude Opus 5 --- .../running-localstack/lstk/index.mdx | 71 +------------------ .../docs/azure/developer-tools/lstk.mdx | 71 +------------------ 2 files changed, 2 insertions(+), 140 deletions(-) diff --git a/src/content/docs/aws/developer-tools/running-localstack/lstk/index.mdx b/src/content/docs/aws/developer-tools/running-localstack/lstk/index.mdx index 6eab9ba1..73091d4b 100644 --- a/src/content/docs/aws/developer-tools/running-localstack/lstk/index.mdx +++ b/src/content/docs/aws/developer-tools/running-localstack/lstk/index.mdx @@ -131,76 +131,7 @@ These apply to both interactive and non-interactive (scripted/CI) use, see [Auto `lstk` includes completion scripts for bash, zsh, fish, and powershell. If you installed via Homebrew, completions are set up automatically. -Run `lstk completion` to print these instructions in your terminal. - - - - -```bash -# Load in current session -eval "$(lstk completion bash)" - -# Load in new sessions (Linux) -echo 'eval "$(lstk completion bash)"' >> ~/.bashrc - -# Load in new sessions (macOS) -echo 'eval "$(lstk completion bash)"' >> ~/.bash_profile -``` - -:::note -Use `eval "$(lstk completion bash)"` rather than `source <(lstk completion bash)`. -The `lstk` script works with or without the `bash-completion` package (it bundles a fallback for stock macOS bash 3.2), but `source <(...)` is a silent no-op on that shell. -::: - - - - -```bash -# Load in current session -autoload -Uz compinit && compinit -source <(lstk completion zsh) - -# Load in new sessions (Linux, macOS) -echo 'autoload -Uz compinit && compinit' >> ~/.zshrc -echo 'source <(lstk completion zsh)' >> ~/.zshrc -``` - -:::note -The `compinit` line is required, not optional: the generated script calls `compdef`, which does not exist until `compinit` has run. -A second `compinit` is harmless if your `~/.zshrc` already runs one. -::: - - - - -```bash -# Load in current session -lstk completion fish | source - -# Load in new sessions (Linux, macOS) -lstk completion fish > ~/.config/fish/completions/lstk.fish -``` - - - - -```powershell -# Load in current session -lstk completion powershell | Out-String | Invoke-Expression - -# Load in new sessions (Windows, Linux, macOS) -if (!(Test-Path $PROFILE)) { New-Item -ItemType File -Path $PROFILE -Force } -lstk completion powershell | Out-File -Append -Encoding utf8 $PROFILE -``` - -:::note -Use `Out-File -Encoding utf8` rather than `>>`, which writes UTF-16LE on PowerShell 5.1 and leaves a profile PowerShell cannot parse. -::: - - - - -Open a new shell for the changes to take effect. +Run `lstk completion` to print setup instructions in your terminal. ### `completion` diff --git a/src/content/docs/azure/developer-tools/lstk.mdx b/src/content/docs/azure/developer-tools/lstk.mdx index 1c5c5bf8..602ee91a 100644 --- a/src/content/docs/azure/developer-tools/lstk.mdx +++ b/src/content/docs/azure/developer-tools/lstk.mdx @@ -1439,76 +1439,7 @@ Pair this behavior with a custom [`image`](#custom-container-image) that points `lstk` includes completion scripts for bash, zsh, fish, and powershell. If you installed via Homebrew, completions are set up automatically. -Run `lstk completion` to print these instructions in your terminal. - - - - -```bash -# Load in current session -eval "$(lstk completion bash)" - -# Load in new sessions (Linux) -echo 'eval "$(lstk completion bash)"' >> ~/.bashrc - -# Load in new sessions (macOS) -echo 'eval "$(lstk completion bash)"' >> ~/.bash_profile -``` - -:::note -Use `eval "$(lstk completion bash)"` rather than `source <(lstk completion bash)`. -The `lstk` script works with or without the `bash-completion` package (it bundles a fallback for stock macOS bash 3.2), but `source <(...)` is a silent no-op on that shell. -::: - - - - -```bash -# Load in current session -autoload -Uz compinit && compinit -source <(lstk completion zsh) - -# Load in new sessions (Linux, macOS) -echo 'autoload -Uz compinit && compinit' >> ~/.zshrc -echo 'source <(lstk completion zsh)' >> ~/.zshrc -``` - -:::note -The `compinit` line is required, not optional: the generated script calls `compdef`, which does not exist until `compinit` has run. -A second `compinit` is harmless if your `~/.zshrc` already runs one. -::: - - - - -```bash -# Load in current session -lstk completion fish | source - -# Load in new sessions (Linux, macOS) -lstk completion fish > ~/.config/fish/completions/lstk.fish -``` - - - - -```powershell -# Load in current session -lstk completion powershell | Out-String | Invoke-Expression - -# Load in new sessions (Windows, Linux, macOS) -if (!(Test-Path $PROFILE)) { New-Item -ItemType File -Path $PROFILE -Force } -lstk completion powershell | Out-File -Append -Encoding utf8 $PROFILE -``` - -:::note -Use `Out-File -Encoding utf8` rather than `>>`, which writes UTF-16LE on PowerShell 5.1 and leaves a profile PowerShell cannot parse. -::: - - - - -Open a new shell for the changes to take effect. +Run `lstk completion` to print setup instructions in your terminal. ## FAQ From 6d9229edf4cdf620a8fa0304b6b710f2087d9326 Mon Sep 17 00:00:00 2001 From: Joel Scheuner Date: Fri, 11 Sep 2026 16:32:49 +0200 Subject: [PATCH 3/4] Point the completion command entry at lstk completion Co-Authored-By: Claude Opus 5 --- .../aws/developer-tools/running-localstack/lstk/index.mdx | 4 +--- src/content/docs/azure/developer-tools/lstk.mdx | 4 +--- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/src/content/docs/aws/developer-tools/running-localstack/lstk/index.mdx b/src/content/docs/aws/developer-tools/running-localstack/lstk/index.mdx index 73091d4b..df201697 100644 --- a/src/content/docs/aws/developer-tools/running-localstack/lstk/index.mdx +++ b/src/content/docs/aws/developer-tools/running-localstack/lstk/index.mdx @@ -131,8 +131,6 @@ These apply to both interactive and non-interactive (scripted/CI) use, see [Auto `lstk` includes completion scripts for bash, zsh, fish, and powershell. If you installed via Homebrew, completions are set up automatically. -Run `lstk completion` to print setup instructions in your terminal. - ### `completion` Generate shell completion scripts. @@ -141,4 +139,4 @@ Generate shell completion scripts. lstk completion [bash|zsh|fish|powershell] ``` -See [Shell completions](#shell-completions) above for setup instructions. +Run `lstk completion` to print setup instructions in your terminal. diff --git a/src/content/docs/azure/developer-tools/lstk.mdx b/src/content/docs/azure/developer-tools/lstk.mdx index 602ee91a..3733469f 100644 --- a/src/content/docs/azure/developer-tools/lstk.mdx +++ b/src/content/docs/azure/developer-tools/lstk.mdx @@ -1215,7 +1215,7 @@ Generate shell completion scripts. lstk completion [bash|zsh|fish|powershell] ``` -See [Shell completions](#shell-completions) for setup instructions. +Run `lstk completion` to print setup instructions in your terminal. ## Global options @@ -1439,8 +1439,6 @@ Pair this behavior with a custom [`image`](#custom-container-image) that points `lstk` includes completion scripts for bash, zsh, fish, and powershell. If you installed via Homebrew, completions are set up automatically. -Run `lstk completion` to print setup instructions in your terminal. - ## FAQ ### Can I use `lstk` with Docker Compose? From ef5a8223267559d330eb9d950e6d74f51e304aef Mon Sep 17 00:00:00 2001 From: Joel Scheuner Date: Fri, 11 Sep 2026 16:38:33 +0200 Subject: [PATCH 4/4] Repeat the completion pointer under the Azure section header Co-Authored-By: Claude Opus 5 --- src/content/docs/azure/developer-tools/lstk.mdx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/content/docs/azure/developer-tools/lstk.mdx b/src/content/docs/azure/developer-tools/lstk.mdx index 3733469f..8c5598ce 100644 --- a/src/content/docs/azure/developer-tools/lstk.mdx +++ b/src/content/docs/azure/developer-tools/lstk.mdx @@ -1439,6 +1439,8 @@ Pair this behavior with a custom [`image`](#custom-container-image) that points `lstk` includes completion scripts for bash, zsh, fish, and powershell. If you installed via Homebrew, completions are set up automatically. +Run `lstk completion` to print setup instructions in your terminal. + ## FAQ ### Can I use `lstk` with Docker Compose?