Index: entitycache.drush.inc
===================================================================
--- entitycache.drush.inc	(revision 0)
+++ entitycache.drush.inc	(revision 0)
@@ -0,0 +1,76 @@
+<?php
+
+/**
+ * @file
+ *   drush integration for entitycache.
+ *   Simple idea - load each of the entities.
+ *   @TODO: Figure out how to do it in batches.
+ *   @TODO: Figure out how to only load entities not yet in cache.
+ *   @TODO: Figure out a way to have it done via a scheduler.
+ */
+
+/**
+ * Implementation of hook_drush_help().
+ */
+function entitycache_drush_help($section) {
+  switch ($section) {
+    case 'drush:entity-load-cache':
+      return dt('Used without parameters, this command loads all the various objects in the entities into cache using entity_load()');
+  }
+}
+
+/**
+ * Implementation of hook_drush_command().
+ */
+function entitycache_drush_command() {
+  $items = array();
+  $items['entitycache-load-cache'] = array(
+    'callback' => 'drush_entitycache_load_cache',
+    'description' => t('Load the cache with the various entities configured to use the cache'),
+    'arguments' => array(
+      'type' => dt('Optional. Only load the particular entity type objects into cache'),
+    ),
+    'drupal dependencies' => array('features'),
+    'bootstrap' => DRUSH_BOOTSTRAP_DRUPAL_FULL,
+    'aliases' => array('elc'),
+  );
+  
+  return $items;
+}
+
+/**
+ * Load the cache bin with content from the various entities.
+ * @param $type Optional. The specific type of entity that should
+ *   get it's content cached.
+ */
+function drush_entitycache_load_cache($type = '') {
+  $types = entitycache_supported_core_entities(TRUE);
+  if (!empty($type)) {
+    if (!isset($types[$type])) {
+      drush_die("Type $type is not supported");
+    }
+    else {
+      _drush_entitycache_load_cache($type);
+    }
+  }
+  else {
+    foreach ($types as $entity_type => $entity_controller) {
+      _drush_entitycache_load_cache($entity_type);
+    }
+  }
+  drush_print("Caching complete!");
+}
+
+/**
+ * Load the cache bin with content from a specific type of entity.
+ */
+function _drush_entitycache_load_cache($type) {
+  drush_print("Begin caching $type");
+  $query = new EntityFieldQuery;
+  $result = $query
+    ->entityCondition('entity_type', $type)
+    ->execute();
+  foreach ($result[$type] as $entity_key => $entity_info) {
+    entity_load($type, array($entity_key), array(), TRUE);
+  }
+}
