 fs = require 'fs'
 open = require 'open'
 optimist = require 'optimist'
+path = require 'path'
 readline = require 'readline'
 
 # usage

exit = (msg) ->
  log msg if msg
  process.exit()

log = (msg) ->
  console.log "[dobi] #{msg}"


  # initialize a workspace
  when 'init'
    getWorkspacePath (workspace) ->
      exit "already in a workspace: #{workspace}" if workspace
      fs.writeFile path.join(CWD, 'dobi.json'), JSON.stringify({
        created: Date.now()
      }), (err) ->
        exit 'failed to create workspace config' if err
        fs.mkdir path.join(CWD, 'pkg'), (err) ->
          exit 'failed to create pkg directory' if err
          exit "workspace successfully created at: #{CWD}"

  # create a site using your app
  when 'install'
