Civix is a command-line tool for building CiviCRM extensions. It is distributed as part of CiviCRM-Buildkit.
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 the civix.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:
civix
as a system-wide/standalone tool
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.