A command-line interface and a TUI dashboard for the MailerLite API. Use it to manage subscribers, campaigns, automations, groups, forms, and e-commerce data from the terminal.
brew install mailerlite/tap/mailerlitemacOS and Linux:
curl --proto '=https' --tlsv1.2 -LsSf https://github.com/mailerlite/mailerlite-cli/releases/latest/download/mailerlite-installer.sh | shWindows (PowerShell):
powershell -ExecutionPolicy Bypass -c "irm https://github.com/mailerlite/mailerlite-cli/releases/latest/download/mailerlite-installer.ps1 | iex"Download binaries for Linux, macOS, and Windows from the releases page.
cargo install --git https://github.com/mailerlite/mailerlite-cli.gitInstall a Rust toolchain from rustup.rs first.
git clone https://github.com/mailerlite/mailerlite-cli.git
cd mailerlite-cli
cargo build --releaseMove the binary to a directory on your $PATH:
sudo mv target/release/mailerlite /usr/local/bin/Run the CLI without installation:
nix run git+ssh://git@github.com/mailerlite/mailerlite-cli.gitInstall the CLI into your profile:
nix profile install git+ssh://git@github.com/mailerlite/mailerlite-cli.gitOr add the CLI to a flake.nix:
{
inputs.mailerlite-cli.url = "git+ssh://git@github.com/mailerlite/mailerlite-cli.git";
# then use: inputs.mailerlite-cli.packages.${system}.default
}The CLI has two authentication methods: OAuth (recommended) and API token.
mailerlite auth loginThe command opens the browser and authorizes the CLI with your MailerLite account. You do not create or paste tokens - the CLI does this for you. The CLI refreshes OAuth tokens automatically when they expire.
You can also authenticate with an API token:
mailerlite auth login --method tokenThe CLI asks for your MailerLite API token. Create a token in your MailerLite dashboard under API Tokens.
Show the authentication status:
mailerlite auth statusLog out:
mailerlite auth logoutYou can keep more than one profile:
mailerlite profile add staging
mailerlite profile add production
mailerlite profile list
mailerlite profile switch stagingUse a specific profile for one command:
mailerlite subscriber list --profile productionIf your OAuth credentials have access to more than one account:
mailerlite account list
mailerlite account switch <account_id>You can also set the API token with an environment variable:
export MAILERLITE_API_TOKEN="your_token_here"Every command accepts these flags:
| Flag | Description |
|---|---|
--json |
Output raw JSON instead of formatted tables |
--verbose, -v |
Print HTTP request and response details |
--profile <name> |
Use a specific auth profile |
--yes, -y |
Skip confirmation prompts |
--help, -h |
Show help for any command |
Start the interactive TUI dashboard:
mailerlite dashboardThe dashboard gives you a lazygit-style interface with vim keybindings. Use the sidebar to move between subscribers, campaigns, automations, groups, and forms. Press ? for help. Press q to quit.
# List subscribers
mailerlite subscriber list
mailerlite subscriber list --limit 50 --status active
# Filter by email
mailerlite subscriber list --email user@example.com
# Get subscriber count
mailerlite subscriber count
# Get subscriber details (by ID or email)
mailerlite subscriber get <id_or_email>
# Create or update a subscriber
mailerlite subscriber upsert \
--email "user@example.com" \
--status active \
--groups "group1_id,group2_id" \
--fields '{"name":"John","company":"Acme"}'
# Update a subscriber
mailerlite subscriber update <id> --status unsubscribed
# Delete a subscriber
mailerlite subscriber delete <id>
# Forget a subscriber (GDPR)
mailerlite subscriber forget <id># List groups
mailerlite group list
mailerlite group list --limit 50 --sort name
# Create a group
mailerlite group create --name "Newsletter"
# Update a group
mailerlite group update <group_id> --name "Weekly Newsletter"
# Delete a group
mailerlite group delete <group_id>
# List subscribers in a group
mailerlite group subscribers <group_id>
# Assign / unassign a subscriber
mailerlite group assign <group_id> <subscriber_id>
mailerlite group unassign <group_id> <subscriber_id># List campaigns
mailerlite campaign list
mailerlite campaign list --status sent --type regular
# Get campaign details
mailerlite campaign get <campaign_id>
# Create a campaign
mailerlite campaign create \
--name "Welcome Campaign" \
--type regular \
--subject "Welcome!" \
--from "sender@yourdomain.com" \
--from-name "Sender Name" \
--content "<h1>Hello</h1>" \
--groups "group_id"
# Update a campaign
mailerlite campaign update <campaign_id> --subject "Updated Subject"
# Schedule a campaign
mailerlite campaign schedule <campaign_id> \
--delivery scheduled \
--date 2026-03-01 \
--hours 10 \
--minutes 0
# Cancel a campaign
mailerlite campaign cancel <campaign_id>
# List campaign subscriber activity
mailerlite campaign subscribers <campaign_id>
# List available campaign languages
mailerlite campaign languages
# Delete a campaign
mailerlite campaign delete <campaign_id># List automations
mailerlite automation list
mailerlite automation list --enabled true
# Get automation details
mailerlite automation get <automation_id>
# List automation subscriber activity
mailerlite automation subscribers <automation_id># List forms
mailerlite form list
mailerlite form list --type popup --sort name
# Get form details
mailerlite form get <form_id>
# Update a form
mailerlite form update <form_id> --name "Updated Form"
# Delete a form
mailerlite form delete <form_id>
# List form subscribers
mailerlite form subscribers <form_id># List subscriber fields
mailerlite field list
# Create a field
mailerlite field create --name "Company" --type text
# Update a field
mailerlite field update <field_id> --name "Organization"
# Delete a field
mailerlite field delete <field_id># List segments
mailerlite segment list
# Update a segment
mailerlite segment update <segment_id> --name "VIP Customers"
# Delete a segment
mailerlite segment delete <segment_id>
# List subscribers in a segment
mailerlite segment subscribers <segment_id># List webhooks
mailerlite webhook list
# Create a webhook
mailerlite webhook create \
--name "My Webhook" \
--url "https://example.com/webhook" \
--events "subscriber.created,campaign.sent" \
--enabled
# Get webhook details
mailerlite webhook get <webhook_id>
# Update a webhook
mailerlite webhook update <webhook_id> --name "Updated Webhook"
# Delete a webhook
mailerlite webhook delete <webhook_id># List available timezones
mailerlite timezone list# List shops
mailerlite shop list
# Get shop details
mailerlite shop get <shop_id>
# Create a shop
mailerlite shop create --name "My Store" --url "https://mystore.com"
# Update a shop
mailerlite shop update <shop_id> --name "Updated Store"
# Delete a shop
mailerlite shop delete <shop_id>
# Get shop count
mailerlite shop countAll product commands require --shop.
# List products
mailerlite product list --shop <shop_id>
# Get product details
mailerlite product get <product_id> --shop <shop_id>
# Create a product
mailerlite product create --shop <shop_id> \
--name "T-Shirt" \
--price 29.99 \
--url "https://mystore.com/tshirt" \
--description "A nice t-shirt"
# Update a product
mailerlite product update <product_id> --shop <shop_id> --price 24.99
# Delete a product
mailerlite product delete <product_id> --shop <shop_id>
# Get product count
mailerlite product count --shop <shop_id>All category commands require --shop.
# List categories
mailerlite category list --shop <shop_id>
# Get category details
mailerlite category get <category_id> --shop <shop_id>
# Create a category
mailerlite category create --shop <shop_id> --name "Apparel"
# Update a category
mailerlite category update <category_id> --shop <shop_id> --name "Clothing"
# Delete a category
mailerlite category delete <category_id> --shop <shop_id>
# Get category count
mailerlite category count --shop <shop_id>
# List products in a category
mailerlite category products <category_id> --shop <shop_id>
# Assign / unassign a product
mailerlite category assign-product <category_id> --shop <shop_id> --product <product_id>
mailerlite category unassign-product <category_id> --shop <shop_id> --product <product_id>All customer commands require --shop.
# List customers
mailerlite customer list --shop <shop_id>
# Get customer details
mailerlite customer get <customer_id> --shop <shop_id>
# Create a customer
mailerlite customer create --shop <shop_id> \
--email "customer@example.com" \
--first-name "John" \
--last-name "Doe"
# Update a customer
mailerlite customer update <customer_id> --shop <shop_id> --first-name "Jane"
# Delete a customer
mailerlite customer delete <customer_id> --shop <shop_id>
# Get customer count
mailerlite customer count --shop <shop_id>All order commands require --shop.
# List orders
mailerlite order list --shop <shop_id>
# Get order details
mailerlite order get <order_id> --shop <shop_id>
# Create an order
mailerlite order create --shop <shop_id> \
--customer <customer_id> \
--status complete \
--total 59.98 \
--currency USD \
--items '[{"product_id":"prod1","quantity":2,"price":29.99}]'
# Update an order
mailerlite order update <order_id> --shop <shop_id> --status complete
# Delete an order
mailerlite order delete <order_id> --shop <shop_id>
# Get order count
mailerlite order count --shop <shop_id>All cart commands require --shop.
# List carts
mailerlite cart list --shop <shop_id>
# Get cart details
mailerlite cart get <cart_id> --shop <shop_id>
# Update a cart
mailerlite cart update <cart_id> --shop <shop_id> --currency EUR
# Get cart count
mailerlite cart count --shop <shop_id>All cart-item commands require --shop and --cart.
# List cart items
mailerlite cart-item list --shop <shop_id> --cart <cart_id>
# Create a cart item
mailerlite cart-item create --shop <shop_id> --cart <cart_id> \
--product <product_id> \
--quantity 2 \
--price 29.99
# Update a cart item
mailerlite cart-item update <item_id> --shop <shop_id> --cart <cart_id> --quantity 3
# Delete a cart item
mailerlite cart-item delete <item_id> --shop <shop_id> --cart <cart_id>
# Get cart item count
mailerlite cart-item count --shop <shop_id> --cart <cart_id># Import categories from JSON file
mailerlite import categories --shop <shop_id> --file categories.json
# Import products from JSON file
mailerlite import products --shop <shop_id> --file products.json
# Import orders from JSON file
mailerlite import orders --shop <shop_id> --file orders.jsonGenerate a completion script for your shell:
# Bash
source <(mailerlite completion bash)
# Zsh
mailerlite completion zsh > "${fpath[1]}/_mailerlite"
# Fish
mailerlite completion fish | source
# PowerShell
mailerlite completion powershell | Out-String | Invoke-ExpressionAdd --json to a command to get raw JSON output. Use it in scripts:
# Pipe to jq
mailerlite subscriber list --json | jq '.[].email'
# Extract an ID
mailerlite group create --name "Test" --json | jq -r '.data.id'See LICENSE for details.