How do I create a View from a shell script

I need to script out the first-time setup of data in a Couchbase instance. I was trying to do the following steps:

  1. cbimport a csv file
  2. cbq --script to create a view
  3. cbq --script to create a primary index

But I don’t see any way to do #2. I can’t find a CREATE VIEW command. Is there such a thing? I do I have to use the console?