Skip to content

drupal init

Paulo Maia Carvalho edited this page May 20, 2026 · 1 revision

drupal-init

Initialize a Drupal project in /workspace/drupal. Supports three entry points: new project via Composer, existing project via Git clone, or a partially existing folder.

Usage

/drupal-init

No parameters required — the skill walks you through each step interactively.

What it does

Step 1 — Detect existing state

Checks whether /workspace/drupal already exists and whether it looks like a Drupal project (has composer.json referencing drupal/core).

Possible states:

  • Empty / not found — proceeds directly to project type selection
  • Partial — warns the user and asks whether to overwrite
  • Full project found — asks for explicit confirmation before touching anything

Step 2 — Choose project type

Option Description
New Composer project Runs composer create-project drupal/recommended-project
Clone from Git Clones a repository URL and runs composer install

Step 3a — New project via Composer

composer create-project drupal/recommended-project /workspace/drupal --no-interaction
cd /workspace/drupal
composer require drush/drush
composer require drupal/admin_toolbar drupal/devel

Also creates a minimal web/sites/default/settings.php with database credentials pointing to the Docker stack.

Step 3b — Clone from Git

git clone <URL> /workspace/drupal
cd /workspace/drupal
composer install

Step 4 — Optional database import

Asks whether you have an SQL dump to import. Accepts .sql or .sql.gz. Requires the Docker stack to be running — warns if it isn't and offers to continue without import.

Step 5 — Optional files import

Asks whether you have a files/ archive (.zip or .tar.gz) to import into web/sites/default/files/. Extracts and sets correct permissions.

Step 6 — Docker stack preparation

Creates the Docker compose configuration in /workspace/.piclaw/stack if it doesn't exist yet.

Step 7 — Final status

Checks whether the stack is already running and shows the Drupal URL (http://localhost:8085), or guides you to run /drupal-serve to start it.

Notes

  • Always uses /workspace/drupal as the project root — never /workspace directly.
  • If the stack is not running during DB import, the import is skipped with a warning. Run /drupal-serve first, then /drupal-db-import manually.

Related skills

Clone this wiki locally