PHPackages                             spatie/mailcoach-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. spatie/mailcoach-cli

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

spatie/mailcoach-cli
====================

CLI tool for interacting with the Mailcoach API

1.0.1(1mo ago)02—0%MITPHPPHP ^8.4CI passing

Since Mar 20Pushed 1mo agoCompare

[ Source](https://github.com/spatie/mailcoach-cli)[ Packagist](https://packagist.org/packages/spatie/mailcoach-cli)[ Docs](https://github.com/spatie/mailcoach-cli)[ RSS](/packages/spatie-mailcoach-cli/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (2)Dependencies (7)Versions (3)Used By (0)

Mailcoach CLI
=============

[](#mailcoach-cli)

A command-line tool to interact with the [Mailcoach](https://mailcoach.app) API from your terminal. Built on top of the Mailcoach OpenAPI spec, so all API endpoints are available as commands automatically.

Installation
------------

[](#installation)

```
composer global require spatie/mailcoach-cli
```

Getting started
---------------

[](#getting-started)

### 1. Authenticate

[](#1-authenticate)

Connect the CLI to your Mailcoach instance:

```
mailcoach login
```

You'll be prompted for:

- Your Mailcoach instance URL (e.g. `https://example.mailcoach.app`)
- An API token — create one at `https://example.mailcoach.app/account/api-tokens`

### 2. Run commands

[](#2-run-commands)

Once authenticated, all API endpoints are available as commands:

```
mailcoach list-email-lists
mailcoach show-email-list --email-list-id=1
mailcoach list-campaigns
mailcoach show-campaign --campaign-id=1
```

Run `mailcoach` without arguments to see all available commands.

### 3. Other commands

[](#3-other-commands)

```
mailcoach logout       # Remove stored credentials
mailcoach clear-cache  # Clear the cached API spec (refreshes every 24h)
```

AI Agent Skill
--------------

[](#ai-agent-skill)

This CLI ships with an [agent skill](https://skills.sh) so AI agents can manage your Mailcoach instance on your behalf.

### Install via Laravel Boost

[](#install-via-laravel-boost)

In a Laravel project using [Boost](https://laravel.com/docs/13.x/boost):

```
composer require spatie/mailcoach-cli --dev
php artisan boost:install
```

### Install via skills.sh

[](#install-via-skillssh)

Works with Claude Code, Cursor, GitHub Copilot, and [40+ other agents](https://skills.sh):

```
npx skills add spatie/mailcoach-cli
```

### Manual installation

[](#manual-installation)

Copy the `resources/boost/skills/mailcoach/` directory into your agent's skill directory:

- **Claude Code**: `.claude/skills/mailcoach/`
- **Cursor**: `.cursor/skills/mailcoach/`
- **Generic**: `.ai/skills/mailcoach/`

Credentials
-----------

[](#credentials)

Your API token and instance URL are stored in `~/.mailcoach/config.json`. Running `mailcoach logout` removes this file.

Development
-----------

[](#development)

```
git clone git@github.com:spatie/mailcoach-cli.git
cd mailcoach-cli
composer install

php mailcoach            # Run locally
vendor/bin/pest          # Run tests
vendor/bin/phpstan analyse  # Static analysis
vendor/bin/pint          # Code style
```

###  Health Score

41

—

FairBetter than 88% of packages

Maintenance96

Actively maintained with recent releases

Popularity3

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity52

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 ~0 days

Total

2

Last Release

49d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/7535935?v=4)[Spatie](/maintainers/spatie)[@spatie](https://github.com/spatie)

---

Top Contributors

[![timvandijck](https://avatars.githubusercontent.com/u/4528796?v=4)](https://github.com/timvandijck "timvandijck (13 commits)")

---

Tags

apiclimailcoach

###  Code Quality

TestsPest

Static AnalysisPHPStan

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/spatie-mailcoach-cli/health.svg)

```
[![Health](https://phpackages.com/badges/spatie-mailcoach-cli/health.svg)](https://phpackages.com/packages/spatie-mailcoach-cli)
```

###  Alternatives

[zenddevops/client

ZF2 CLI tool to access Zend Server Web API

225.1k](/packages/zenddevops-client)[renoki-co/php-helm

PHP Helm Processor is a process wrapper for Kubernetes' Helm v3 CLI. You can run programmatically Helm v3 commands, directly from PHP, with a simple syntax.

1310.5k](/packages/renoki-co-php-helm)

PHPackages © 2026

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