Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message
Mailcoach Cli

Mailcoach Cli Laravel Package

spatie/mailcoach-cli

Command-line tool for Mailcoach. Log in with your instance URL and API token, then run autogenerated commands for every Mailcoach API endpoint (lists, campaigns, etc.). Includes clear-cache/logout and an AI agent skill for Boost/skills.sh.

View on GitHub
Deep Wiki
Context7

At a glance

Frequently asked questions about Mailcoach Cli
How do I install Mailcoach CLI in a Laravel project?
Use Composer to install it as a dev dependency: `composer require spatie/mailcoach-cli --dev`. Then run `php artisan boost:install` if using Laravel Boost. For standalone use, install globally with `composer global require spatie/mailcoach-cli`.
What Laravel versions does Mailcoach CLI support?
The package is officially tested with Laravel 13+. For older versions, use the standalone CLI or ensure compatibility with your PHP version (8.1+). Check the Boost docs if integrating with Laravel 12 or below.
How do I authenticate the CLI with my Mailcoach instance?
Run `mailcoach login` and provide your Mailcoach URL (e.g., `https://your-instance.mailcoach.app`) and an API token from `/account/api-tokens`. Credentials are stored securely in `~/.mailcoach/config.json`.
Can I use this CLI without Laravel (e.g., in a PHP script)?
Yes, install it globally with `composer global require spatie/mailcoach-cli` and use it anywhere. However, Laravel-specific features like Boost integration or service container binding won’t be available outside Laravel projects.
How do I handle API rate limits or throttling with this CLI?
The CLI doesn’t include built-in retry logic for rate limits, but you can wrap commands in your own scripts using exponential backoff. Monitor Mailcoach’s API docs for rate limits and adjust your workflows accordingly.
What happens if Mailcoach’s API changes or breaks?
The CLI auto-generates commands from the OpenAPI spec, so new endpoints are added automatically. Run `mailcoach clear-cache` to refresh the spec if Mailcoach updates its API. Monitor their changelog for breaking changes.
How do I integrate this CLI with AI agents like Claude or Copilot?
Install the AI skill via `npx skills add spatie/mailcoach-cli` or manually copy the skill files to your agent’s directory (e.g., `.claude/skills/mailcoach/`). The skill enables agents to run Mailcoach commands directly.
Is there a way to test CLI commands in CI/CD without hitting Mailcoach’s API?
Yes, mock the Mailcoach API in your tests by intercepting HTTP requests or using a local Mailcoach instance. The CLI itself doesn’t include built-in mocking, but you can test commands by validating their output against expected API responses.
How secure is storing API tokens in `~/.mailcoach/config.json`?
The file is stored locally and isn’t encrypted by default. For production, consider using Laravel’s `.env` or a secrets manager (e.g., HashiCorp Vault) instead of relying on the CLI’s default storage.
What are the alternatives to Mailcoach CLI for managing Mailcoach via the API?
Alternatives include writing custom Guzzle HTTP clients or using Mailcoach’s official API directly. However, this CLI provides auto-generated commands, reducing boilerplate and keeping you aligned with Mailcoach’s API updates.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
davejamesmiller/laravel-breadcrumbs
artisanry/parsedown
christhompsontldr/phpsdk
enqueue/dsn
bunny/bunny
enqueue/test
enqueue/null
enqueue/amqp-tools
milesj/emojibase
bower-asset/punycode
bower-asset/inputmask
bower-asset/jquery
bower-asset/yii2-pjax
laravel/nova
spatie/laravel-mailcoach
spatie/laravel-superseeder
laravel/liferaft
nst/json-test-suite
danielmiessler/sec-lists
jackalope/jackalope-transport