PHPackages                             clippings/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. clippings/composer-init

AbandonedArchivedApplication[Utility &amp; Helpers](/categories/utility)

clippings/composer-init
=======================

Initialize a composer package based on a template package

0.4.0(10y ago)3131[1 issues](https://github.com/clippings/composer-init/issues)BSD-3-ClausePHP

Since Mar 25Pushed 10y agoCompare

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

READMEChangelog (10)Dependencies (2)Versions (13)Used By (0)

Composer Init
=============

[](#composer-init)

[![Build Status](https://camo.githubusercontent.com/75965f92a1d8f6a2ef84536c4a93361ad76e94751c6dc7448dbf4b5eb8ea7e95/68747470733a2f2f7472617669732d63692e6f72672f636c697070696e67732f636f6d706f7365722d696e69742e706e673f6272616e63683d6d6173746572)](https://travis-ci.org/clippings/composer-init)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/da634618b272da81e115052c1622d342dd89373c3356a0707e10e16c628047d8/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f636c697070696e67732f636f6d706f7365722d696e69742f6261646765732f7175616c6974792d73636f72652e706e673f733d61313430343637346636386334383934643635313135306361663439383561613539353937353135)](https://scrutinizer-ci.com/g/clippings/composer-init/)[![Code Coverage](https://camo.githubusercontent.com/57778c3881ab899ddd3560d4c5fd82da6b76a1b8a7cb80f239832148cbf0405b/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f636c697070696e67732f636f6d706f7365722d696e69742f6261646765732f636f7665726167652e706e673f733d33643566623535633432633638383736373939313533323036353862353433656439333565303061)](https://scrutinizer-ci.com/g/clippings/composer-init/)[![Latest Stable Version](https://camo.githubusercontent.com/372789631abe74a65f55a310c7f9d4f0f1572fd8abbd20d393495e7471a1a760/68747470733a2f2f706f7365722e707567782e6f72672f636c697070696e67732f636f6d706f7365722d696e69742f762f737461626c652e706e67)](https://packagist.org/packages/clippings/composer-init)

Tired of creating the same directory structure every time you start a new project? Tired of constantly modifying files if you clone github template repo? This command line tool allows you to initialize a project based on a template, and fills in values in the template.

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

[](#installation)

Install via composer

```
$ composer global require clippings/composer-init

```

This will install it to your user's global composer. If you already have ~/.composer/vendor/bin/ in your PATH you can start using it with

```
$ composer-init

```

otherwise you can do it by calling directly

```
$ ~/.composer/vendor/bin/composer-init

```

Basic Usage
-----------

[](#basic-usage)

- `composer-init search` to discover templates
- `composer-init use {template-package}` in an empty folder to use a template
- `composer-init token {token}` set a github token for downloading past the [github rate limit](https://developer.github.com/v3/rate_limit/)

`composer-init` Gets a lot of defaults from github repo &amp; organization, so it is best to create an empty repo in github, clone it locally and run "composer-init use ..." there.

Creating Templates
------------------

[](#creating-templates)

A composer-init template must be published to Packagist.org, (therefore have a composer.json file) and have a prompts.json file to describe which of the available prompts will be used. The package should be published as "type": "composer-init-template". All the code for the template is present in the "root" directory.

example composer.json file:

```
{
    "name": "clippings/package-template",
    "description": "Package Template",
    "license": "MIT",
    "type": "composer-init-template",
    "authors": [
        {
            "name": "John Smith",
            "email": "john@example.com",
            "role": "Author"
        }
    ]
}
```

example prompts.json file:

```
[
    "package_name",
    "title",
    "description",
    "php_namespace",
    "author_name",
    "author_email",
    "copyright",
    "bugs"
]
```

This states that this package will use these prompts, gather their input and then fill in the placeholders inside all the files in the root folder.

Here's an example template:

Prompts
-------

[](#prompts)

All prompts try to guess a reasonable default, but ask the user to confirm/correct its value.

#### author\_email

[](#author_email)

The email of the author, by default uses `git config user.email`. You can set it yourself with `git config user.email {my email}` or globally with `git config --global user.email {my email}`. As stated in [first time git setup](https://git-scm.com/book/en/v2/Getting-Started-First-Time-Git-Setup) guide

Adds `{% author_email %}` template variable

#### author\_name

[](#author_name)

The name of the author, by default uses `git config user.name`. You can set it yourself with `git config user.name {my name}` or globally with `git config --global user.name {my name}`. As stated in [first time git setup](https://git-scm.com/book/en/v2/Getting-Started-First-Time-Git-Setup) guide

Adds `{% author_name %}` template variable

#### bugs

[](#bugs)

The url for submitting new issues. By default gets the repo's gitub issues url. e.g. `https://github.com/clippings/composer-init/issues`

Adds `{% bugs %}` template variable

#### copyright

[](#copyright)

Tries to guess the copyright holder by going through

- github organization
- github user
- git user
- file owner

And exposes it as "{year}, {copyright\_entity}" - where year is the current year and copyright\_entity is the guessed value. You can also get to the `copyright_entity` value separately

Adds `{% copyright %}` template variable
Adds `{% copyright_entity %}` template variable

#### description

[](#description)

The description of the github repo.

Adds `{% description %}` template variable

#### package\_name

[](#package_name)

The github package name e.g. `clippings/composer-init`

Adds `{% package_name %}` template variable

#### php\_namespace

[](#php_namespace)

Tires to guess the package name, using github's organization/username and repo name. So `clippings/composer-init` would be converted to `Clippings\ComposerInit`. It also tries to guess the name with initials, so in this case it would also give the option of `CL\ComposerInit`. These can be cycled with tab completion or auto-completed when entering

Adds `{% php_namespace %}`
Adds `{% php_namespace_escaped %}` template variable where all "\\" characters are converted to "\\\\"

#### slack\_notification

[](#slack_notification)

Get a "secure slack notification token". basically asks for a value and returns "slack:\\n secure: {value}\\n", so you can easily add slack to your .travis.yml notifications

#### title

[](#title)

The title of the github repo.

Adds `{% title %}` template variable

Credits
-------

[](#credits)

Inspired by [grunt-init](https://github.com/gruntjs/grunt-init)

Copyright (c) 2014-2015, Clippings Ltd. Developed by [Ivan Kerin](https://github.com/ivank) as part of [clippings.com](http://clippings.com)

Under BSD-3-Clause license, read LICENSE file.

###  Health Score

27

—

LowBetter than 47% of packages

Maintenance13

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity60

Established project with proven stability

 Bus Factor1

Top contributor holds 94.2% 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 ~55 days

Total

12

Last Release

3868d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/506129?v=4)[Harry Dobrev](/maintainers/hkdobrev)[@hkdobrev](https://github.com/hkdobrev)

![](https://avatars.githubusercontent.com/u/4113307?v=4)[Danail Kyosev](/maintainers/dkyosev)[@dkyosev](https://github.com/dkyosev)

![](https://avatars.githubusercontent.com/u/7592650?v=4)[Evstati Zarkov](/maintainers/EZarkov)[@EZarkov](https://github.com/EZarkov)

![](https://avatars.githubusercontent.com/u/745771?v=4)[Filip Georgiev](/maintainers/phgeorgiev)[@phgeorgiev](https://github.com/phgeorgiev)

![](https://avatars.githubusercontent.com/u/490439?v=4)[Zdravko Evstatiev](/maintainers/zedevs)[@zedevs](https://github.com/zedevs)

---

Top Contributors

[![ivank](https://avatars.githubusercontent.com/u/4976?v=4)](https://github.com/ivank "ivank (49 commits)")[![hkdobrev](https://avatars.githubusercontent.com/u/506129?v=4)](https://github.com/hkdobrev "hkdobrev (3 commits)")

### Embed Badge

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

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

###  Alternatives

[laravel/framework

The Laravel Framework.

34.8k543.8M19.5k](/packages/laravel-framework)[spatie/laravel-export

Create a static site bundle from a Laravel app

673139.5k6](/packages/spatie-laravel-export)[shlinkio/shlink

A self-hosted and PHP-based URL shortener application with CLI and REST interfaces

5.1k4.9k](/packages/shlinkio-shlink)[friendsoftypo3/content-blocks

TYPO3 CMS Content Blocks - Content Types API | Define reusable components via YAML

103519.9k45](/packages/friendsoftypo3-content-blocks)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

245.2k](/packages/aedart-athenaeum)[eliashaeussler/typo3-solver

Solver - Extends TYPO3's exception handling with AI generated solutions. Problems can also be solved from command line. Several OpenAI parameters are configurable and prompts and solution providers can be customized as desired.

302.1k](/packages/eliashaeussler-typo3-solver)

PHPackages © 2026

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