{"id":19677859,"url":"https://github.com/joaocsilva/phpcp","last_synced_at":"2026-04-15T18:01:25.045Z","repository":{"id":160716126,"uuid":"629716893","full_name":"joaocsilva/phpcp","owner":"joaocsilva","description":"PHP runner to interact with CPanel Git repositories","archived":false,"fork":false,"pushed_at":"2023-10-30T11:48:51.000Z","size":16,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-04T21:31:12.032Z","etag":null,"topics":["cpanel-api"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/joaocsilva.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2023-04-18T22:14:18.000Z","updated_at":"2023-05-02T23:37:48.000Z","dependencies_parsed_at":null,"dependency_job_id":"f5e38890-4309-45e7-b715-91ed23facff5","html_url":"https://github.com/joaocsilva/phpcp","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/joaocsilva/phpcp","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joaocsilva%2Fphpcp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joaocsilva%2Fphpcp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joaocsilva%2Fphpcp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joaocsilva%2Fphpcp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/joaocsilva","download_url":"https://codeload.github.com/joaocsilva/phpcp/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joaocsilva%2Fphpcp/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31853279,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-15T15:24:51.572Z","status":"ssl_error","status_checked_at":"2026-04-15T15:24:39.138Z","response_time":63,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cpanel-api"],"created_at":"2024-11-11T17:35:32.478Z","updated_at":"2026-04-15T18:01:24.962Z","avatar_url":"https://github.com/joaocsilva.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# About PHP CPanel\n\nPHPCP is a\nPHP [Symfony application](https://symfony.com/doc/5.4/components/console.html)\nto list and interact with CPanel Git repositories through the\n[API](https://api.docs.cpanel.net/cpanel/introduction).\n\nAllows you to list available repositories in the CPanel account\nA website hosted in a CPanel server using the Git Version Control,\nthis allows you to perform the manual operations for 'Pull or Deploy' in the\nCPanel Git repositories interface.\n\n## Features\n\n* [List existing repositories information](#command-repolist)\n* [Pull a git repository](#command-repopull)\n* [Push a git repository](#command-repodeploy)\n* [View or Download a file](#command-filedownload)\n\n## Installation\n\n```shell\n$ composer require phpcp/phpcp\n```\n\nWhen the package is installed, the bin `phpcp` is added to the composer's\n`vendor/bin` directory, you can run the application with `php vendor/bin/phpcp`.\n\n```shell\n$ php vendor/bin/phpcp\nPHP CPanel cli 0.0.1\n\nUsage:\n  command [options] [arguments]\n\nOptions:\n  ...\n  -h, --help            Display help for the given command. When no command is given display help for the list command\n  -n, --no-interaction  Do not ask any interactive question\n  \nAvailable commands:\n  ...\n  config         Print configurations\n file\n  file:download  [fetch] Download a CPanel file\n repo\n  repo:deploy    [deploy] Deploy a CPanel repository\n  repo:list      [repos] List CPanel repositories\n  repo:pull      [pull] Pull a CPanel repository\n```\n\n## Configuration\n\nThe configurations are loaded using Yaml files and default values are gathered\nfrom environment variables.\n\nYou can see the current configuration by running the command `config`.\n\n```shell\n$ php vendor/bin/phpcp config\nphpcp:\n  github:\n    token: '${env.PHPCP_GITHUB_TOKEN}'\n    user: '${env.PHPCP_GITHUB_USER}'\n    repo: '${env.PHPCP_GITHUB_REPO}'\n  cpanel:\n    token: '${env.PHPCP_CPANEL_TOKEN}'\n    url: '${env.PHPCP_CPANEL_URL}'\n```\n\n### Using Environment variables\n\nThe provided configurations are looking for environment variables. See below\nthe used variables.\n\n- **PHPCP_CPANEL_TOKEN** - The CPanel username:password in base64 format\n- **PHPCP_CPANEL_URL** - The CPanel base url\n  (i.e: https://cpanelXXX.dnscpanel.com:XXXX/cpsessXXXXXXXXXX)\n- **PHPCP_GITHUB_TOKEN** - The GitHub API token (required when using option\n  `--git` in command `repo:list`)\n- **PHPCP_GITHUB_USER** - The GitHub username (i.e: joaocsilva) (required when\n  using option `--git` in command `repo:list`)\n- **PHPCP_GITHUB_REPO** - The GitHub repository (i.e: phpcp) (required when\n  using option `--git` in command `repo:list`)\n\n### Using configuration file\n\nPHPCP will search and load the following configuration files `phpcp.yml.dist`\nand `phpcp.yml`.\n\nAn example of configuration file to interact with CPanel only using static\nvalues.\n\n```yaml\nphpcp:\n  cpanel:\n    token: 'aBCF'\n    url: 'https://cpanelXXX.dnscpanel.com:XXXX/cpsessXXXXXXXXXX'\n```\n\n### Using command options as configuration\n\nWhen using a command option, the value defined in the configuration file\nis overridden.\n\n**CPanel related options**\n\nUsed in commands: [repos](#command-repolist), [pull](#command-repopull),\n[deploy](#command-repodeploy)\n\n- `--cp-token` - The CPanel auth token\n- `--cp-base-url` - The CPanel base url\n\n**GitHub related options**\n\nUse when option `--git` is used in commands: [repos](#command-repolist)\n\n- `--github-token` - The GitHub API access token\n- `--github-user` - The GitHub username\n- `--github-repo` - The GitHub repository\n\n## Commands list\n\n### Command `config`\n\nView all loaded configurations.\n\n```shell\n$ php vendor/bin/phpcp config\n```\n\nView a specific configuration.\n\n```shell\n$ php vendor/bin/phpcp config phpcp.cpanel.url\n```\n\n### Command `help`\n\nView command information, options, arguments and usages.\n\n```shell\n$ php vendor/bin/phpcp help repo:list\n```\n\n```text\nDescription:\n  List CPanel repositories\n\nUsage:\n  repo:list [options]\n  repos\n  repo:list --git\n  repo:list --cp-token=\"aBcdef\" --cp-base-url=\"https://cpanelXXX.dnscpanel.com:XXXX/cpsessXXXXXXXXXX\"\n\nOptions:\n  --git                        Check for branch HEAD commit hash in GitHub.\n  --github-token=GITHUB-TOKEN  The GitHub API access token\n  --github-user=GITHUB-USER    The GitHub username, i.e: joaocsilva\n  --github-repo=GITHUB-REPO    The GitHub repository, i.e: phpcp\n  --cp-token=CP-TOKEN          The CPanel auth token, usually a base64 encode\n  --cp-base-url=CP-BASE-URL    The CPanel base url, i.e: https://cpanelXXX.dnscpanel.com:XXXX/cpsessXXXXXXXXXX\n```\n\nView a specific configuration.\n\n```shell\n$ php vendor/bin/phpcp config phpcp.cpanel.url\n```\n\n### Command `repo:list`\n\nList the available repositories that the current user has access to.\nIt is the same list present in the CPanel interface for `Git™ Version Control`\ntool.\n\n```shell\n$ php vendor/bin/phpcp repo:list\n```\n\n### Command `repo:pull`\n\nPerform the action to pull a repository in the CPanel interface\n`Git™ Version Control`\u003e`Pull or Deploy`, button `Update from Remote`.\nThis will pull the changes from the remote.\n\nThe command has a required parameter for the branch name to identify the repo.\n\n```shell\n$ php vendor/bin/phpcp repo:pull master\n```\n\n### Command `repo:deploy`\n\nPerform the action to deploy a repository in the CPanel interface\n`Git™ Version Control`\u003e`Pull or Deploy`, button `Deploy HEAD Commit`.\nThis will trigger the CPanel deployment and execute the `.cpanel` file.\n\nThe command has a required argument for the branch name to identify the repo.\n\n```shell\n$ php vendor/bin/phpcp repo:deploy master\n```\n\n### Command `file:download`\n\nOutput a file content or to a file with option `--output`.\n\nThe command has a required arguments dir and file to specify the directory where\nthe file is and the filename.\n\nPrint the composer.json content.\n\n```shell\n$ php vendor/bin/phpcp file:download /home/user composer.json\n```\n\nDownload the composer.json file to a file named remote-composer.json.\n\n```shell\n$ php vendor/bin/phpcp file:download /home/user composer.json --output=remote-composer.json\n```\n\n## Local development\n\nYou can use docker to run the project locally.\n\nThe docker-compose.yml file contains the environment variables needs for the commands.\n\n```yaml\nPHPCP_GITHUB_TOKEN:\nPHPCP_CPANEL_TOKEN:\nPHPCP_CPANEL_URL:\n```\n\nYou can map these variables to your own env variables with.\n\n```yaml\nPHPCP_GITHUB_TOKEN: ${GITHUB_TOKEN}\nPHPCP_CPANEL_TOKEN: ${CPANEL_TOKEN}\nPHPCP_CPANEL_URL: ${CPANEL_URL}\n```\n\nUsage.\n\n```shell\n# Start containers.\n$ docker compose up -d\n# Install composer dependencies..\n$ docker compose exec web composer install\n# Check if the phpcp is running.\n$ docker compose exec web php phpcp\n# List CPanel repositories.\n$ docker compose exec web php phpcp repo:list\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjoaocsilva%2Fphpcp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjoaocsilva%2Fphpcp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjoaocsilva%2Fphpcp/lists"}