PHPackages                             adlacruzes/composer-import-scripts - 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. adlacruzes/composer-import-scripts

ActiveComposer-plugin

adlacruzes/composer-import-scripts
==================================

Composer plugin to import composer scripts from sources

1.5.1(2y ago)024.5kMITPHPPHP ^7.2 || ^8.0

Since Apr 5Pushed 2y ago1 watchersCompare

[ Source](https://github.com/adlacruzes/composer-import-scripts)[ Packagist](https://packagist.org/packages/adlacruzes/composer-import-scripts)[ RSS](/packages/adlacruzes-composer-import-scripts/feed)WikiDiscussions main Synced today

READMEChangelog (7)Dependencies (8)Versions (8)Used By (0)

Composer import scripts
=======================

[](#composer-import-scripts)

[![Minimum PHP Version](https://camo.githubusercontent.com/4f9eddea3b5f90bdf4c2f6feafb71962a03512fd923888e4aef358cf6334daf7/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d253345253344253230372e322d3838393242462e7376673f7374796c653d666c61742d737175617265)](https://php.net/)[![Packagist](https://camo.githubusercontent.com/e9c2ee08831cf15f15dfa09ebdeb35d08957c08a2564ba46538074e553546a9e/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f61646c616372757a65732f636f6d706f7365722d696d706f72742d736372697074733f7374796c653d666c61742d737175617265)](https://packagist.org/packages/adlacruzes/composer-import-scripts)[![Github actions](https://github.com/adlacruzes/composer-import-scripts/workflows/Continuous%20Integration/badge.svg?branch=main)](https://github.com/adlacruzes/composer-import-scripts/workflows/Continuous%20Integration/badge.svg?branch=main)

Composer import scripts is a plugin to import composer scripts from files/URLs at runtime.

I needed a simple way to import scripts and unify commands across multiple libraries. If you need a more powerful tool, you can look at the excellent [composer-merge-plugin](https://github.com/wikimedia/composer-merge-plugin).

Imported commands have to be invoked with `composer run`.

### Can this plugin import scripts from...

[](#can-this-plugin-import-scripts-from)

- **other composer.json files?** Yes
- **public URLs?** Yes

Table of Contents
-----------------

[](#table-of-contents)

- [Installation](#installation)
- [Configuration](#configuration)
    - [include](#include)
    - [allow\_failures](#allow_failures)
    - [override](#override)
- [JSON schema](#json-schema)

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

[](#installation)

```
composer require adlacruzes/composer-import-scripts
```

As of Composer 2.2.0, the `allow-plugins` option adds a layer of security allowing you to restrict which Composer plugins are able to execute code during a Composer run.

Use this setting to allow only packages you trust to execute code.

```
{
    "config": {
        "allow-plugins": {
            "adlacruzes/composer-import-scripts": true
        }
    }
}
```

Usage
-----

[](#usage)

```
{
    "extra": {
        "import-scripts": {
            "include": [
                "file1.json",
                "file2.json",
                "https://url.json"
            ],
            "allow_failures": false,
            "override": true
        }
    }
}
```

Configuration
-------------

[](#configuration)

### include

[](#include)

- `required`

`include` setting is a list of files to import. These files need to be valid JSON according to the [import scripts schema](#json-schema).

### allow\_failures

[](#allow_failures)

- `optional`
- `default: false`

`allow_failures` is a setting that controls errors from the plugin. If set to `true` the following file errors will be ignored and zero scripts will be imported from these files:

- Invalid JSON schema
- Invalid file

### override

[](#override)

- `optional`
- `default: true`

When `override` is set to `true` the scripts from the `include` setting will override the scripts with the same name defined in `composer.json`

JSON schema
-----------

[](#json-schema)

This is the scheme files must adapt.

```
{
    "$schema": "http://json-schema.org/draft-04/schema#",
    "type": "object",
    "properties": {
        "scripts": {
            "type": [
                "object"
            ],
            "additionalProperties": {
                "type": ["string", "array"]
            }
        }
    },
    "required": [
        "scripts"
    ]
}
```

An example of this schema:

```
{
    "scripts": {
        "one": "echo one",
        "two": "echo two",
        "three": "echo three",
        "other": [
            "echo four",
            "echo five"
        ]
    }
}
```

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity20

Limited adoption so far

Community7

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

Recently: every ~214 days

Total

7

Last Release

874d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/ae206f49d348a5b75a51accb50e1d1ffb4524fdd6dbfcd4827ad8d5654b5087d?d=identicon)[adlacruzes](/maintainers/adlacruzes)

---

Top Contributors

[![adlacruzes](https://avatars.githubusercontent.com/u/31167513?v=4)](https://github.com/adlacruzes "adlacruzes (87 commits)")

---

Tags

plugincomposerscripts

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/adlacruzes-composer-import-scripts/health.svg)

```
[![Health](https://phpackages.com/badges/adlacruzes-composer-import-scripts/health.svg)](https://phpackages.com/packages/adlacruzes-composer-import-scripts)
```

###  Alternatives

[ergebnis/composer-normalize

Provides a composer plugin for normalizing composer.json.

1.1k37.3M2.1k](/packages/ergebnis-composer-normalize)[pyrech/composer-changelogs

Display changelogs after each composer update

5904.0M25](/packages/pyrech-composer-changelogs)[villfa/composer-substitution-plugin

Composer plugin replacing placeholders in the scripts section by dynamic values

5148.7k1](/packages/villfa-composer-substitution-plugin)[neronmoon/scriptsdev

Scripts-dev behaviour for Composer

691.5M41](/packages/neronmoon-scriptsdev)[sllh/composer-lint

Extends the composer validate command with extra rules

14214.6k7](/packages/sllh-composer-lint)

PHPackages © 2026

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