### Install zsh-completions Plugin for Zsh Frameworks Source: https://context7.com/zchee/zsh-completions/llms.txt Demonstrates how to install the zsh-completions library using various Zsh plugin managers like Oh My Zsh, Antigen, and Zplug. It also includes the necessary command to reload completions after installation. ```zsh # Manual installation - source the main plugin source /path/to/zsh-completions/zsh-completions.plugin.zsh # Oh My Zsh - add to plugins array in ~/.zshrc plugins=(... zsh-completions) # Antigen antigen bundle zchee/zsh-completions # Zplug zplug "zchee/zsh-completions" # After installation, reload completions autoload -Uz compinit && compinit ``` -------------------------------- ### Go Command Completion Examples Source: https://context7.com/zchee/zsh-completions/llms.txt Illustrates tab-completion capabilities for the Go compiler and toolchain. It covers commands, flags, environment variables, package paths, and GOPATH-relative imports, enhancing Go development workflow. ```zsh # Tab completion examples go build # Shows: -o, -p, -a, -n, -v, -x, -race, etc. go test - # Shows: -bench, -cover, -cpu, -run, -timeout, etc. go env GO # Shows: GOARCH, GOOS, GOPATH, GOROOT, etc. go mod # Shows: init, tidy, vendor, verify, graph, etc. # Package completion with GOPATH awareness go install github.com/user/ # Lists packages in GOPATH/src/github.com/user/ # File completion for go files go run # Shows: *.go files in current directory # Completion definition (internal structure) #compdef go,-P go[0-9.]# -P -value-,GO*,-default- -P -value-,CGO*,-default- ``` -------------------------------- ### Xcodebuild Completion Examples Source: https://context7.com/zchee/zsh-completions/llms.txt Demonstrates tab-completion for Xcode's build system (`xcodebuild`). It dynamically extracts project metadata like schemes, targets, and configurations to provide context-aware suggestions for build actions and parameters. ```zsh # Tab completion examples xcodebuild - # Shows: -project, -scheme, -target, -configuration, -sdk, etc. xcodebuild -scheme # Lists schemes from xcodebuild -list output xcodebuild -sdk # Shows: iphoneos, iphonesimulator, macosx, watchos, etc. # Action completion xcodebuild # Shows: analyze, archive, build, clean, install, test # Dynamic project introspection xcodebuild -target # Parses current project targets xcodebuild -configuration # Shows: Debug, Release (from project) xcodebuild -arch # Shows: arm64, x86_64 (from VALID_ARCHS) ``` -------------------------------- ### Claude CLI Tab Completion Examples Source: https://context7.com/zchee/zsh-completions/llms.txt Demonstrates tab completion for the Claude Code CLI, covering model selection, MCP server configuration, permission modes, and session management. It shows how to leverage tab completion for various options and their respective values. ```zsh # Tab completion examples claude # Shows: mcp, migrate-installer, doctor, update, install claude --model # Shows: sonnet, opus, haiku, sonnet[1m], opusplan claude --permission-mode # Shows: acceptEdits, bypassPermissions, default, plan # Model aliases with descriptions claude --model sonnet # Shows: # sonnet - Uses latest Sonnet model (Sonnet 4) for daily coding # sonnet[1m] - Uses Sonnet with 1M token context window # MCP configuration claude --mcp-config # File completion for JSON configs claude --setting-sources # Shows: user, project, local # Tool filtering claude --allowed-tools "Bash Edit" claude --disallowed-tools "Write" # Session management claude --resume # Prompts for session ID claude --continue # Continues most recent session claude --fork-session # Creates new session from resume point ``` -------------------------------- ### Delve Debugger Completion Examples Source: https://context7.com/zchee/zsh-completions/llms.txt Provides intelligent tab-completion for the Delve debugger (`dlv`). It dynamically adapts suggestions based on the operating system and context, including commands, package paths, process IDs, and backend options. ```zsh # Tab completion examples dlv # Shows: attach, connect, dap, debug, exec, test, trace, version dlv debug # Shows: package paths from GOPATH dlv attach # Shows: process IDs and flags dlv --backend # Shows: default, native, lldb, rr # Platform-aware completion (Linux only) dlv core # Available on Linux/Cygwin/MSYS only # Backend selection dlv debug --backend= # Shows: default (lldb on macOS, native elsewhere) # Completion handles Go package resolution dlv test ./... # Expands to packages in workspace ``` -------------------------------- ### Dynamic zsh Completion with Runtime State Source: https://context7.com/zchee/zsh-completions/llms.txt Illustrates how to build zsh completions that utilize runtime state, such as querying project files, tool profiles, or environment variables. It demonstrates helper functions for dynamic querying, caching expensive operations, and GOPATH-aware package completion. ```zsh # Query project state dynamically _project_files() { local -a files files=($(find . -type f -name "*.ext" 2>/dev/null)) _describe "project files" files } # Query environment state _tool_profiles() { local -a profiles profiles=($(mytool profiles --list 2>/dev/null | awk '{print $1}')) _values "profiles" $profiles } # Cache expensive operations _cached_completion() { if (( $+_cache_var )) || _retrieve_cache cache_key; then return fi typeset -a -g _cache_var _cache_var=($(expensive_query)) _store_cache cache_key _cache_var _describe "items" _cache_var } # GOPATH-aware package completion _go_packages() { local -a gopaths gopaths=("${(s/:/)$(go env GOPATH)}") gopaths+=("$(go env GOROOT)") for p in $gopaths; do _alternative ":go packages:_path_files -W \"$p/src\" -/" done } # Use in _arguments _arguments \ "--file:file:_project_files" \ "--profile:profile:_tool_profiles" \ "--package:package:_go_packages" ``` -------------------------------- ### Load Specific zsh-completions Categories Source: https://context7.com/zchee/zsh-completions/llms.txt Shows how to selectively load completion categories for Go tools, macOS utilities, or general development tools. This method reduces startup overhead by only loading necessary completion scripts. ```zsh # Load only Go tool completions source /path/to/zsh-completions/src/go/go-zsh-completions.plugin.zsh # Load only macOS system tool completions source /path/to/zsh-completions/src/macOS/macOS-zsh-completions.plugin.zsh # Load only general development tool completions source /path/to/zsh-completions/src/zsh/zsh-completions.plugin.zsh # Combine multiple categories source /path/to/zsh-completions/src/go/go-zsh-completions.plugin.zsh source /path/to/zsh-completions/src/zsh/zsh-completions.plugin.zsh fpath=($fpath /path/to/zsh-completions/src/{go,zsh}) ``` -------------------------------- ### Custom zsh Completion Function Structure Source: https://context7.com/zchee/zsh-completions/llms.txt Provides a template for creating custom zsh completion functions following the `compdef` standard. It includes a BSD-3-Clause license header, argument parsing using `_arguments`, and state management for multi-level command completion. ```zsh #compdef mytool # Standard BSD-3-Clause license header (see existing files) function _mytool() { local context curcontext=$curcontext state line ret=1 declare -a opt_args # Define commands local -a commands commands=( "subcommand1:Description of subcommand1" "subcommand2:Description of subcommand2" ) # Parse arguments _arguments -C \ {-h,--help}"[Show help message]" \ {-v,--version}"[Show version]" \ "--flag[Flag description]:value:->values" \ "1: :{_describe 'mytool commands' commands}" \ "*:: :->args" \ && ret=0 # Handle states for multi-level completion case $state in values) _values "option" \ "value1[Description]" \ "value2[Description]" ;; args) case $words[1] in subcommand1) \ _arguments \ "--sub-flag[Subcommand flag]" ;; esac ;; esac return ret } _mytool "$@" ``` -------------------------------- ### CircleCI CLI Tab Completion Source: https://context7.com/zchee/zsh-completions/llms.txt Details tab completion for the CircleCI CLI, emphasizing cached orb listing for performance and dynamic fetching from the CircleCI registry. It illustrates how to complete commands like 'orb list' and 'orb source'. ```zsh # Tab completion examples circleci # Shows: config, orb, build, local, setup, etc. circleci orb # Shows: list, source, validate, publish, etc. # Cached orb completion for performance circleci orb source # Lists all orbs (cached): circleci/node, circleci/python # Cache implementation (internal) # _circleci_all_orbs caches orb list to avoid repeated API calls # Invalidates cache automatically based on time threshold # Orb listing circleci orb list -u # Shows certified orbs circleci orb source circleci/ # Completes orb names # Skip update check flag respected circleci --skip-update-check orb list ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.