[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["很难理解","hardToUnderstand","thumb-down"],["信息或示例代码不正确","incorrectInformationOrSampleCode","thumb-down"],["没有我需要的信息/示例","missingTheInformationSamplesINeed","thumb-down"],["翻译问题","translationIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2025-09-04。"],[[["\u003cp\u003eThe gdcloud CLI autocomplete feature allows command completion using the \u003ckbd\u003eTab\u003c/kbd\u003e key in Bash, Zsh, and Fish shells.\u003c/p\u003e\n"],["\u003cp\u003eTo activate autocompletion, you must run a specific \u003ccode\u003egdcloud completion\u003c/code\u003e command tailored to your shell type, followed by a separate configuration command for enabling it on each shell.\u003c/p\u003e\n"],["\u003cp\u003eYou can determine your current shell by using the command \u003ccode\u003eecho $SHELL\u003c/code\u003e, which will output your shell type as \u003ccode\u003ebash\u003c/code\u003e, \u003ccode\u003ezsh\u003c/code\u003e, or \u003ccode\u003efish\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eTo utilize the autocompletion, begin typing a command and press \u003ckbd\u003eTab\u003c/kbd\u003e; a single \u003ckbd\u003eTab\u003c/kbd\u003e will complete the command if only one option is available, and two \u003ckbd\u003eTab\u003c/kbd\u003e presses will list all potential completions if there are more than one.\u003c/p\u003e\n"],["\u003cp\u003eFor Zsh users, enabling shell completion may be required, which can be checked by verifying the \u003ccode\u003eCOMP_LINE\u003c/code\u003e variable or using the command \u003ccode\u003ecompgen -c\u003c/code\u003e, and if disabled, it can be enabled by running \u003ccode\u003eecho "autoload -U compinit; compinit" >> ~/.zshrc\u003c/code\u003e.\u003c/p\u003e\n"]]],[],null,["# gdcloud CLI autocomplete\n\nThis page provides instructions for configuring and using the gdcloud CLI autocomplete feature that enables you to use the \u003ckbd\u003eTab\u003c/kbd\u003e key to complete a partially entered command. This feature is available for Bash, Zsh, and Fish shells.\nThe gdcloud CLI autocompletion is a feature that provides suggestions for commands and options as you type. This can be helpful when you are not sure what command to use or when you want to use a command that you have not used before.\n\nActivate autocompletion\n-----------------------\n\nTo activate the auto--completion feature you will need to run a command for your terminal. The gdcloud CLI autocompletion feature is available for the Bash, Zsh, and Fish shells. Use the following command to figure out which shell you use. \n\n echo $SHELL\n\nThe output looks like `bin/$SHELL` where `$SHELL` is either bash, zsh, or fish.\n\n### Bash\n\nTo load completions in your current shell session: \n\n source \u003c(gdcloud completion bash)\n\nTo load completions for every new session, execute once: \n\n gdcloud completion bash \u003e /etc/bash_completion.d/gdcloud\n\n### Zsh\n\nIf shell completion is not already enabled in your environment, you must enable it. Check whether shell completion is enabled.\n\nCheck the value of the `COMP_LINE` variable. If the value of the `COMP_LINE` variable is empty, then shell completion is not enabled. You can check this value by running the following command: \n\n echo $COMP_LINE\n\nTry to use shell completion with a command. If you try to use shell completion with a command and it does not work, the shell completion is not enabled. For example, try typing the following command and pressing \u003ckbd\u003eTab\u003c/kbd\u003e. If shell completion is enabled, you must see a list of possible completions for the `ls` command. \n\n ls\n\nCheck the output of the compgen -c command. If the output of the `compgen -c` command contains no commands, then shell completion is not enabled. You can run the following command to see the output of the `compgen -c` command. If shell completion is enabled, the output of the command should include a list of commands that have completion functions. \n\n compgen -c\n\nIf you are not sure if shell completion is enabled in your environment, check documentation for your shell.\nIf shell completion is not enabled in your environment, execute the following command to enable it: \n\n echo \"autoload -U compinit; compinit\" \u003e\u003e ~/.zshrc\n\nTo load completions in your current shell session: \n\n source \u003c(gdcloud completion zsh); compdef _gdcloud gdcloud\n\nTo load completions for each session, execute once:\n\n#### Linux\n\n gdcloud completion zsh \u003e \"${fpath[1]}/_gdcloud\"\n\nYou must start a new shell for this setup to take effect.\n\n### Fish\n\nTo load completions in your current shell session: \n\n gdcloud completion fish | source\n\nTo load completions for each session, run: \n\n gdcloud completion fish \u003e ~/.config/fish/completions/gdcloud.fish\n\nYou must start a new shell for this setup to take effect.\n\nUse autocompletion\n------------------\n\nTo use gdcloud CLI autocompletion, type the first few characters of the command that you want to use and then press the \u003ckbd\u003eTab\u003c/kbd\u003e key. If there is only one possible completion, it is automatically inserted into the command line. If the command does not autofill, then that means there are multiple possible completions and you must press the \u003ckbd\u003eTab\u003c/kbd\u003e key again to view all the possible commands.\n\n### Autocomplete examples\n\nType a command partially and then press \u003ckbd\u003eTab\u003c/kbd\u003e to autocomplete the command: \n\n gdcloud con \u003cTab\u003e\n\nComplete command after pressing \u003ckbd\u003eTab\u003c/kbd\u003e once: \n\n gdcloud config\n\nType a command partially and then press \u003ckbd\u003eTab\u003c/kbd\u003e twice to see a list of all possible commands: \n\n gdcloud clusters \u003cTAB\u003e \u003cTAB\u003e\n describe get-credentials list\n gdcloud clusters"]]