diff --git a/phpx_tools.module b/phpx_tools.module
index f0e27d2..ddb602f 100644
--- a/phpx_tools.module
+++ b/phpx_tools.module
@@ -7,6 +7,7 @@
 
 define('PHPX_TOOLS_PATH', drupal_get_path('module', 'phpx_tools'));
 define('PHPX_TOOLS_DATE_FORMAT', 'd.m.Y H:i:s');
+define('PHPX_TOOLS_CODEMIRROR_URL', 'http://codemirror.net/codemirror.zip');
 
 module_load_include('inc', 'phpx_tools', 'phpx_tools.history');
 module_load_include('inc', 'phpx_tools', 'phpx_tools.userscript');
@@ -86,7 +87,7 @@ function phpx_tools_libraries_info() {
   $libraries['codemirror'] = array(
     'name' => 'Codemirror',
     'vendor url' => 'https://codemirror.net/',
-    'download url' => 'http://codemirror.net/codemirror.zip',
+    'download url' => PHPX_TOOLS_CODEMIRROR_URL,
     'version arguments' => array(
       'file' => 'package.json',
       'pattern' => '/"version":"(\d+.\d+.\d+)"/',
diff --git a/phpx_tools.drush.inc b/phpx_tools.drush.inc
new file mode 100644
index 0000000..1b4ea5d
--- /dev/null
+++ b/phpx_tools.drush.inc
@@ -0,0 +1,48 @@
+<?php
+/**
+ * @file
+ * Drush commands for phpx_tools module.
+ */
+
+/**
+ * Implements hook_drush_command().
+ */
+function phpx_tools_drush_command() {
+  $items['phpx-tools-codemirror'] = array(
+    'description' => dt('Download codemirror plugin for phpx_tools module.'),
+    'bootstrap' => DRUSH_BOOTSTRAP_DRUSH,
+    'arguments' => array(
+      'path' => dt('A path where to download the Codemirror. Drupal will use sites/all/libraries if not presented.'),
+    ),
+  );
+
+  return $items;
+}
+
+/**
+ * Drush command callback for phpx-tools-codemirror command.
+ *
+ * Downloads Codemirror library to the selected path.
+ */
+function drush_phpx_tools_codemirror($path = NULL) {
+  if (empty($path)) {
+    $path = 'sites/all/libraries';
+  }
+  // Save current directory to return to it after script will be finished.
+  $current_directory = getcwd();
+  chdir($path);
+
+  // Download file
+  $file = drush_download_file(PHPX_TOOLS_CODEMIRROR_URL);
+
+  drush_tarball_extract($file);
+
+  foreach (scandir('.') as $dir) {
+    if (strpos($dir, 'codemirror') === 0) {
+      drush_move_dir($dir, 'codemirror', TRUE);
+      break;
+    }
+  }
+
+  chdir($current_directory);
+}
