// Module included in the following assemblies:
//
// * cli_reference/openshift_cli/configuring-cli.adoc

:_mod-docs-content-type: PROCEDURE
[id="cli-enabling-tab-completion-zsh_{context}"]
= Enabling tab completion for Zsh

[role="_abstract"]
After you install the OpenShift CLI (`oc`), you can enable tab completion to automatically complete `oc` commands or suggest options when you press Tab. The following procedure enables tab completion for the Zsh shell.

.Prerequisites

* You must have the OpenShift CLI (`oc`) installed.

.Procedure

* To add tab completion for `oc` to your `.zshrc` file, run the following command:
+
[source,terminal]
----
$ cat >>~/.zshrc<<EOF
autoload -Uz compinit
compinit
if [ $commands[oc] ]; then
  source <(oc completion zsh)
  compdef _oc oc
fi
EOF
----
+
Tab completion is enabled when you open a new terminal.
