In a Linux terminal we are used to auto-complete for commands, filenames and so on. However when using the sas-viya command-line interface (CLI), pressing the tab key would do nothing. Of course you do have the built-in help, but it is not the same experience.
Beginning with Stable 2026.02 the sas-viya CLI now supports auto-completion for plugins and commands. This article will introduce you how to enable this feature and how to use it.
According to the documentation the auto-complete is supported on:
These are all the platforms where the sas-viya CLI is supported.
Currently plugin names and commands with subcommands are supported. Flags and options may come at a later time. In this article we talk about the sas-viya CLI. The same functionality is also available for the sas-admin CLI.
Before you can enable the auto-complete, you must check the prerequisites.
How to check: type complete
Install if missing:
Ubuntu/Debian: sudo apt install bash-completion
RHEL/CentOS: sudo yum install bash-completion
Zsh usually includes autocompletion by default. No additional installation is required.
Check version: $PSVersionTable.PSVersion
Enable script execution if required: Set-ExecutionPolicy RemoteSigned -Scope CurrentUser
You need to enable auto-completion using this command: sas-viya enable-completion --true
On Linux, the command will respond with:
The following changes will be made to your shell configuration file: /home/student/.bashrc Modifications: - Add source line: source "/home/student/.sas/scripts/master_bash.sh" User config backup created at: /home/student/.sas/userConfigBackup/bashrc_140240708_492423 Autocompletion enabled successfully. Please reload or reopen your shell to apply the changes.
The necessary scripts for the auto-completion feature are stored in $HOME/.sas/scripts
You can disable it using: sas-viya enable-completion --false
When you enable or disable the auto-complete the file $HOME/.sas/scripts/master_bash.sh is updated accordingly.
Please make sure to update all the plugins as well to support the auto-completion for the individual plugin. You can do it using this command: sas-viya plugins install --repo SAS all
Start using the auto-completion feature. Here are a few examples. The text <tab> indicates pressing the tab key.
Please note the presence or absence of a space just before the <tab> key, you will either get a full list or partial list of plugins or commands.
When you have reached the end of a command, there are no more subcommands, and press the tab key, you will get a listing of files in your current directory.
Example: sas-viya cas caslibs list <tab><tab>
Just press "q" to end this list.
I am sure this is a welcome productivity feature for using the sas-viya/sas-admin CLI commands in your daily work. You will still use the help when it comes to the options of a specific command.
Find more articles from SAS Global Enablement and Learning here.
Dive into keynotes, announcements and breakthroughs on demand.
Explore Now →The rapid growth of AI technologies is driving an AI skills gap and demand for AI talent. Ready to grow your AI literacy? SAS offers free ways to get started for beginners, business leaders, and analytics professionals of all skill levels. Your future self will thank you.