SingleStore Toolbox Command Auto-Completion
On this page
As of Toolbox 1.bash
and zsh
shells when Toolbox is installed via .
and .
packages, as well as via tarball with some additional configuration.
Important
The bash-completion
package must be installed on a host that has SSH access to all hosts in the cluster.
Toolbox is installed when deploying a new self-managed cluster, or may be installed manually, typically on the cluster’s Master Aggregator host.
Install bash-completion
-
Determine if the
bash-completion
package is installed.Red Hat Distributions
sudo yum list installed | grep bash-completionbash-completion.noarch 1:2.1-8.el7 @base libvirt-bash-completion.x86_64 4.5.0-36.el7_9.3 @updates
Debian Distributions
sudo dpkg-query --list | grep bash-completionii bash-completion 1:2.10-1ubuntu1 all programmable completion for the bash shell
-
If
bash-completion
is not installed or is earlier than version 2.7, install the latest bash-completion
package.Red Hat Distributions
sudo yum install bash-completionDebian Distributions
sudo apt install bash-completion
Copy the Auto-Completion Script
Important
This step is only required for tarball-based Toolbox installs..
or .
packages, skip this step.
-
Copy the Toolbox auto-completion script to the
/etc/bash_
directory.completion. d sudo cp <path-to-toolbox>/sdb-autocomplete/bash-completion-sdb-tools /etc/bash_completion.d/where
<path-to-toolbox>
is the full path to the folder that contains the Toolbox binaries (the folder that is created when the Toolbox.
file is extracted).tar. gz
Configure Your Shell
This section demonstrates how to configure bash
and zsh
shells to enable the Toolbox auto-completion feature for terminal sessions.
bash
You may use this feature by manually sourcing the bash-completion-sdb-tools
file in each new terminal session.
source /etc/bash_completion.d/bash-completion-sdb-tools
To automatically enable this feature in each new terminal session:
-
Add the following command to your shell profile, such as the
~/.
file, or thebashrc ~/.
file.bash_ profile echo "source /etc/bash_completion.d/bash-completion-sdb-tools" >> ~/.bashrc– or –
echo "source /etc/bash_completion.d/bash-completion-sdb-tools" >> ~/.bash_profile -
This feature is now enabled for each new terminal session.
For those terminal sessions that are already open, source your shell profile to use this feature. source ~/.bashrc– or –
source ~/.bash_profile
zsh
To automatically enable this feature in each new terminal session:
-
Add the following command to your
.
file.zshrc For
.
orrpm .
package installsdeb echo 'fpath=( /usr/share/sdb/zsh "${fpath[@]}" )' >> ~/.zshrcFor tarball installs
echo 'fpath=( <path-to-toolbox>/sdb-autocomplete "${fpath[@]}" )' >> ~/.zshrcwhere
<path-to-toolbox>
is the full path to the folder that contains the Toolbox binaries (the folder that is created when the.
file is extracted).tar. gz -
Add the following command to your
.
file.zshrc echo "autoload -U compinit; compinit" >> ~/.zshrc -
This feature is now enabled for each new terminal session.
For those terminal sessions that are already open, source your shell profile to use this feature. source ~/.zshrc
Using Toolbox Auto-Completion
When entering a Toolbox command such as sdb-admin
, sdb-deploy
, sdb-report
, and sdb-toolbox-config
, press the [Tab] key to see a list of available sub-commands and flags.
sdb-deploy [Tab]
For tarball installs, run this command from the folder that is created when the Toolbox .
file is extracted.
./sdb-deploy [Tab]
This will display the list of available sub-commands (with a description of the command if using zsh
):
cluster-in-a-box destroy-cluster envgenerate-cluster-file install list-versionssetup-cluster ui uninstallupgrade version
Note: In zsh
, you may select a sub-command by pressing the [Tab] key repeatedly.
Example
To complete sdb-deploy install --file-path
, begin typing the command and press the [Tab] key.
sdb-deploy i[Tab]
This will auto-complete to the install
sub-command:
sdb-deploy install
You may then use the same method to find available flags and auto-complete the rest of the command.
Where:
sdb-deploy install --fi[Tab]
becomes:
sdb-deploy install --file-path
Resources
Refer to the SingleStore Tools Reference for more information on the available sub-commands and flags for each Toolbox command.
Last modified: June 22, 2022