diff --git a/README.md b/README.md index e5e4318..07fc871 100644 --- a/README.md +++ b/README.md @@ -697,6 +697,26 @@ Get-Content issue.json | gitlink-cli api POST /Gitlink/forgeplus/issues --body-s gitlink-cli api GET /Gitlink/forgeplus/commits --query 'page=1&limit=5' ``` +### Shell Completion + +`gitlink-cli` ships with built-in shell completion (bash / zsh / fish / PowerShell): + +```bash +# Bash (add to ~/.bashrc) +source <(gitlink-cli completion bash) + +# Zsh (add to ~/.zshrc) +source <(gitlink-cli completion zsh) + +# Fish +gitlink-cli completion fish | source + +# PowerShell +gitlink-cli completion powershell | Out-String | Invoke-Expression +``` + +Run `gitlink-cli completion --help` for install-once instructions per shell. + ## Global Parameters | Parameter | Description | Example | diff --git a/README.zh-CN.md b/README.zh-CN.md index 6a8879d..3839742 100644 --- a/README.zh-CN.md +++ b/README.zh-CN.md @@ -571,6 +571,26 @@ Get-Content issue.json | gitlink-cli api POST /Gitlink/forgeplus/issues --body-s gitlink-cli api GET /Gitlink/forgeplus/commits --query 'page=1&limit=5' ``` +### Shell 自动补全 + +`gitlink-cli` 内置 bash / zsh / fish / PowerShell 补全: + +```bash +# Bash(加入 ~/.bashrc) +source <(gitlink-cli completion bash) + +# Zsh(加入 ~/.zshrc) +source <(gitlink-cli completion zsh) + +# Fish +gitlink-cli completion fish | source + +# PowerShell +gitlink-cli completion powershell | Out-String | Invoke-Expression +``` + +各 shell 的一次性安装方式见 `gitlink-cli completion --help`。 + ## 全局参数 | 参数 | 说明 | 示例 |