Thursday, March 07, 2024

Membuat Alias untuk Github Copilot CLI

Untuk membuat alias untuk Github Copilot, misal ?? untuk menggantikan `gh copilot suggest`, beberapa baris alias berikut dapat ditambahkan pada fail `.bashrc`.
alias '??'='gh copilot suggest -t shell'
alias 'git?'='gh copilot suggest -t git'
alias 'explain'='gh copilot explain'
Dengan cara ini kita bisa mempermudah hidup dan menghemat waktu. Berikut contohnya:
bagus@m049:~$ ?? list WAV files less than 1 MB

Welcome to GitHub Copilot in the CLI!
version 0.5.4-beta (2024-01-04)

I'm powered by AI, so surprises and mistakes are possible. Make sure to verify any generated code or suggestions, and share feedback so that we can learn and improve. For more information, see https://gh.io/gh-copilot-transparency

Suggestion:                                                                     
                                                                                
  find . -name "*.wav" -size -1M                                                

? Select an option
> Exit
bagus@m049:~$ git? show history

Welcome to GitHub Copilot in the CLI!
version 0.5.4-beta (2024-01-04)

I'm powered by AI, so surprises and mistakes are possible. Make sure to verify any generated code or suggestions, and share feedback so that we can learn and improve. For more information, see https://gh.io/gh-copilot-transparency

Suggestion:                                                                     
                                                                                
  git log                                                                       

? Select an option
> Exit
bagus@m049:~$ explain "make -j 5"

Welcome to GitHub Copilot in the CLI!
version 0.5.4-beta (2024-01-04)

I'm powered by AI, so surprises and mistakes are possible. Make sure to verify any generated code or suggestions, and share feedback so that we can learn and improve. For more information, see https://gh.io/gh-copilot-transparency

Explanation:                                                                    
                                                                                
  • make is a build automation tool used to compile and build projects.         
    • -j 5 specifies the maximum number of jobs (parallel tasks) that make can  
    run simultaneously. In this case, it is set to 5.  

Related Posts Plugin for WordPress, Blogger...