Hi Dan,
> Is there any documentation out there on what the various keys in the box.json file are used for?
I am still working on the “Package Management” portion of the docs. We do have a sample box.json with comments for each property here:
http://www.ortussolutions.com/products/commandbox/docs/current/package-management/boxjson
> “packageDirectory”: “lib/”
This has no bearing on where dependencies are installed to. This controls the name of the folder THAT package installs to instead of the slug. For instance, the “coldbox-be” packaged on ForgeBox has a packageDirectory set to “coldbox” since we don’t want CommandBox putting it in a folder called “coldbox-be” or the default mapping from the web root wouldn’t work. Generally speaking, you should probably never need to use this property.
> every time I run “box install” from the root directory where the box.json file is, TestBox gets created in the root folder.
Yep, the current directory is the default install location for any package that is not a module, command, plugin, or interceptor.
> “installPaths”:{
> “testbox”:“lib/testbox”
> }
The installPaths are only used for uninstallation right now. CommandBox will store the location where it installed a package to after it finishes the installation (providing packageDirectory was set to false in that package). Perhaps that could make a nice feature request-- for CommandBox to use the installPaths location if it exists for that package to override the default location.
> Is what I’m trying to do possible?
Well, if you were specifically installing that library, you could just use the “directory” parameter like so;
install testbox …/lib
However, if you’re just doing “install” and letting CommandBox install your dependencies for you, it’s going to use the default location.
Figuring out how to make installations work has been a little tricky since there’s no precedence for this behavior in other package managers that we’ve looked at. In NPM, for instance, there’s no such thing as you choosing where to install a package. They go into node_modules and there’s nothing you can do about it. CommandBox is trying to introduce a lot more flexibility by giving people control over where things install to but we’re making up a lot of these rules as we go so your input is welcome 
Personally, I think it makes the most sense to use the installPaths if they’re defined. Of course, you’ll need to have the appropriate mapping defined in your Application.cfc.
Thanks!
~Brad
ColdBox Platform Evangelist
Ortus Solutions, Corp
E-mail: brad@coldbox.org
ColdBox Platform: http://www.coldbox.org
Blog: http://www.codersrevolution.com