Answers.Body: <p>The readme for cv needs updating. It's now tested pretty well with drupal 8. I would use cv instead.</p>
  <p>See also <a href="https://lab.civicrm.org/dev/drupal/-/issues/76" rel="nofollow noreferrer">https://lab.civicrm.org/dev/drupal/-/issues/76</a></p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-11-12T13:59:36.743Z
Answers.LastActivityDate: 2020-11-12T13:59:36.743Z
Answers.UserDisplayName: Demerit
Body: <p>I have installed CiviCRM 5.31 on Drupal 8 with the following set of commands according to the official <a href="https://www.drupal.org/docs/develop/using-composer/using-composer-to-install-drupal-and-manage-dependencies" rel="nofollow noreferrer">Drupal</a> and <a href="https://docs.civicrm.org/installation/en/latest/drupal8/" rel="nofollow noreferrer">CiviCRM</a> documentation:</p>
  <pre><code>cd /var/www
  composer create-project drupal/recommended-project:8.9.8 d8.example.org
  cd d8.example.org
  composer require drush/drush
  vendor/bin/drush site:install
  composer config extra.enable-patching true
  composer require civicrm/civicrm-asset-plugin:'~1.1'
  composer require civicrm/civicrm-{core,packages,drupal-8}:'~5.31'
  # now enable CiviCRM module in web UI
  </code></pre>
  <p>Now I want to setup scheduled jobs as <a href="https://docs.civicrm.org/sysadmin/en/latest/setup/jobs/#drush" rel="nofollow noreferrer">outlined</a> in CiviCRM's documentation. Running <code>vendor/bin/drush civicrm-api</code>, however, leads to the following error:</p>
  <pre>Command "civicrm-api" is not defined.</pre>
  <p><del>As of November 2020, <a href="https://github.com/civicrm/cv" rel="nofollow noreferrer">cv</a> is untested for Drupal 8</del>, so I would like to use <code>drush</code>. What's the &quot;official&quot; way to do this?</p>
  <hr />
  <p>Software versions</p>
  <ul>
  <li>PHP 7.3.24</li>
  <li>mysql 8.0.22</li>
  <li>Composer 2.0.6</li>
  <li>Drush Commandline Tool 10.3.5</li>
  <li>Drupal 8.9.8</li>
  <li>CiviCRM 5.31.0</li>
  </ul>
  
Tags: <drupal><installation><drupal-8><scheduled-job><drush>
Title: How do I access drush commands specific to CiviCRM?
ThreadText: # How do I access drush commands specific to CiviCRM?
  
  (Asked by: username_0 on 2020-11-12)
  
  I have installed CiviCRM 5.31 on Drupal 8 with the following set of commands according to the official Drupal and CiviCRM documentation:
  cd /var/www
  composer create-project drupal/recommended-project:8.9.8 d8.example.org
  cd d8.example.org
  composer require drush/drush
  vendor/bin/drush site:install
  composer config extra.enable-patching true
  composer require civicrm/civicrm-asset-plugin:'~1.1'
  composer require civicrm/civicrm-{core,packages,drupal-8}:'~5.31'
  # now enable CiviCRM module in web UI
  
  Now I want to setup scheduled jobs as outlined in CiviCRM's documentation. Running vendor/bin/drush civicrm-api, however, leads to the following error:
  Command "civicrm-api" is not defined.
  As of November 2020, cv is untested for Drupal 8, so I would like to use drush. What's the "official" way to do this?
  
  Software versions
  
  PHP 7.3.24
  mysql 8.0.22
  Composer 2.0.6
  Drush Commandline Tool 10.3.5
  Drupal 8.9.8
  CiviCRM 5.31.0
  
  **Tags:** drupal, installation, drupal-8, scheduled-job, drush
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2020-11-12. Score: 3 | Accepted answer
  
  The readme for cv needs updating. It's now tested pretty well with drupal 8. I would use cv instead.
  
  See also <https://lab.civicrm.org/dev/drupal/-/issues/76>
  
  
  ---
  
  