PHPackages                             gsl/civicrm-cli-utils - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [CLI &amp; Console](/categories/cli)
4. /
5. gsl/civicrm-cli-utils

ActiveLibrary[CLI &amp; Console](/categories/cli)

gsl/civicrm-cli-utils
=====================

 Miscelanious utils. Bootstrap CiviCRM and wrap API for command-line use.

0.1.0(10y ago)019GPL-3.0PHP

Since Dec 30Pushed 8y ago2 watchersCompare

[ Source](https://github.com/ginkgostreet/civicrm-cli-utils)[ Packagist](https://packagist.org/packages/gsl/civicrm-cli-utils)[ RSS](/packages/gsl-civicrm-cli-utils/feed)WikiDiscussions master Synced 2w ago

READMEChangelog (1)Dependencies (1)Versions (4)Used By (0)

civicrm-cli-utils
=================

[](#civicrm-cli-utils)

Mixed bag of civicrm command line utils. Work in progress.

Install
-------

[](#install)

composer install to fetch dependency: wp-cli/php-cli-tools

### Config file

[](#config-file)

You can place a `.conf` file in the root of the project to save yourself some typing. See includes/base.php ::`getConfig()`. A good config to have in there is `CIVICRM_ROOT`. Also see the option to specifcy column mappings for includes/base.php::`mapColumns()`

Example
-------

[](#example)

clean is an example usage of these utils. It deletes, un-deletes, as well as imports contacts piped to STDIN. Use the source, Luke.

Caution
-------

[](#caution)

For pre-4.7 versions of civicrm, `cvCli()` requires a core hack to add --json output option.

- Suggest using `dushCVApi()` if you can, which serves the same purpose. PR's welcome to add wp-cli support.

a hasty orientation over chat:
------------------------------

[](#a-hasty-orientation-over-chat)

"clean" started off as an example integration... but then Toby generalized it... so... there ya go. I'm looking to figure out what will need to be extended you should skim this file: just look at the function names, `parseCsv()` being a key one.

oh right, getConfig is another. that might be where you got hung-up last time. that is not the only way to set this up, but probably the easiest... put a .conf file in the root of this project, and set the path to civicrm.

so... I think creating a file LIKE createContact.php .. e.g. createParticipant.php yes, it involves coding... but it is pretty declarative.

the suffix `_run()` is what the core will look for to implement a command, e.g. createParticipant. You can see around the end of clean.php... it looks for a file that matches the command and then expects that loaded by that file... a function of similar name with the suffix, `_run()`.

so... `createContact_run()`... basically gets the global configs (which just has the path to Civi), and then sets some constants... and then it does:

```
$main = 'processContactsForImport';
withFile($input, $main);

```

which says... for each line of the input file, call the function `processContactsForImport.`... which is defined in the same file. ... and that function, recieves the line, already parsed out into an array, and then uses the core utility to call the civicrm API.

###  Health Score

25

—

LowBetter than 35% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity55

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 96.3% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

3880d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/7e19720557520f10c3883fec34cb99e1be7d3bccb9c9b9d9ecbe4659dc5c1cab?d=identicon)[ginkgostreet](/maintainers/ginkgostreet)

---

Top Contributors

[![caracolmzd](https://avatars.githubusercontent.com/u/2687924?v=4)](https://github.com/caracolmzd "caracolmzd (26 commits)")[![TobiasLounsbury](https://avatars.githubusercontent.com/u/4284287?v=4)](https://github.com/TobiasLounsbury "TobiasLounsbury (1 commits)")

### Embed Badge

![Health badge](/badges/gsl-civicrm-cli-utils/health.svg)

```
[![Health](https://phpackages.com/badges/gsl-civicrm-cli-utils/health.svg)](https://phpackages.com/packages/gsl-civicrm-cli-utils)
```

###  Alternatives

[wp-cli/wp-cli

WP-CLI framework

5.2k19.8M440](/packages/wp-cli-wp-cli)[indatus/dispatcher

Schedule your artisan commands within your application's source code

1.1k931.0k2](/packages/indatus-dispatcher)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
