Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to use autocomplete in saltstack

I want to use bash autocomplete feature with saltstack.

salt '*' test.p <tab> should complete the word and make it salt '*' test.ping.

After googling, I got the following links: salt.bash & CLI completion

However, I cannot figure out how to use it. Autocompletion feature is not working by default. Please provide any step by step guide to activate it.

like image 844
rabit Avatar asked Oct 24 '25 20:10

rabit


1 Answers

  1. Download the salt.bash file.

     wget https://raw.githubusercontent.com/saltstack/salt/develop/pkg/salt.bash
    
  2. Copy the file to /etc/bash_completion.d/

     cp salt.bash /etc/bash_completion.d/
    
  3. Logout and logback in. or source the file

     source /etc/bash_completion.d/salt.bash
    
  4. Now use salt auto-completion feature

     salt '*' tes[[tab]].pi[[tab]]
    

    and get the result:

     salt '*' test.ping
    
like image 120
rabit Avatar answered Oct 26 '25 18:10

rabit