         cpus = parseInt argv.shift() if argv[0]?.indexOf '-' < 0
         cpus = 1 if isNaN cpus or cpus < 1
         cpus = MAX_CPUS if cpus > MAX_CPUS
+      when '-s', '--source'
+        source = argv.shift() if argv[0]?.indexOf '-' < 0
+      when '-o', '--out', '-d', '--dynamic'
+        dynamic = argv.shift() if argv[0]?.indexOf '-' < 0
       when '-l', '--language'
         switch argv.shift()
           when 'javascript', 'js' then language = 'javascript'
           else console.error style.error 'Only support javascript or coffeescript language, default coffeescript'
 
+  # build source codes
+  lib = path.join basedir, dynamic
+  src = path.join basedir, source
+  if (language is 'coffeescript') and (fs.existsSync src)
+    fs.mkdirSync lib unless fs.existsSync lib
+    options = ['-w', '-c', '-b', '-o']
+    options = options.concat [dynamic, source]
+    app = spawn 'coffee', options
+    app.stderr.pipe process.stderr
+    app.stdout.pipe process.stdout
+
+  # watch dynamic contents folder
+  (fs.watch lib, -> restart env, cpus) if fs.existsSync lib
+
+  # when worker exit restart it
+  cluster.on 'exit', (worker, code, signal) ->
+    pid = worker.process.pid
+    delete workers[pid]
+    start env if signal isnt 'SIGKILL'
   # found boot file
   filename = path.join basedir, 'index.js'
   unless fs.existsSync filename
     console.error style.error 'Can not found index.js file in ' + basedir
     process.exit 0
   cluster.setupMaster exec: filename
-
-  # when worker exit restart it
-  cluster.on 'exit', (worker, code, signal) ->
-    pid = worker.process.pid
-    delete workers[pid]
-    start env if signal isnt 'SIGKILL'
-
   # running server process
   add env, cpus
 

  i = 0
  message = util.format '\n  %s', style.header '\tPID\tTIME                  '
  for pid, worker of workers
    date = worker.date
    year = date.getFullYear()
    month = date.getMonth() + 1
    month = '0' + month if month < 10
    day = date.getDate()
    day = '0' + day if day < 10
    message += util.format '\n   %d\t%s\t%s-%s-%s %s', ++i, style.int(pid), year, month, day, worker.date.toLocaleTimeString()
  console.log message + '\n'

# Add server process

\n  Options:
\n    -c, -n, --cpus <cpus>     start server proess, each process uses a cpu
\n                              core, default start 1 process
\n    -s, --source <dir>        coffeescript sources path, default path is src
\n    -o, --out <dir>           coffeescript output path, default path is lib
\n    -d, --dynamic <dir>       dynamic contents path, default path is lib
\n    -l, --language <lang>     programming language:
\n                                - javascript
\n                                - coffeescript
\n                              default language is coffeescript
\n
\n  Commands:
\n    add [<cpus>]              add a server process, each process uses a cpu
\n                              core, default add 1 process
\n    clear                     clear screen
\n    error [[-]<id>]           list all internal errors, check error
\n                              information by error id or delete error by
\n                              error id
\n    help                      commands help infomation
\n    list                      list all server processes
\n    remove <pid>              shutdown a server process by process id
\n    quit                      quit pilot shell and shutdown all server
\n                              processes
\n
