PHPackages                             nfreear/composer-suggest - 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. nfreear/composer-suggest

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

nfreear/composer-suggest
========================

Composer plugin to install a custom group of suggested packages, based on keyword patterns. ' vi .env &amp;&amp; composer install '

v1.2.0(9y ago)43291[8 issues](https://github.com/nfreear/composer-suggest/issues)1MITPHPPHP &gt;=5.3.3

Since May 7Pushed 7y ago1 watchersCompare

[ Source](https://github.com/nfreear/composer-suggest)[ Packagist](https://packagist.org/packages/nfreear/composer-suggest)[ RSS](/packages/nfreear-composer-suggest/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (4)Dependencies (5)Versions (6)Used By (1)

[![Build status — Travis-CI](https://camo.githubusercontent.com/ac848730445d0bef2957eb0ba47f3283dae290be48ae2d6f67623bd161aff03a/68747470733a2f2f6170692e7472617669732d63692e6f72672f6e6672656561722f636f6d706f7365722d737567676573742e737667 "Build status – Travis-CI")](https://travis-ci.org/nfreear/composer-suggest)[![Latest Stable Version](https://camo.githubusercontent.com/d651c280d93e65e37bf3f4f6474d6edecda9afa6d120be30380d5d7bb51244e8/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6e6672656561722f636f6d706f7365722d737567676573742e7376673f7374796c653d666c6174)](https://packagist.org/packages/nfreear/composer-suggest) [![MIT License](https://camo.githubusercontent.com/a85a4f544023892f546a1ddb6daca4363a98d25489858c2905c0710bd48650be/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f6e6672656561722f636f6d706f7365722d737567676573742e7376673f7374796c653d666c6174)](http://nfreear.mit-license.org/ "MIT License")

composer-suggest
================

[](#composer-suggest)

A [Composer plugin](https://getcomposer.org/doc/articles/plugins.md) to install a custom group of [suggested](https://getcomposer.org/doc/04-schema.md#suggest) packages, based on keyword patterns. (*[Caution](#caution)*)

Example `composer.json`:

```
{
    "suggest": {
      "a/b": "1.0; This package is for [LACE] only",
      "c/d": "2.1, This package is for JuxtaLearn and LACE.",
      "e/f": "3.2, This is just for [JXL].",
      "g/h": "1.0-beta; Experiment-A"
    }
}
```

Usage
-----

[](#usage)

1. Set an environment variable containing a pattern/keywords in a `.env` file,

    ```
    echo 'NF_COMPOSER_SUGGEST="(EXP|LACE)"' > .env
    ```
2. Require the plugin,

    ```
    composer require nfreear/composer-suggest

    ```
3. Install as you would normally (verbose),

    ```
    composer -vvv install

    ```

Legacy
------

[](#legacy)

In [Composer script](https://getcomposer.org/doc/articles/scripts.md) mode, an example `composer.json` might contain:

```
{
    "suggest": {
      "a/b": "1.0; This package is for [LACE] only",
      "c/d": "2.1, This package is for JuxtaLearn and LACE.",
      "e/f": "3.2, This is just for [JXL].",
      "g/h": "1.0-beta; Experiment-A"
    },

    "scripts": {
      "dry-run-suggest": "\\Nfreear\\Composer\\Suggest::dryRun",
      "install-suggest": "\\Nfreear\\Composer\\Suggest::install",
      "install-lace": "./vendor/bin/suggest --dry LACE"
    }
}
```

Legacy usage:

```
>  composer -v install-lace
```

Legacy advanced usage:

```
>  composer -v dry-run-suggest "Ju?X(ta)?L"    # Packages suggested for 'Juxtalearn' & 'JXL'.
>  composer -v dry-run-suggest "Experiment-A"
```

Test
----

[](#test)

```
composer test
```

Caution
-------

[](#caution)

Use of the `composer-suggest` plugin implies that you probably won't commit `composer.lock` to version control. [Various](https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file "Composer documentation") people [say](https://blog.engineyard.com/2014/composer-its-all-about-the-lock-file "Engineyard blog") this is [bad](http://stackoverflow.com/questions/12896780/should-composer-lock-be-committed-to-version-c.. "Stackoverflow"), and as a general rule they are probably correct.

[Composer-suggest](https://github.com/nfreear/composer-suggest) works well when all/most of the dependencies in `require` and `suggest`have precise version constraints (`1.2.3`) as opposed to loose ones (`1.*`, `>= 1.5`..). It is also useful during rapid development phases of a project. See it in use in the [LACE/ OER Research Hub code](https://github.com/IET-OU/oer-evidence-hub-org/blob/9801a671d9b3/composer-TEMPLATE.json#L43-L68 "suggest: {..} in composer.json — LACE/ OER Hub code"), and [Open Media Player code](https://github.com/IET-OU/open-media-player/blob/2.x/composer.json#L33-L37 "suggest: {..} in composer.json — Open Media Player")-base.

[*Caveat utilitor!*](http://en.wiktionary.org/wiki/caveat_emptor "'User beware'")

Developed for the [LACE Evidence Hub](http://evidence.laceproject.eu/), part of the [Learning Analytics Community Exchange](http://www.laceproject.eu "LACE project") project.

Inspired by and based in part on the [composer-merge-plugin](https://github.com/wikimedia/composer-merge-plugin) – thank you!

---

License: [MIT](http://nfreear.mit-license.org/ "MIT License")

© 2016 The Open University. ([Institute of Educational Technology](http://iet.open.ac.uk/))

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance0

Infrequent updates — may be unmaintained

Popularity17

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity62

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 ~179 days

Total

5

Last Release

3312d ago

PHP version history (2 changes)1.0.0-betaPHP &gt;=5.3.2

v1.1.0-rc.2PHP &gt;=5.3.3

### Community

Maintainers

![](https://www.gravatar.com/avatar/669993be674731e4eace2bbe7e33d89693c9c654ff031179c410e21b2539a150?d=identicon)[nfreear](/maintainers/nfreear)

---

Top Contributors

[![nfreear](https://avatars.githubusercontent.com/u/131235?v=4)](https://github.com/nfreear "nfreear (32 commits)")

---

Tags

composer-pluginregexpatternsuggestcomposer-pluginLACEOpenUniversityIET-OU

###  Code Quality

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/nfreear-composer-suggest/health.svg)

```
[![Health](https://phpackages.com/badges/nfreear-composer-suggest/health.svg)](https://phpackages.com/packages/nfreear-composer-suggest)
```

###  Alternatives

[vaimo/composer-patches

Applies a patch from a local or remote file to any package that is part of a given composer project. Patches can be defined both on project and on package level. Optional support for patch versioning, sequencing, custom patch applier configuration and patch command for testing/troubleshooting added patches.

2994.3M16](/packages/vaimo-composer-patches)[mnsami/composer-custom-directory-installer

A composer plugin, to help install packages of different types in custom paths.

1395.0M52](/packages/mnsami-composer-custom-directory-installer)[lullabot/drainpipe

An automated build tool to allow projects to have a set standardized operations scripts.

41716.4k2](/packages/lullabot-drainpipe)[typisttech/imposter-plugin

Composer plugin that wraps all composer vendor packages inside your own namespace. Intended for WordPress plugins.

158251.0k2](/packages/typisttech-imposter-plugin)[drupal-composer/preserve-paths

Composer plugin for preserving custom paths and supporting nested packages

271.1M5](/packages/drupal-composer-preserve-paths)[arokettu/composer-license-manager

License management plugin for Composer

61207.9k](/packages/arokettu-composer-license-manager)

PHPackages © 2026

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