So far the easiest way I've found to manage views from the CLI is using couchapp
Please follow the installation instructions on that project. Having a db named db_name we can get any view present in the db using
couchapp clone "http://127.0.0.1:5984/db_name/_design/document_name" destination_folder
this will create the following structure:
destination_folder
├── _id
├── language
└── views
├── view1
│ └── map.js
├── viewn
└── map.js
It is general better to name destination_folder as the document_name.
You can now make changes locally and push them as:
cd destination_folder && couchapp push "http://127.0.0.1:5984/db_name" && cd ..
Be aware that any change is all-of-nothing, and that any change on the local replica will propagate to the couchdb you are pushing to.
It seems when using couchapp we can share modules easily. CouchDB implements support for this but it doesn't work in certain cases. For example with CouchDB plugin for Lucene, see issue