civicrm / cli-tools
Requires
- civicrm/composer-downloads-plugin: ^3.0 || ^4.0
This package is auto-updated.
Last update: 2026-05-20 20:47:24 UTC
README
A bundle of CiviCRM command-line tools. This specifically includes:
cv: General purpose administration / Swiss Army knifecivistrings: Scan source-code for translatable stringscivix: Generate extensionscoworker: Execute background jobs
This is intended for site-builders who have composer-based deployments (esp Drupal 9/10).
It supports workflows based on composer require, composer update, and vendor-bin.
Usage
To add these tools to an existing composer build (e.g. Drupal 9/10 site), run:
composer require civicrm/cli-tools
This adds CiviCRM CLI tools to composer's vendor/bin folder.
You can call commands through composer exec or vendor/bin:
## Example 1: Call cv through `composer exec` composer exec cv api4 Contact.get +l 1 ## Example 2: Call cv through `./vendor/bin` ./vendor/bin/cv api4 Contact.get +l 1 ## Example 3: Add cv your PATH PATH="/path/to/vendor/bin:$PATH" cv api4 Contact.get +l 1
In depth
- This is like a subset of
civicrm-buildkit. It omits general development tools (phpunit), CMS-building tools (drush,wp), standard runtime environments (min,max), and autobuild sites (drupal-clean,wp-demo, etc). This is only the Civi-specific stuff that you would want to add on top of D9/D10 sites. - The bridge here has 3 simple pieces:
- Download each executable via
composer-downloads-plugin(e.g.extern/cv.phar). - Add a stub script (e.g.
bin/cv) - Register the stub (
bin/cv) for use with composer'svendor/bin/.
- Download each executable via
- This layout should be able to leverage composer's platform-specific wiring (e.g. Windows
.batfiles).
Maintenance
This project is derived from civicrm-buildkit.git:phars.json. Whenever there's a relevant update to phars.json, we should also update civicrm-cli-tools.
For a maintainer of civicrm/civicrm-cli-tools.git, you can follow these steps:
git clone git@github.com:civicrm/civicrm-cli-tools.git cd civicrm-cli-tools ./scripts/update git push <FIXME>
Note the output of ./script/update. It will include details about how to push the update.