Civix is a command-line tool for building CiviCRM extensions. It is distributed as part of CiviCRM-Buildkit.
- PHP 7.3+
- 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.phar
as system-wide tool (Linux/BSD/macOS)) -
Or... add
civix
and other CiviCRM tools to a composer project (Drupal 9/10/11)composer require civicrm/cli-tools
(Learn more: Install
civix.phar
as project tool (composer)) -
Or... use phar.io's
phive
installer to download, validate, and cache thecivix.phar
file.phive install totten/civix
(Learn more: Install
civix.phar
as project tool (phive))
There are several more options for downloading civix
. See also:
- Download URLs for alternate versions
- Comparison of install options
- Install
civix
as a system-wide/standalone tool - Install
civix
as 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 --help
If you are developing updates for civix.git
, then see doc/develop.md. It discusses PHAR compilation, unit tests, and similar processes.