Universal Commands

init

This command will take you through a flow to select existing or create a new credential. This includes specifying a universe (production, sandbox) using the –universe flag, selecting or creating new credentials, and choosing a Yext account to work with.

Usage

yext init [ACCOUNT-ID] [flags]

Flags

Flag Description
-h, --help Help for init
-u, --universe The global environment this credential is for, either “production” or “sandbox”. By default this value is “production”.



info

Shows the current credential settings, including credential name, universe, account ID and account name. Writes the output to path if a path is provided.

Usage

yext info [path] [flags]

Flags

Flag Description
-h, --help Help for info



completion

Sets up autocomplete for all subsequent sessions.

Usage

yext completion [bash | zsh | powershell ]

Flags

Flag Description
-h, --help Help for completion


Prerequisites

You must have shell completion enabled in your command line environment. If you don’t have shell completion enabled, you can enable it by following one of the following steps:

For bash:

  • Add [ -f /usr/local/etc/bash_completion ] && . /usr/local/etc/bash_completion to your bash profile.

For zsh:

  • Run echo "autoload -U compinit; compinit" >> ~/.zshrc

For powershell

  • Run yext completion powershell >> $profile

Setting up Autocomplete

If you are using bash on Linux, run

yext completion bash > /etc/bash_completion.d/yext

If you are using bash on Mac OSX, run

yext completion bash > /usr/local/etc/bash_completion.d/yext

If you are using zsh, run

yext completion zsh > “${fpath[1]}/_yext”

If you are using Powershell on Windows, run:

yext completion powershell | Out-String | Invoke-Expression

After running the appropriate command for your system, you must start a new shell session to begin using autocomplete.

Feedback