PHPackages                             gogilo/sms-parser-cli - 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. gogilo/sms-parser-cli

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

gogilo/sms-parser-cli
=====================

A CLI tool to extract M-Pesa transactions from SMS XML backups

V1.05(1y ago)08MITPHP

Since Apr 29Pushed 1y ago1 watchersCompare

[ Source](https://github.com/gogilo2003/sms-parser-cli)[ Packagist](https://packagist.org/packages/gogilo/sms-parser-cli)[ RSS](/packages/gogilo-sms-parser-cli/feed)WikiDiscussions main Synced today

READMEChangelog (6)Dependencies (5)Versions (7)Used By (0)

M-Pesa SMS Parser CLI
=====================

[](#m-pesa-sms-parser-cli)

A PHP-based command-line tool for parsing M-Pesa SMS backup XML files and extracting incoming transactions into a CSV file.

📦 Features
----------

[](#-features)

- Parses SMS backup files (e.g., from SMS Backup &amp; Restore app)
- Extracts M-Pesa received payments from a specific sender
- Saves unique transactions to `mpesa_transactions.csv`
- Detects and skips duplicates
- Works with `sms-*.xml` files in the current directory

---

🚀 Installation
--------------

[](#-installation)

### 1. Clone the Repository

[](#1-clone-the-repository)

```
git clone https://github.com/gogilo2003/sms-parser.git
cd sms-parser
```

### 2. Install Globally via Composer

[](#2-install-globally-via-composer)

```
composer global config repositories.sms-parser path $(pwd)
composer global require gogilo/sms-parser:dev-main
```

> If you push this to GitHub, you can later install it directly via:
>
> ```
> composer global require gogilo/sms-parser
> ```

---

✅ Usage
-------

[](#-usage)

In any directory with `sms-*.xml` files:

```
parse-sms "JOHN DOE"
```

### Arguments

[](#arguments)

- `"JOHN DOE"` — The name of the person you're expecting M-Pesa payments from. It should appear exactly as shown in the SMS body.

---

📂 Output
--------

[](#-output)

A CSV file `mpesa_transactions.csv` will be created with the following columns:

- `Date`
- `Mpesa Reference`
- `From Name`
- `From Phone`
- `Amount`

Duplicates (based on reference code) are automatically skipped.

---

📘 Example
---------

[](#-example)

```
parse-sms "PETER MAINA"
```

Output:

```
Processing sms-backup-2024.xml
  Potential match found!
  MATCHED TRANSACTION:
    Ref: ABC123XYZ
    From: PETER MAINA
    Phone: 0712345678
    Amount: 1,000.00
    Date: 24/04/24 at 3:40 PM

RESULTS:
- Found 1 new transactions
- Skipped 0 duplicate references
- Output saved to mpesa_transactions.csv

```

---

🔧 Requirements
--------------

[](#-requirements)

- PHP 7.4+
- Composer

---

📄 License
---------

[](#-license)

MIT

---

🙏 Acknowledgements
------------------

[](#-acknowledgements)

Created by [Ogilo G.D. Ouma](https://github.com/gogilo2003)
SMS format based on Safaricom M-Pesa messages

###  Health Score

26

—

LowBetter than 41% of packages

Maintenance46

Moderate activity, may be stable

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity42

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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

Every ~5 days

Recently: every ~0 days

Total

6

Last Release

403d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/5dcf3ddd4de0a280585a1e3bfb08d635147cb1535d7ec7fe37fcfbafdd66c61f?d=identicon)[gogilo2003](/maintainers/gogilo2003)

---

Top Contributors

[![gogilo2003](https://avatars.githubusercontent.com/u/5575977?v=4)](https://github.com/gogilo2003 "gogilo2003 (7 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/gogilo-sms-parser-cli/health.svg)

```
[![Health](https://phpackages.com/badges/gogilo-sms-parser-cli/health.svg)](https://phpackages.com/packages/gogilo-sms-parser-cli)
```

###  Alternatives

[laravel/sail

Docker files for running a basic Laravel application.

1.9k205.7M1.3k](/packages/laravel-sail)[spatie/laravel-export

Create a static site bundle from a Laravel app

674146.0k6](/packages/spatie-laravel-export)

PHPackages © 2026

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