     programDone()
 
   _bash_complete: () ->
-    console.log (cmd._name for cmd in commander.commands when cmd._name isnt "*").join(" ")
+    str = (cmd._name for cmd in commander.commands when cmd._name isnt "*").join(" ")
+    console.log str
+    cacheCompletions str
     programDone()
 
   _cd: () ->


cmds.extend defaultCommands


# check for private commands first (start with underscore)
if process.argv.length == 3


  # eval "$(./app.js init)"
  init: () ->
    cacheFile = path.join(config.getDataDir(), "bash_completions")
    console.log """
    function _qdwrap() {
      local cmd newPath
