phpkg

A package manager to boost your code

phpkg is a modern PHP package manager that brings Git-based dependency management to PHP with function-first autoloading. We've brought back all PHP functionalities for you so you can write code however you want.


phpkg is more than a package manager

We've created a tool that has everything you need to build rapid applications.

Functional and OOP

It supports both functional and OOP programming! Autoload namespaced functions alongside classesโ€”no class wrappers needed.

No Intermediate Repo

It uses Git packages directly from repository URLs. No central registry, no middlemanโ€”just direct Git access.

JIT Compile

It only requires used files to your project, not all of them! Builds are optimized and lean.


Quick Start

# Install phpkg
bash -c "$(curl -fsSL https://raw.githubusercontent.com/php-repos/phpkg-installation/master/install.sh)"

# Try it out
phpkg run php-repos/chuck-norris

# Start a project
mkdir my-app && cd my-app
phpkg init
phpkg add php-repos/observer
phpkg build

New to phpkg? Start with the Getting Started Guide.


Documentation Index

๐Ÿš€ Getting Started

๐Ÿ“ฆ Core Commands

Package Management

  • Add - Add packages to your project
  • Remove - Remove packages from your project
  • Update - Update packages to new versions
  • Install - Install packages from config

Project Management

  • Init - Initialize a new phpkg project
  • Build - Build your project with production-ready files
  • Watch - Auto-rebuild on file changes
  • Flush - Clean build artifacts

Standalone Execution

  • Run - Run packages as CLI tools without installation
  • Serve - Serve packages as web apps

Utilities

  • Version - Display phpkg version information
  • Alias - Create shortcuts for package URLs
  • Credential - Manage Git credentials
  • Migrate - Migrate from Composer

โš™๏ธ Configuration & Customization

๐Ÿ†˜ Help & Reference


Why This Matters?

We believe that PHP has enormous untapped potential, and we are dedicated to creating tools that empower developers to harness its full power and capabilities. phpkg unlocks this potential by simplifying the process of using PHP to its fullest extent. With phpkg, developers can take advantage of all that PHP has to offer and build more efficient, scalable, and powerful applications.


What Makes phpkg Different?

Feature phpkg Composer
Function autoloading โœ… Yes โŒ No
Git-based โœ… Direct โš ๏ธ Via Packagist
Central registry โŒ No โœ… Required
Standalone execution โœ… Yes โŒ No
Web app serving โœ… Yes โŒ No
Build system โœ… Built-in โŒ External tools

Platform Support

  • โœ… macOS - Fully supported
  • โœ… Linux - Fully supported
  • โœ… Windows - Supported (PHP 8.5+ required, fully tested; later versions may need additional testing)

Next Steps

  1. Install phpkg on your system
  2. Follow the Getting Started guide to create your first project
  3. Explore the commands to understand what phpkg can do
  4. Read Best Practices for recommended workflows

Need Help?


Happy coding with phpkg! ๐Ÿš€

Share: