If you’ve built your own custom PhoneGap plugin for a mobile application and want to publish it to the official Cordova Plugin Repository so others can benefit from it (and you should!!), you may not find it to be as obvious as you might think initially.
There’s a tool called plugman that is used to do this and actually also underlies the phonegap/cordova CLIs for installing/removing plugins used by your projects. Prior to PhoneGap version 3.0 this was the primary means of adding plugins, so if you’ve been working on apps since then you will be familiar with it.
As you’ll see in the README there are a lot of different options on the tool, but if you’re using the CLI then you really don’t need to worry about using it to install or uninstall plugins for your project unless you want to install a certain plugin to only one platform. See the docs here for more details on installing to a specific platform.
If you’re ready to share your plugin with the world however :), you’ll need to use plugman specifically to publish your plugin to the repository. It’s pretty easy to do. First, after you’ve installed plugman (like any other node module), ensure you have your custom plugin set up in a directory with the structure described here under Plugin Directory Structure. Next, simply run the following command to publish it from that directory into the default repository:
$ plugman publish myPluginDirectoryPath
There’s a lot of documentation provided in the README if you’re curious about other things you can do with plugman. Also, more documentation on how to share your own 3rd party plugin will be added to the cordova plugin repository soon to make this more obvious…