diff --git a/lib/agent/index.js b/lib/agent/index.js
index <HASH>..<HASH> 100644
--- a/lib/agent/index.js
+++ b/lib/agent/index.js
@@ -164,10 +164,16 @@ var load_plugin = function(name, cb) {
 
 var run_from_command_line = function() {
   if (!program.debug) logger.pause();
+
   hooks.on('data', console.log);
   hooks.on('error', console.log);
   hooks.on('report', console.log);
-  commands.perform(commands.parse(program.run)[1]);
+
+  var parsed = commands.parse(program.run);
+  if (!parsed)
+    return console.log('Invalid command.');
+
+  commands.perform(parsed[1]);
 }
 
 ////////////////////////////////////////////////////////////////////
Handle invalid command in agent/index.