title: How to add tab completion to a Nodejs CLI app
body: <p>I want to add tab completion to a Nodejs CLI app (And preferably generate the tab completion dynamically).</p>
  
  <p>I found a few npm modules but not sure how to really implement them:</p>
  
  <p><a href="https://github.com/hij1nx/complete" rel="noreferrer">https://github.com/hij1nx/complete</a></p>
  
  <p><a href="https://github.com/mklabs/node-tabtab" rel="noreferrer">https://github.com/mklabs/node-tabtab</a></p>
  
  <p>So what I am looking for is so I can have a nodejs file that is something like:</p>
  
  <pre><code>my-cmd create arg1 arg2
  </code></pre>
  
  <p>But then I might want to autocomplete like:</p>
  
  <pre><code>my-cmd cr&lt;tab&gt; -&gt; create
  </code></pre>
  
  <p>Thanks!</p>