npm link with git-style sub commands

I'm having a problem using npm link with a nodejs cli tool built using commander.

Using commander to make a git-style sub command style cli tool I have these files:

foo.js

foo-config.js

And foo.js (the main file looks like this)

#!/usr/bin/env node  
'use strict';

var program = require('commander');
var pkg = require('./package.json');

program
  .version(pkg.version)
  .command('config', 'Creates default configuration files')
  .parse(process.argv);

My package.json has this config

"bin": {
  "foo": "foo.js"
}

When I run npm link it successfully makes the symlink. I can even run the command and see that the config cmd shows up in the help menu.

However when I try to run $ foo config I get the following message

foo-config(1) does not exist, try --help

What do I do now?

The file foo-config.js should be named foo-config without the extension.

Also if installing globally all the executables should be chmod 755