With drush entity you can query the entity system available for Drupal 8, 7 and (some of) 6.

To install it just drush dl drush_entity

Next you can try some commands like

drush entity-type-read
drush entity-type-read node
drush entity-read node 12

The following commands should work against Drupal 6, Drupal 7 and Drupal 8. Please report bugs when this is not the case.

drush entity-update node 3
drush entity-read node 3  |  less
#read in json format
drush entity-read node 3 --format=json
drush entity-type-read user
drush entity-type-read node --fields=label
drush entity-type-read user node --fields=label,bundles/*/label,drush/count

You can also watch a video on http://www.youtube.com/watch?v=cVGZzWjdDh8 demonstrating some features (It takes you 1 minute.)

A list of commands used in this video can be found on http://build2be.com/content/drush-entity-support-patch-needs-review

Remaining tasks

#1005480: Create a new project to develop Drush entity support suggests a devel_generate approach but whilst working on the patch the create workflow tends to be a template driven one. That is

  1. Query ie an exisiting node drush --json entity-read node 1
  2. Remove values from the json which are to be replaced by new values
  3. Next edit the json with new values
  4. Run drush entity-create node /path/to/file/new-node.json

Files #1330504: Test the File entity

Project Information