Civix is a command-line tool for building CiviCRM extensions. It is distributed as part of CiviCRM-Buildkit.
- PHP 7.4+
- CiviCRM 5.x (Recommended: any release from the prior 12 months)
- (For MAMP, WAMP, XAMPP, etc) PHP command-line configuration (http://wiki.civicrm.org/confluence/display/CRMDOC/Setup+Command-Line+PHP)
- (For CentOS/RHEL) Compatible version of libxml2 (#19)
civix is distributed in PHAR format, which is a portable executable file (for PHP). It should run on most Unix-like systems where PHP is installed.
Here are three quick ways to download it:
-
Download the latest release of
civix.phar(SHA256, GPG) and put it in the PATH. For example:sudo curl -LsS https://download.civicrm.org/civix/civix.phar -o /usr/local/bin/civix sudo chmod +x /usr/local/bin/civix
(Learn more: Install
civix.pharas system-wide tool (Linux/BSD/macOS)) -
Or... add
civixand other CiviCRM tools to a composer project (Drupal 9/10/11)composer require civicrm/cli-tools
(Learn more: Install
civix.pharas project tool (composer)) -
Or... use phar.io's
phiveinstaller to download, validate, and cache thecivix.pharfile.phive install totten/civix
(Learn more: Install
civix.pharas project tool (phive))
There are several more options for downloading civix. See also:
- Download URLs for alternate versions
- Comparison of install options
- Install
civixas a system-wide/standalone tool - Install
civixas a tool within another project
The CiviCRM Developer Guide includes tutorials for building extensions
For reference documentation, civix supports a "--help" option. For example, to get reference materials about the "generate:page" command, run:
civix generate:page --helpIf you are developing updates for civix.git, then see doc/develop.md. It discusses PHAR compilation, unit tests, and similar processes.