Problem/Motivation

Deployment and CI scripts often need to know whether a site is installed, to choose between installing it and updating it. With Drush this is drush status --field=bootstrap. With dr, the only check is a side effect: dr status exits 1 with "Command "status" is not defined" before an install, because system:status comes from the System module, and DrupalApplication only adds module commands once Drupal boots. Any boot failure looks the same, and the message doesn't say what's wrong.

Core has two checks for this, and they disagree:

Steps to reproduce

  1. Create a new project with composer create-project drupal/recommended-project.
  2. Run vendor/bin/dr status; echo $?: it prints "Command "status" is not defined." and 1.
  3. Install the site with vendor/bin/dr install minimal, then run step 2 again: it prints the status table and 0.

Proposed resolution

  1. Move the check into one public InstallerKernel::isSiteInstalled() method that tests both the connection info and the key_value table and uses the installer's install_task/install_time rule, and use it in InstallCommand and InstallerRedirectTrait.
  2. Expose it to dr before Drupal boots with new default site:installed/is-installed command in DrupalApplication that exits 0 when installed and 1 when not.

Remaining tasks

  • Agree on the method, command name and behavior
  • Implement and test it

Generated with the help of an LLM

Claude Code drafted this summary and checked the behavior on Drupal 11.4.13; I reviewed it.

Issue fork drupal-3641324

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

dave reid created an issue. See original summary.

dave reid’s picture

Issue summary: View changes

dave reid changed the visibility of the branch 3641324-add-dr-installed to hidden.

dave reid’s picture

Issue summary: View changes