PHPackages                             phpcp/phpcp - 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. phpcp/phpcp

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

phpcp/phpcp
===========

PHP CPanel is a PHP application to interact with CPanel Git repositories

0.1.1(2y ago)059MITPHPPHP ^7.4 || ^8

Since May 3Pushed 2y ago1 watchersCompare

[ Source](https://github.com/joaocsilva/phpcp)[ Packagist](https://packagist.org/packages/phpcp/phpcp)[ RSS](/packages/phpcp-phpcp/feed)WikiDiscussions main Synced 1mo ago

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

About PHP CPanel
================

[](#about-php-cpanel)

PHPCP is a PHP [Symfony application](https://symfony.com/doc/5.4/components/console.html)to list and interact with CPanel Git repositories through the [API](https://api.docs.cpanel.net/cpanel/introduction).

Allows you to list available repositories in the CPanel account A website hosted in a CPanel server using the Git Version Control, this allows you to perform the manual operations for 'Pull or Deploy' in the CPanel Git repositories interface.

Features
--------

[](#features)

- [List existing repositories information](#command-repolist)
- [Pull a git repository](#command-repopull)
- [Push a git repository](#command-repodeploy)
- [View or Download a file](#command-filedownload)

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

[](#installation)

```
$ composer require phpcp/phpcp
```

When the package is installed, the bin `phpcp` is added to the composer's `vendor/bin` directory, you can run the application with `php vendor/bin/phpcp`.

```
$ php vendor/bin/phpcp
PHP CPanel cli 0.0.1

Usage:
  command [options] [arguments]

Options:
  ...
  -h, --help            Display help for the given command. When no command is given display help for the list command
  -n, --no-interaction  Do not ask any interactive question

Available commands:
  ...
  config         Print configurations
 file
  file:download  [fetch] Download a CPanel file
 repo
  repo:deploy    [deploy] Deploy a CPanel repository
  repo:list      [repos] List CPanel repositories
  repo:pull      [pull] Pull a CPanel repository
```

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

[](#configuration)

The configurations are loaded using Yaml files and default values are gathered from environment variables.

You can see the current configuration by running the command `config`.

```
$ php vendor/bin/phpcp config
phpcp:
  github:
    token: '${env.PHPCP_GITHUB_TOKEN}'
    user: '${env.PHPCP_GITHUB_USER}'
    repo: '${env.PHPCP_GITHUB_REPO}'
  cpanel:
    token: '${env.PHPCP_CPANEL_TOKEN}'
    url: '${env.PHPCP_CPANEL_URL}'
```

### Using Environment variables

[](#using-environment-variables)

The provided configurations are looking for environment variables. See below the used variables.

- **PHPCP\_CPANEL\_TOKEN** - The CPanel username:password in base64 format
- **PHPCP\_CPANEL\_URL** - The CPanel base url (i.e: )
- **PHPCP\_GITHUB\_TOKEN** - The GitHub API token (required when using option `--git` in command `repo:list`)
- **PHPCP\_GITHUB\_USER** - The GitHub username (i.e: joaocsilva) (required when using option `--git` in command `repo:list`)
- **PHPCP\_GITHUB\_REPO** - The GitHub repository (i.e: phpcp) (required when using option `--git` in command `repo:list`)

### Using configuration file

[](#using-configuration-file)

PHPCP will search and load the following configuration files `phpcp.yml.dist`and `phpcp.yml`.

An example of configuration file to interact with CPanel only using static values.

```
phpcp:
  cpanel:
    token: 'aBCF'
    url: 'https://cpanelXXX.dnscpanel.com:XXXX/cpsessXXXXXXXXXX'
```

### Using command options as configuration

[](#using-command-options-as-configuration)

When using a command option, the value defined in the configuration file is overridden.

**CPanel related options**

Used in commands: [repos](#command-repolist), [pull](#command-repopull), [deploy](#command-repodeploy)

- `--cp-token` - The CPanel auth token
- `--cp-base-url` - The CPanel base url

**GitHub related options**

Use when option `--git` is used in commands: [repos](#command-repolist)

- `--github-token` - The GitHub API access token
- `--github-user` - The GitHub username
- `--github-repo` - The GitHub repository

Commands list
-------------

[](#commands-list)

### Command `config`

[](#command-config)

View all loaded configurations.

```
$ php vendor/bin/phpcp config
```

View a specific configuration.

```
$ php vendor/bin/phpcp config phpcp.cpanel.url
```

### Command `help`

[](#command-help)

View command information, options, arguments and usages.

```
$ php vendor/bin/phpcp help repo:list
```

```
Description:
  List CPanel repositories

Usage:
  repo:list [options]
  repos
  repo:list --git
  repo:list --cp-token="aBcdef" --cp-base-url="https://cpanelXXX.dnscpanel.com:XXXX/cpsessXXXXXXXXXX"

Options:
  --git                        Check for branch HEAD commit hash in GitHub.
  --github-token=GITHUB-TOKEN  The GitHub API access token
  --github-user=GITHUB-USER    The GitHub username, i.e: joaocsilva
  --github-repo=GITHUB-REPO    The GitHub repository, i.e: phpcp
  --cp-token=CP-TOKEN          The CPanel auth token, usually a base64 encode
  --cp-base-url=CP-BASE-URL    The CPanel base url, i.e: https://cpanelXXX.dnscpanel.com:XXXX/cpsessXXXXXXXXXX

```

View a specific configuration.

```
$ php vendor/bin/phpcp config phpcp.cpanel.url
```

### Command `repo:list`

[](#command-repolist)

List the available repositories that the current user has access to. It is the same list present in the CPanel interface for `Git™ Version Control`tool.

```
$ php vendor/bin/phpcp repo:list
```

### Command `repo:pull`

[](#command-repopull)

Perform the action to pull a repository in the CPanel interface `Git™ Version Control`&gt;`Pull or Deploy`, button `Update from Remote`. This will pull the changes from the remote.

The command has a required parameter for the branch name to identify the repo.

```
$ php vendor/bin/phpcp repo:pull master
```

### Command `repo:deploy`

[](#command-repodeploy)

Perform the action to deploy a repository in the CPanel interface `Git™ Version Control`&gt;`Pull or Deploy`, button `Deploy HEAD Commit`. This will trigger the CPanel deployment and execute the `.cpanel` file.

The command has a required argument for the branch name to identify the repo.

```
$ php vendor/bin/phpcp repo:deploy master
```

### Command `file:download`

[](#command-filedownload)

Output a file content or to a file with option `--output`.

The command has a required arguments dir and file to specify the directory where the file is and the filename.

Print the composer.json content.

```
$ php vendor/bin/phpcp file:download /home/user composer.json
```

Download the composer.json file to a file named remote-composer.json.

```
$ php vendor/bin/phpcp file:download /home/user composer.json --output=remote-composer.json
```

Local development
-----------------

[](#local-development)

You can use docker to run the project locally.

The docker-compose.yml file contains the environment variables needs for the commands.

```
PHPCP_GITHUB_TOKEN:
PHPCP_CPANEL_TOKEN:
PHPCP_CPANEL_URL:
```

You can map these variables to your own env variables with.

```
PHPCP_GITHUB_TOKEN: ${GITHUB_TOKEN}
PHPCP_CPANEL_TOKEN: ${CPANEL_TOKEN}
PHPCP_CPANEL_URL: ${CPANEL_URL}
```

Usage.

```
# Start containers.
$ docker compose up -d
# Install composer dependencies..
$ docker compose exec web composer install
# Check if the phpcp is running.
$ docker compose exec web php phpcp
# List CPanel repositories.
$ docker compose exec web php phpcp repo:list
```

###  Health Score

19

—

LowBetter than 10% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity35

Early-stage or recently created project

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

Total

2

Last Release

931d ago

### Community

Maintainers

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

---

Top Contributors

[![joaocsilva](https://avatars.githubusercontent.com/u/1574795?v=4)](https://github.com/joaocsilva "joaocsilva (2 commits)")

---

Tags

cpanel-api

### Embed Badge

![Health badge](/badges/phpcp-phpcp/health.svg)

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

###  Alternatives

[shopware/platform

The Shopware e-commerce core

3.3k1.5M3](/packages/shopware-platform)[sylius/sylius

E-Commerce platform for PHP, based on Symfony framework.

8.4k5.6M651](/packages/sylius-sylius)[sulu/sulu

Core framework that implements the functionality of the Sulu content management system

1.3k1.3M152](/packages/sulu-sulu)[prestashop/prestashop

PrestaShop is an Open Source e-commerce platform, committed to providing the best shopping cart experience for both merchants and customers.

9.0k15.4k](/packages/prestashop-prestashop)[shyim/danger-php

Port of danger to PHP

8544.9k](/packages/shyim-danger-php)[contao/core-bundle

Contao Open Source CMS

1231.6M2.4k](/packages/contao-core-bundle)

PHPackages © 2026

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