   run: (options) ->
     {callback} = options
     options = @parseOptions(options.commandArgs)
-
     user = options.argv.user?.toString().trim()
 
     @getStarredPackages user, (error, packages) ->
-      if error?
-        callback(error)
-        return
+      return callback(error) if error?
 
       if options.argv.themes
         packages = packages.filter ({theme}) -> theme
 
-      if options.argv.json
+      if options.argv.install
+        return callback() if packages.length is 0
+
+        commandArgs = packages.map ({name}) -> name
+        new Install().run({commandArgs, callback})
+      else if options.argv.json
         console.log(JSON.stringify(packages))
+        callback()
       else
         if options.argv.themes
           label = "Themes starred by #{user}"

optimist = require 'optimist'

Command = require './command'
config = require './config'
request = require './request'
tree = require './tree'

        console.log()
        console.log "Use `apm install` to install them or visit #{'http://atom.io/packages'.underline} to read more about them."
        console.log()
        callback()
