BookmarkSubscribeRSS Feed

Help me type, the sas-viya CLI supports auto-complete

Started 2 weeks ago by
Modified 2 weeks ago by
Views 200

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.

What we will cover

  • Where is it supported and what is supported
  • How to enable it
  • How to use it

 

Where is it supported and what is supported

According to the documentation the auto-complete is supported on:

  • Bash (version 4 or later)
  • Zsh
  • PowerShell (version 5 or later)

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.

 

How to enable it

Before you can enable the auto-complete, you must check the prerequisites.

 

For Bash:

How to check: type complete

Install if missing:

Ubuntu/Debian: sudo apt install bash-completion

RHEL/CentOS: sudo yum install bash-completion

 

For Zsh:

Zsh usually includes autocompletion by default. No additional installation is required.

 

For PowerShell:

Check version: $PSVersionTable.PSVersion

Enable script execution if required: Set-ExecutionPolicy RemoteSigned -Scope CurrentUser

 

Enable auto-completion for sas-viya

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

 

How to use it

Start using the auto-completion feature. Here are a few examples. The text <tab> indicates pressing the tab key.

  • Get a list of commands or plugins:sas-viya <tab><tab>
  • Get a list of plugins starting with com: sas-viya com<tab><tab>
  • Get a list of commands for the job plugin: sas-viya job <tab><tab>
  • Get a list of commands starting with lis for the audit plugin: sas-viya audit lis<tab><tab>

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.

Contributors
Version history
Last update:
2 weeks ago
Updated by:

Catch up on SAS Innovate 2026

Dive into keynotes, announcements and breakthroughs on demand.

Explore Now →

SAS AI and Machine Learning Courses

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.

Get started

Article Tags