PHPackages                             piotrpress/private-composer - 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. piotrpress/private-composer

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

piotrpress/private-composer
===========================

This composer plugin adds github and bitbucket protocols support to Composer in order to simplify private repositories handling.

v2.0.1(2y ago)06501MITPHPPHP &gt;=7.4

Since Aug 26Pushed 2y ago1 watchersCompare

[ Source](https://github.com/PiotrPress/private-composer)[ Packagist](https://packagist.org/packages/piotrpress/private-composer)[ Docs](https://github.com/PiotrPress/private-composer)[ RSS](/packages/piotrpress-private-composer/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (3)Versions (7)Used By (0)

Private Composer
================

[](#private-composer)

This composer plugin adds `github` and `bitbucket` protocols support to Composer in order to simplify [private repositories](https://getcomposer.org/doc/05-repositories.md#using-private-repositories) handling.

Private Composer uses **GitHub** and **BitBucket** APIs to build `packages.json` virtual file on the fly, with all packages from owner's repositories, which can be used in repository type `composer` in `composer.json` file.

Example
-------

[](#example)

Instead of manually adding each one repository separately to `composer.json` file, e.g.:

```
{
  "repositories": [
    {
      "type": "vcs",
      "url":  "https://github.com/PiotrPress/private-repo-1.git"
    },
    {
      "type": "vcs",
      "url":  "https://github.com/PiotrPress/private-repo-2.git"
    }
  ],
  "require": {
    "piotrpress/private-repo-1": "dev-master",
    "piotrpress/private-repo-2": "*"
  }
}
```

use (in this example) `github` protocol:

```
{
  "repositories": [
    {
      "type": "composer",
      "url":  "github://PiotrPress"
    }
  ],
  "require": {
    "piotrpress/private-repo-1": "dev-master",
    "piotrpress/private-repo-2": "*"
  }
}
```

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

[](#installation)

1. Add the plugin as a global composer requirement:

```
$ composer global require piotrpress/private-composer
```

2. Allow the plugin execution:

```
$ composer config -g allow-plugins.piotrpress/private-composer true
```

Authentication
--------------

[](#authentication)

Add GitHub/BitBucket API [authentication](https://getcomposer.org/doc/articles/authentication-for-private-packages.md#http-basic) credentials:

```
$ composer config [--global] http-basic.
```

**NOTE:** using `--global` option is recommended to keep credentials outside of project's files.

### GitHub

[](#github)

1. `github.com` example:

```
$ composer config --global http-basic.github.com x-oauth-basic token
```

2. Custom domain example:

```
$ composer config --global http-basic.example.com x-oauth-basic token
```

- `host` - GitHub's domain, if empty it's equivalent: `github.com`
- `username` - always `x-oauth-basic`
- `password` - GitHub's `token` (generate new one using this [link](https://github.com/settings/tokens/new?scopes=repo&description=Private-Composer))

### BitBucket

[](#bitbucket)

1. `bitbucket.org` example:

```
$ composer config --global http-basic.bitbucket.org username app_password
```

2. Custom domain example:

```
$ composer config --global http-basic.example.com username app_password
```

- `host` - BitBucket's domain, if empty it's equivalent: `bitbucket.org`
- `username` - BitBucket's `username`
- `password` - BitBucket's `app_password` (generate new one using this [link](https://bitbucket.org/account/settings/app-passwords/))

Usage in `composer.json` file
-----------------------------

[](#usage-in-composerjson-file)

```
{
  "repositories": [
    {
      "type": "composer",
      "url":  "://[@]"
    }
  ]
}
```

### GitHub

[](#github-1)

1. `github.com` example:

```
{
  "repositories": [
    {
      "type": "composer",
      "url":  "github://PiotrPress"
    }
  ]
}
```

2. Custom domain example:

```
{
  "repositories": [
    {
      "type": "composer",
      "url":  "github://PiotrPress@example.com"
    }
  ]
}
```

- `owner` - GitHub's repository `owner`
- `host` - API endpoint domain, if empty it's equivalent: `github.com`

### BitBucket

[](#bitbucket-1)

1. `bitbucket.org` example:

```
{
  "repositories": [
    {
      "type": "composer",
      "url":  "bitbucket://PiotrPress"
    }
  ]
}
```

2. Custom domain example:

```
{
  "repositories": [
    {
      "type": "composer",
      "url":  "bitbucket://PiotrPress@example.com"
    }
  ]
}
```

- `owner` - BitBucket's `workspace`
- `host` - API endpoint domain, if empty it's equivalent: `bitbucket.org`

Usage as a `command`
--------------------

[](#usage-as-a-command)

```
$ composer packages ://[@]
```

Command's output is a valid `packages.json` file content.

### Example

[](#example-1)

```
$ composer packages github://PiotrPress > packages.json
```

Note
----

[](#note)

If there are many repositories to scan, it may be necessary to increase the process [timeout](https://getcomposer.org/doc/articles/scripts.md#managing-the-process-timeout).

Requirements
------------

[](#requirements)

- PHP &gt;= `7.4` version.
- Composer ^`2.0` version.

License
-------

[](#license)

[MIT](license.txt)

###  Health Score

26

—

LowBetter than 41% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity52

Maturing project, gaining track record

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

Recently: every ~134 days

Total

6

Last Release

863d ago

Major Versions

v1.2.0 → v2.0.02024-02-20

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/10326736?v=4)[Piotr Niewiadomski](/maintainers/PiotrPress)[@PiotrPress](https://github.com/PiotrPress)

---

Top Contributors

[![PiotrPress](https://avatars.githubusercontent.com/u/10326736?v=4)](https://github.com/PiotrPress "PiotrPress (6 commits)")

---

Tags

bitbucketcomposercomposer-plugingithubphpprivateprivate-packageprivate-packagistprivate-repositoriesprivate-repositorystreamstreamsstreamphpcomposerbitbucketgithubStreamscomposer-pluginprivateprivate-repositorypackagistprivate packagistprotocols

### Embed Badge

![Health badge](/badges/piotrpress-private-composer/health.svg)

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

###  Alternatives

[mnsami/composer-custom-directory-installer

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

1465.4M61](/packages/mnsami-composer-custom-directory-installer)[liborm85/composer-vendor-cleaner

Composer Vendor Cleaner removes unnecessary development files and directories from vendor directory.

34412.1k1](/packages/liborm85-composer-vendor-cleaner)

PHPackages © 2026

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