From b641198f56b42608b0339b90a91b811e5eb59f57 Mon Sep 17 00:00:00 2001 From: av Date: Thu, 28 May 2026 11:49:38 +0300 Subject: [PATCH] adding completion configs into readme --- README.md | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/README.md b/README.md index ea99bc1..225769d 100644 --- a/README.md +++ b/README.md @@ -81,6 +81,44 @@ srvctl context update --default srvctl context delete ``` +### Shell Completion + +`srvctl` can generate completion scripts for `bash`, `zsh`, `fish`, and `powershell`. + +**Quick check (current shell only):** + +```sh +source <(srvctl completion bash) # or: zsh / fish +``` + +**Permanent install — bash:** + +```sh +# Linux +srvctl completion bash | sudo tee /etc/bash_completion.d/srvctl >/dev/null + +# macOS (with Homebrew's bash-completion) +srvctl completion bash > "$(brew --prefix)/etc/bash_completion.d/srvctl" +``` + +Requires the `bash-completion` package. Start a new shell after install. + +**Permanent install — zsh:** + +```sh +# Ensure compinit is enabled in ~/.zshrc: +# autoload -U compinit && compinit +srvctl completion zsh > "${fpath[1]}/_srvctl" +``` + +**Permanent install — fish:** + +```sh +srvctl completion fish > ~/.config/fish/completions/srvctl.fish +``` + +For full details on any shell, run `srvctl completion --help`. + ## Documentation Documentation is accessible via `man` or via `--help` flag, for example: