PHPackages                             hussainweb/drupal-composer-init - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. hussainweb/drupal-composer-init

AbandonedArchivedComposer-plugin[Utility &amp; Helpers](/categories/utility)

hussainweb/drupal-composer-init
===============================

Initialise a Drupal composer project setup

v1.0.2(8y ago)424.1k5[2 issues](https://github.com/hussainweb/drupal-composer-init/issues)[1 PRs](https://github.com/hussainweb/drupal-composer-init/pulls)MITPHPPHP &gt;=5.5.9

Since Oct 14Pushed 8y ago1 watchersCompare

[ Source](https://github.com/hussainweb/drupal-composer-init)[ Packagist](https://packagist.org/packages/hussainweb/drupal-composer-init)[ RSS](/packages/hussainweb-drupal-composer-init/feed)WikiDiscussions master Synced 2d ago

READMEChangelog (4)Dependencies (3)Versions (5)Used By (0)

drupal-composer-init
====================

[](#drupal-composer-init)

[![Latest Version](https://camo.githubusercontent.com/e709e9e5d2c998b44603de1ce221a9f954fd797a0900cafcde9ee84a62d21ee1/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652f6875737361696e7765622f64727570616c2d636f6d706f7365722d696e69742e7376673f7374796c653d666c61742d737175617265)](https://github.com/hussainweb/drupal-composer-init/releases)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)[![Build Status](https://camo.githubusercontent.com/abefb8c26203df18a9023a9be3915781a50ee1acb13b9e2b7900a6c11703e86b/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f6875737361696e7765622f64727570616c2d636f6d706f7365722d696e69742f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/hussainweb/drupal-composer-init)[![Total Downloads](https://camo.githubusercontent.com/0ce04b8262105c53ab2c3865b19b1e5cf3d89085a22acbcdf89bab38ed05d364/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6875737361696e7765622f64727570616c2d636f6d706f7365722d696e69742e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/hussainweb/drupal-composer-init)

This plugin provides a new composer command (`drupal-init`) which helps in creating new Drupal installations based on composer. Most of the options are very similar to the default `composer init` command. There are additional options to specify a Drupal core or distro to use and the docroot.

This plugin also supports Drupal 7 installation but this option needs to be passed in from command line.

The composer.json setup that this plugin generates is inspired by [drupal-composer/drupal-project](https://github.com/drupal-composer/drupal-project) (both D7 and D8 versions). One important difference is that the composer.json generated by this command does not need several scripts which are part of the drupal-composer project. All the functionality is moved to [hussainweb/drupal-composer-helper](https://github.com/hussainweb/drupal-composer-helper). There are additional benefits like a simpler `extra` section and a more maintainable installation. For more details, see the [drupal-composer-helper](https://github.com/hussainweb/drupal-composer-helper) plugin.

Installation
------------

[](#installation)

Since this plugin provides a new composer command that should be used in an empty directory (or at least a directory without a composer.json setup), this has to be installed globally.

```
composer global require hussainweb/drupal-composer-init:~1.0

```

Updating
--------

[](#updating)

```
composer global update hussainweb/drupal-composer-init --with-dependencies

```

Usage
-----

[](#usage)

In a fresh directory, run this command to get started.

```
composer drupal-init

```

To intialise a Drupal 7 website, run the following command:

```
composer drupal-init --drupal-7

```

### Specifying extensions (modules, themes, profiles)

[](#specifying-extensions-modules-themes-profiles)

Drupal extensions such as modules, themes, and profiles can be specified in the regular `require` or `require-dev` section of composer.json schema.

All Drupal extensions can be specified in the regular packages section with their drupal.org name prefixed by '`drupal/`'. For example, if you want to require panels module, specify `drupal/panels`.

```
Define your dependencies.

Would you like to define your dependencies (require) now [yes]?
Search for a package: drupal/panels
Enter the version constraint to require (or leave blank to use the latest version):
Using version ^4.2 for drupal/panels
Search for a package: drupal/redirect
Enter the version constraint to require (or leave blank to use the latest version):
Using version ^1.0@beta for drupal/redirect
Search for a package:

```

### Additional Help

[](#additional-help)

Run `composer help drupal-init` for more options.

```
Usage:
  drupal-init [options]

Options:
      --name=NAME                Name of the package
      --description=DESCRIPTION  Description of package
      --author=AUTHOR            Author name of package
      --type[=TYPE]              Type of package (e.g. library, project, metapackage, composer-plugin) [default: "project"]
      --homepage=HOMEPAGE        Homepage of package
      --require=REQUIRE          Package to require with a version constraint, e.g. foo/bar:1.0.0 or foo/bar=1.0.0 or "foo/bar 1.0.0" (multiple values allowed)
      --require-dev=REQUIRE-DEV  Package to require for development with a version constraint, e.g. foo/bar:1.0.0 or foo/bar=1.0.0 or "foo/bar 1.0.0" (multiple values allowed)
  -c, --core=CORE                Drupal Core or distribution, e.g. drupal/core or acquia/lightning [default: "drupal/core"]
  -s, --stability=STABILITY      Minimum stability (empty or one of: stable, RC, beta, alpha, dev)
  -l, --license=LICENSE          License of package
      --repository=REPOSITORY    Add custom repositories, either by URL or using JSON arrays (multiple values allowed)
  -w, --web-dir=WEB-DIR          Specify the docroot (defaults to web) [default: "web"]
      --drupal-7                 Use Drupal 7 packagist instead of Drupal 8
  -h, --help                     Display this help message
  -q, --quiet                    Do not output any message
  -V, --version                  Display this application version
      --ansi                     Force ANSI output
      --no-ansi                  Disable ANSI output
  -n, --no-interaction           Do not ask any interactive question
      --profile                  Display timing and memory usage information
      --no-plugins               Whether to disable plugins.
  -d, --working-dir=WORKING-DIR  If specified, use the given directory as working directory.
  -v|vv|vvv, --verbose           Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug

Help:
  The drupal-init command creates a composer.json file
  usable for Drupal projects in the current directory.

  php composer.phar drupal-init

```

Contributing
------------

[](#contributing)

Contributions are welcome. Please use the issue queue to describe the problem. Pull requests are welcome.

###  Health Score

33

—

LowBetter than 75% of packages

Maintenance19

Infrequent updates — may be unmaintained

Popularity29

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity61

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~4 days

Total

4

Last Release

3121d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/085aa457eb46e449e7045c81d904cb31e53009485f8926af78651ca6e0676fcb?d=identicon)[hussainweb](/maintainers/hussainweb)

---

Top Contributors

[![hussainweb](https://avatars.githubusercontent.com/u/1040271?v=4)](https://github.com/hussainweb "hussainweb (16 commits)")

---

Tags

composercomposer-plugindrupaldrupal-7drupal-8drupal-setupsdrupal

###  Code Quality

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/hussainweb-drupal-composer-init/health.svg)

```
[![Health](https://phpackages.com/badges/hussainweb-drupal-composer-init/health.svg)](https://phpackages.com/packages/hussainweb-drupal-composer-init)
```

###  Alternatives

[drupal/core-composer-scaffold

A flexible Composer project scaffold builder.

5341.9M446](/packages/drupal-core-composer-scaffold)[drupal/core-project-message

Adds a message after Composer installation.

2122.6M172](/packages/drupal-core-project-message)[lullabot/amp

A set of useful classes and utilities to convert html to AMP html (See https://www.ampproject.org/)

3802.9M10](/packages/lullabot-amp)[aleksip/plugin-data-transform

Data Transform Plugin for Pattern Lab PHP

34897.4k3](/packages/aleksip-plugin-data-transform)[acquia/drupal-recommended-settings

The composer plugin for adding drupal-recommended-settings for Acquia Cloud.

101.1M4](/packages/acquia-drupal-recommended-settings)[tripal/tripal

Tripal is a toolkit to facilitate construction of online genomic, genetic (and other biological) websites.

709.9k9](/packages/tripal-tripal)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
