# Mautic-cli - an open-source CLI to control Mautic from the terminal or any AI coding agent

**URL:** <https://forum.mautic.org/t/mautic-cli-an-open-source-cli-to-control-mautic-from-the-terminal-or-any-ai-coding-agent/37480>\
**Category:** 3rd Party Addons\
**Created:** [March 13, 2026, 4:55pm UTC](https://forum.mautic.org/t/mautic-cli-an-open-source-cli-to-control-mautic-from-the-terminal-or-any-ai-coding-agent/37480 "2026-03-13T16:55:22Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![introfini](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/introfini/32/14915_2.png) [@introfini](https://forum.mautic.org/u/introfini)\
**Post date:** [March 13, 2026, 4:55pm UTC](https://forum.mautic.org/t/mautic-cli-an-open-source-cli-to-control-mautic-from-the-terminal-or-any-ai-coding-agent/37480/1 "2026-03-13T16:55:22Z")

</div>

Hey everyone!

Just released _ **mautic-cli** _ - an open-source CLI to control Mautic from the terminal or any AI coding agent.

> **[GitHub - Bloomidea/mautic-cli: Control Mautic from the command line or any AI...](https://github.com/Bloomidea/mautic-cli)**
>
> Control Mautic from the command line or any AI coding agent.

_ **What it does:** _

- 17 resource groups (contacts, segments, emails, campaigns, forms, companies, and more)
- 65 commands covering list, get, create, edit, delete, send, and more
- Output as JSON, table, CSV, or auto-paginating NDJSON
- Basic Auth and OAuth2, multiple profiles, Mautic 4-7 supported

_ **Quick start:** _

```uv
  uv tool install mautic-cli
  mautic auth setup
  mautic contacts list --limit 5

```

_ **AI agents** _ (Claude Code, Cursor, Codex, Gemini, Windsurf, etc.) can use it as a skill:

`npx skills add bloomidea/mautic-cli`

Feedback and contributions welcome!

---

<div class="post-metadata">

**Author:** ![dirk\_s](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/dirk_s/32/748_2.png) [@dirk\_s](https://forum.mautic.org/u/dirk_s)\
**Post date:** [March 17, 2026, 9:06am UTC](https://forum.mautic.org/t/mautic-cli-an-open-source-cli-to-control-mautic-from-the-terminal-or-any-ai-coding-agent/37480/2 "2026-03-17T09:06:31Z")

</div>

Thank you - what a nice idea! Will check in the next days…

---

<div class="post-metadata">

**Author:** ![andrew\_c3](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/andrew_c3/32/13547_2.png) [@andrew\_c3](https://forum.mautic.org/u/andrew_c3)\
**Post date:** [March 17, 2026, 10:37am UTC](https://forum.mautic.org/t/mautic-cli-an-open-source-cli-to-control-mautic-from-the-terminal-or-any-ai-coding-agent/37480/3 "2026-03-17T10:37:09Z")

</div>

**Hello [introfini](https://forum.mautic.org/u/introfini),**

I’m looking at **Mautic-CLI** , which has an awesome feature set for managing Mautic from the terminal or integrating with AI tools.

I have a few questions about running it on a shared hosting account:

- Has anyone tried installing it on shared hosting where Python needs to be installed first?

- What other prerequisites are required for it to install and run?

- Can it be installed manually, or do you have to follow the official installation exactly?

I’m new to Python, so I’m still learning how it works—apologies if some of these questions are basic. Any guidance would be really appreciated!

Thanks.

---

<div class="post-metadata">

**Author:** ![introfini](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/introfini/32/14915_2.png) [@introfini](https://forum.mautic.org/u/introfini)\
**Post date:** [March 19, 2026, 2:20pm UTC](https://forum.mautic.org/t/mautic-cli-an-open-source-cli-to-control-mautic-from-the-terminal-or-any-ai-coding-agent/37480/4 "2026-03-19T14:20:10Z")

</div>

Hi @[andrew\_c3](https://forum.mautic.org/u/andrew_c3), thanks for the interest in Mautic-CLI!

I think there might be a misunderstanding about how it works - Mautic-CLI runs on your local computer (your laptop/desktop), not on the server where Mautic is hosted. It connects to your Mautic instance remotely via the API over HTTPS, just like your browser does.

So shared hosting compatibility doesn’t matter at all. You just need to enable Basic Auth or OAuth2 in your Mautic instance so the CLI can authenticate.

On the Mautic side:

- Go to Mautic Settings \> API Settings
- Enable the API
- Enable Basic Authentication (simplest option) or set up OAuth2 credentials

On your local machine:

You don’t need to know Python at all. The recommended installer, uv, handles everything for you - Python included. Just run:

# Install uv (one-time)

`curl -LsSf ``https://astral.sh/uv/install.sh`` | sh`

# Install Mautic-CLI (uv downloads the right Python automatically)

`uv tool install mautic-cli`

# Connect to your Mautic instance

`mautic auth setup`

That’s it. uv will download and manage the correct Python version behind the scenes - you never have to touch Python directly.

On Windows, the uv install command is different - check [Installation | uv](https://docs.astral.sh/uv/getting-started/installation/) for details.

Hope that clears things up!

---

<div class="post-metadata">

**Author:** ![andrew\_c3](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/andrew_c3/32/13547_2.png) [@andrew\_c3](https://forum.mautic.org/u/andrew_c3)\
**Post date:** [March 20, 2026, 12:01pm UTC](https://forum.mautic.org/t/mautic-cli-an-open-source-cli-to-control-mautic-from-the-terminal-or-any-ai-coding-agent/37480/5 "2026-03-20T12:01:09Z")

</div>

**Hello [introfini](https://forum.mautic.org/u/introfini),**

Thanks for your kind reply.

I initially missed the crucial detail that this is a remote Mautic CLI/API tool running on a desktop or workstation. Even so, it looks like a very powerful solution, and I can already imagine several use cases—I’m looking forward to trying it out soon.

I got particularly excited when I thought those commands might be available directly in a console on the Mautic server, as that would make it possible to call them programmatically from within a Mautic plugin or possibly in a C++ app on the same box.

Do you happen to know how feasible it would be to run this tool directly on the Mautic server in that way? Or are those command already available in the Mautic console on the server ?

Thanks for your great work.

---

<div class="post-metadata">

**Author:** ![introfini](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/introfini/32/14915_2.png) [@introfini](https://forum.mautic.org/u/introfini)\
**Post date:** [March 20, 2026, 12:21pm UTC](https://forum.mautic.org/t/mautic-cli-an-open-source-cli-to-control-mautic-from-the-terminal-or-any-ai-coding-agent/37480/6 "2026-03-20T12:21:19Z")

</div>

@[andrew\_c3](https://forum.mautic.org/u/andrew_c3)

Glad it’s clearer now!

To answer your questions:

Running mautic-cli on the server: Yes, it works fine on the server too. It’s just a Python CLI that makes HTTP calls, so it can run anywhere with network access to your Mautic instance, including the same machine. If running locally on the server, your base URL would just be [http://localhost](http://localhost) (or whatever our local Mautic address is). You’d install it the same way with uv, and you could call it from a PHP plugin via exec() / shell\_exec() or from a C++ app via system() / popen(). The JSON output mode (the default) makes it straightforward to parse the results programmatically.

Mautic’s built-in console: Mautic does ship with its own console at bin/console (Symfony-based), but it serves a different purpose. Those commands are mostly for administration and background processing:

- mautic:segments:update - rebuild segment membership
- mautic:campaigns:trigger - process campaign events
- mautic:emails:send - send queued emails
- mautic:import - run CSV imports
- cache:clear, doctrine:migrations:migrate, etc.

They don’t provide the CRUD API operations that mautic-cli offers (list/search/create/edit/delete contacts, send specific emails, manage forms, etc.). So the two tools complement each other rather than overlap: bin/console handles background jobs and maintenance, while mautic-cli handles data operations through the API.

---

<div class="post-metadata">

**Author:** ![andrew\_c3](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/andrew_c3/32/13547_2.png) [@andrew\_c3](https://forum.mautic.org/u/andrew_c3)\
**Post date:** [March 20, 2026, 12:42pm UTC](https://forum.mautic.org/t/mautic-cli-an-open-source-cli-to-control-mautic-from-the-terminal-or-any-ai-coding-agent/37480/7 "2026-03-20T12:42:08Z")

</div>

Hello **[introfini](https://forum.mautic.org/u/introfini)**

Thanks for your speedy and detailed help.

The Mautic CLI opens up a lot of possibilities—great work, and thank you for your contribution to the community! I will enjoy giving it a try soon.

Thanks
