1

I would like to get autocomplete suggestions for a command line (e.g. git) but through code in nodejs

so basically, I want to write code that given a command line, gets the autocomplete result.

for example: git b should output bisect blame branch bundle

so far I've tried using shelljs with the following:

shell.exec('git b\t\t', function(code, output){
    console.log(output); 
})

but I keep getting errors from git. 'b' is not a git command. See 'git --help'.

EDIT

currently I am using solution from: Accessing bash completions for specific commands programmatically

but this solution is very specific to OS and command. I am still interested in a library that will do it for me or some real easy solution.

how to get this done? is there a better way to resolve this?

Community
  • 1
  • 1
guy mograbi
  • 27,391
  • 16
  • 83
  • 122

0 Answers0