Mealie CLI
Every Mealie API endpoint, plus a local SQLite mirror that answers cross-recipe questions no other Mealie tool can: what you can cook now, this week's plan as one shopping list, and library-wide stats.
mealie wraps the full Mealie REST API as typed, agent-native commands, then syncs your recipes, meal plans, and shopping data into a local store. That local mirror powers offline full-text search and novel commands like cook-now, plan shopping-list, and stats that the API alone can't answer.
Install
Requires Go 1.26.4 or newer.
Go install
go install github.com/jez500/mealie-cli/cmd/mealie@latest
# optional MCP server binary:
go install github.com/jez500/mealie-cli/cmd/mealie-mcp@latest
Pre-built binary
Download a pre-built archive for your platform from the latest release. Each release ships darwin, linux, and windows builds for amd64 and arm64. On macOS, clear the Gatekeeper quarantine: xattr -d com.apple.quarantine mealie. On Unix, mark it executable: chmod +x mealie.
Build from source
git clone https://github.com/jez500/mealie-cli.git
cd mealie-cli
make build # produces ./bin/mealie
make build-all # also builds ./bin/mealie-mcp
Use with Claude Desktop (MCP)
The mealie-mcp binary mirrors every CLI command as an MCP tool. Install it and add it to your Claude Desktop config (~/Library/Application Support/Claude/claude_desktop_config.json):
go install github.com/jez500/mealie-cli/cmd/mealie-mcp@latest
{
"mcpServers": {
"mealie": {
"command": "mealie-mcp",
"env": {
"MEALIE_BASE_URL": "https://recipes.example.com",
"MEALIE_API_TOKEN": "<your-token>"
}
}
}
}
Authentication
Create a long-lived API token in Mealie under Profile -> API Tokens, then set MEALIE_BASE_URL (your Mealie origin, e.g. https://recipes.example.com) and MEALIE_API_TOKEN. The CLI sends it as an Authorization: Bearer header.
Quick Start
# verify the CLI is wired before hitting the API
mealie doctor --dry-run
# mirror recipes, plans, and organizers into the local store
mealie sync
# instant offline full-text search over synced recipes
mealie search "soup"
# rank recipes by ingredients you already have
mealie cook-now --have eggs --have flour
# one consolidated shopping list for the week's plan
mealie plan shopping-list --days 7
Unique Features
These capabilities aren't available in any other tool for this API.
Local state that compounds
-
cook-now— Rank your synced recipes by how much of their ingredient list you already have on hand.Reach for this when the user asks what they can cook from what they have, not for plain recipe search.
mealie cook-now --have eggs --have flour --have butter --agent -
plan week— Show the upcoming week of planned meals from the local mirror, including empty days.Use for an at-a-glance week view; the raw mealplans endpoint returns an unordered flat list.
mealie plan week --days 7 --agent -
plan shopping-list— Merge and dedupe ingredients across every recipe planned in a date window into one shopping list.Use to turn this week's plan into a single shopping run instead of one list per recipe.
mealie plan shopping-list --days 7 --agent
Insight over the whole library
-
stats— Counts, top tags/categories/foods, average rating, and missing-metadata coverage across your whole library.Use to summarize a recipe library at a glance before planning or cleanup.
mealie stats --agent -
untagged— Find recipes missing a category, tag, or image so you can tidy your library.Use for library cleanup; pair with bulk tag/categorize to fix gaps.
mealie untagged --missing tag --agent
Recipes
Import a recipe from a URL
mealie recipes parse-url --url https://example.com/best-brownies
Delegates to Mealie's built-in scraper and stores the parsed recipe.
Find recipes you can cook tonight
mealie cook-now --have chicken --have rice --have onion --json
Ranks synced recipes by how much of their ingredient list you already have.
Turn this week's plan into one shopping list
mealie plan shopping-list --days 7 --json
Merges and dedupes ingredients across every planned recipe.
Trim a verbose recipe payload for an agent
mealie recipes list --json --select items.name,items.slug,items.tags.name
Mealie recipe objects are large; --select keeps only the fields the agent needs.
Audit library metadata gaps
mealie untagged --missing tag --json
Lists recipes with no tags so you can bulk-fix them.
Usage
Run mealie --help for the full command reference and flag list.
Commands
admin
Manage admin
mealie admin check-app-config- Check App Configmealie admin check-email-config- Get general application informationmealie admin clean-images- Purges all the images from the filesystem that aren't .webpmealie admin clean-recipe-folders- Deletes all the recipe folders that don't have names that are valid UUIDsmealie admin clean-temp- Clean Tempmealie admin create- Create Onemealie admin create-groups- Create Onemealie admin create-groups-2- Create Ai Providermealie admin create-households- Create Onemealie admin create-users- Create Onemealie admin debug-openai- Debug Openaimealie admin delete- Delete Onemealie admin delete-groups- Delete Onemealie admin delete-groups-2- Delete Ai Providermealie admin delete-households- Delete Onemealie admin delete-users- Delete Onemealie admin generate-token- Generates a reset token and returns it. This is an authenticated endpointmealie admin get-ai-provider- Get Ai Providermealie admin get-all- Get Allmealie admin get-all-groups- Get Allmealie admin get-all-households- Get Allmealie admin get-all-users- Get Allmealie admin get-app-info- Get general application informationmealie admin get-app-statistics- Get App Statisticsmealie admin get-maintenance-summary- Get the maintenance summarymealie admin get-one- Returns a token to download a filemealie admin get-one-groups- Get Onemealie admin get-one-households- Get Onemealie admin get-one-users- Get Onemealie admin get-storage-details- Get Storage Detailsmealie admin import-one- Import Onemealie admin send-test-email- Send Test Emailmealie admin unlock-users- Unlock Usersmealie admin update- Update Onemealie admin update-groups- Update Ai Providermealie admin update-households- Update Onemealie admin update-users- Update Onemealie admin upload-one- Upload a .zip File to later be imported into Mealie
app
Manage app
mealie app get-info- Get general application informationmealie app get-startup-info- returns helpful startup informationmealie app get-theme- Get's the current theme settings
comments
Manage comments
mealie comments create- Create Onemealie comments delete- Delete Onemealie comments get-all- Get Allmealie comments get-one- Get Onemealie comments update- Update One
explore
Manage explore
mealie explore get-all- Get Allmealie explore get-all-groups- Get Allmealie explore get-all-groups-2- Get Allmealie explore get-all-groups-3- Get Allmealie explore get-all-groups-4- Get Allmealie explore get-all-groups-5- Get Allmealie explore get-all-groups-6- Get Allmealie explore get-household- Get Householdmealie explore get-one- Get Onemealie explore get-one-groups- Get Onemealie explore get-one-groups-2- Get Onemealie explore get-one-groups-3- Get Onemealie explore get-one-groups-4- Get Onemealie explore get-recipe- Get Recipemealie explore suggest-recipes- Suggest Recipes
foods
Manage foods
mealie foods create- Create Onemealie foods delete- Delete Onemealie foods get-all- Get Allmealie foods get-one- Get Onemealie foods merge-one- Merge Onemealie foods update- Update One
groups
Manage groups
mealie groups create- Create Onemealie groups create-aiproviders- Create Ai Providermealie groups delete- Delete Onemealie groups delete-aiproviders- Delete Ai Providermealie groups delete-reports- Delete Onemealie groups get-ai-provider- Get Ai Providermealie groups get-ai-provider-settings- Get Ai Provider Settingsmealie groups get-all- Get Allmealie groups get-all-households- Get All Householdsmealie groups get-all-reports- Get Allmealie groups get-logged-in-user- Returns the Group Data for the Current Usermealie groups get-member- Returns a single user belonging to the current groupmealie groups get-members- Returns all users belonging to the current groupmealie groups get-one- Get Onemealie groups get-one-household- Get One Householdmealie groups get-one-reports- Get Onemealie groups get-preferences- Get Group Preferencesmealie groups get-storage- Get Storagemealie groups seed-foods- Seed Foodsmealie groups seed-labels- Seed Labelsmealie groups seed-units- Seed Unitsmealie groups start-data-migration- Start Data Migrationmealie groups update- Update Group Preferencesmealie groups update-aiproviders- Update Ai Provider Settingsmealie groups update-aiproviders-2- Update Ai Providermealie groups update-labels- Update One
households
Manage households
mealie households add-recipe-ingredients-to-list- Add Recipe Ingredients To Listmealie households add-single-recipe-ingredients-to-list- Add Single Recipe Ingredients To Listmealie households create- Create Onemealie households create-events- Create Onemealie households create-invitations- Create Invite Tokenmealie households create-mealplans- Create Onemealie households create-mealplans-2-create_random_mealis a route that provides the randomized functionality for mealplaners. It operates by following the rules set out in the household's mealplan settings. If no settings are set, it will return any random meal.
Refer to the mealplan settings routes for more information on how rules can be applied to the random meal selector.
mealie households create-mealplans-3- Create Onemealie households create-recipeactions- Create Onemealie households create-shopping- Create Onemealie households create-shopping-2- Create Onemealie households create-shopping-3- Create Manymealie households create-webhooks- Create Onemealie households delete- Delete Onemealie households delete-events- Delete Onemealie households delete-mealplans- Delete Onemealie households delete-mealplans-2- Delete Onemealie households delete-recipeactions- Delete Onemealie households delete-shopping- Delete Manymealie households delete-shopping-2- Delete Onemealie households delete-shopping-3- Delete Onemealie households delete-webhooks- Delete Onemealie households email-invitation- Email Invitationmealie households get-all- Get Allmealie households get-all-events- Get Allmealie households get-all-mealplans- Get Allmealie households get-all-mealplans-2- Get Allmealie households get-all-recipeactions- Get Allmealie households get-all-shopping- Get Allmealie households get-all-shopping-2- Get Allmealie households get-all-webhooks- Get Allmealie households get-invite-tokens- Get Invite Tokensmealie households get-logged-in-user- Returns the Household Data for the Current Usermealie households get-members- Returns all users belonging to the current householdmealie households get-one- Get Onemealie households get-one-events- Get Onemealie households get-one-mealplans- Get Onemealie households get-one-mealplans-2- Get Onemealie households get-one-recipeactions- Get Onemealie households get-one-shopping- Get Onemealie households get-one-shopping-2- Get Onemealie households get-one-webhooks- Get Onemealie households get-preferences- Get Household Preferencesmealie households get-recipe- Returns recipe data for the current householdmealie households get-statistics- Get Statisticsmealie households get-todays-meals- Get Todays Mealsmealie households remove-recipe-ingredients-from-list- Remove Recipe Ingredients From Listmealie households rerun-webhooks- Manually re-fires all previously scheduled webhooks for todaymealie households set-member-permissions- Set Member Permissionsmealie households test-notification- Test Notificationmealie households test-one- Test Onemealie households trigger-action- Trigger Actionmealie households update- Update Manymealie households update-cookbooks- Update Onemealie households update-events- Update Onemealie households update-mealplans- Update Onemealie households update-mealplans-2- Update Onemealie households update-preferences- Update Household Preferencesmealie households update-recipeactions- Update Onemealie households update-shopping- Update Manymealie households update-shopping-2- Update Onemealie households update-shopping-3- Update Onemealie households update-shopping-4- Update Label Settingsmealie households update-webhooks- Update One
mealie-auth
Manage mealie auth
mealie mealie-auth get-token- Get Tokenmealie mealie-auth logout- Logoutmealie mealie-auth oauth-callback- Oauth Callbackmealie mealie-auth oauth-login- Oauth Loginmealie mealie-auth refresh-token- Use a valid token to get another token
media
Manage media
mealie media get-recipe-asset- Returns a recipe assetmealie media get-recipe-img- Takes in a recipe id, returns the static image. This route is proxied in the docker image and should not hit the API in productionmealie media get-recipe-timeline-event-img- Takes in a recipe id and event timeline id, returns the static image. This route is proxied in the docker image and should not hit the API in productionmealie media get-user-image- Takes in a recipe slug, returns the static image. This route is proxied in the docker image and should not hit the API in productionmealie media get-validation-text- Get Validation Text
organizers
Manage organizers
mealie organizers create- Creates a Category in the databasemealie organizers create-tags- Creates a Tag in the databasemealie organizers create-tools- Create Onemealie organizers delete- Removes a recipe category from the database. Deleting a category does not impact a recipe. The category will be removed from any recipes that contain itmealie organizers delete-tags- Removes a recipe tag from the database. Deleting a tag does not impact a recipe. The tag will be removed from any recipes that contain itmealie organizers delete-tools- Delete Onemealie organizers get-all- Returns a list of available categories in the databasemealie organizers get-all-empty- Returns a list of categories that do not contain any recipesmealie organizers get-all-tags- Returns a list of available tags in the databasemealie organizers get-all-tools- Get Allmealie organizers get-empty-tags- Returns a list of tags that do not contain any recipesmealie organizers get-one- Returns a list of recipes associated with the provided category.mealie organizers get-one-by-slug- Returns a category object with the associated recieps relating to the categorymealie organizers get-one-by-slug-tags- Get One By Slugmealie organizers get-one-by-slug-tools- Get One By Slugmealie organizers get-one-tags- Returns a list of recipes associated with the provided tag.mealie organizers get-one-tools- Get Onemealie organizers update- Updates an existing Tag in the databasemealie organizers update-tags- Updates an existing Tag in the databasemealie organizers update-tools- Update One
parser
Manage parser
mealie parser parse-ingredient- Parse Ingredientmealie parser parse-ingredients- Parse Ingredients
recipes
Manage recipes
mealie recipes bulk-categorize- Bulk Categorize Recipesmealie recipes bulk-delete- Bulk Delete Recipesmealie recipes bulk-export- Bulk Export Recipesmealie recipes bulk-settings- Bulk Settings Recipesmealie recipes bulk-tag- Bulk Tag Recipesmealie recipes create- Takes in a JSON string and loads data into the database as a new entrymealie recipes create-create- Takes in raw HTML or a https://schema.org/Recipe object as a JSON string and parses it like a URLmealie recipes create-create-2- Create a recipe from an image using OpenAI. Optionally specify a language for it to translate the recipe to.mealie recipes create-create-3- Create recipe from archivemealie recipes create-create-4- Takes in raw HTML or a https://schema.org/Recipe object as a JSON string and parses it like a URL, streaming progress via SSEmealie recipes create-timeline- Create Onemealie recipes delete- Deletes a recipe by slugmealie recipes delete-timeline- Delete Onemealie recipes get-all- Get Allmealie recipes get-all-timeline- Get Allmealie recipes get-exported-data- Get Exported Datamealie recipes get-exported-data-token- Returns a token to download a filemealie recipes get-formats-and-templates- Get Recipe Formats And Templatesmealie recipes get-one- Takes in a recipe's slug or id and returns all data for a recipemealie recipes get-one-timeline- Get Onemealie recipes get-shared- Get Shared Recipemealie recipes get-shared-as-zip- Get a recipe and its original image as a Zip filemealie recipes parse-url- Takes in a URL and attempts to scrape data and load it into the databasemealie recipes parse-url-bulk- Takes in a URL and attempts to scrape data and load it into the databasemealie recipes parse-url-stream- Takes in a URL and attempts to scrape data and load it into the database, streaming progress via SSEmealie recipes patch-many- Patch Manymealie recipes patch-one- Updates a recipe by existing slug and data.mealie recipes purge-export-data- Remove all exports data, including items on disk without database entrymealie recipes suggest- Suggest Recipesmealie recipes test-parse-url- Test Parse Recipe Urlmealie recipes update- Update Manymealie recipes update-slug- Updates a recipe by existing slug and data.mealie recipes update-timeline- Update Onemealie recipes update-timeline-2- Update Event Image
shared
Manage shared
mealie shared create- Create Onemealie shared delete- Delete Onemealie shared get-all- Get Allmealie shared get-one- Get One
units
Manage units
mealie units create- Create Onemealie units delete- Delete Onemealie units get-all- Get Allmealie units get-one- Get Onemealie units merge-one- Merge Onemealie units update- Update One
users
Manage users
mealie users create- Create api_token in the Databasemealie users delete- Delete api_token from the Databasemealie users forgot-password- Sends an email with a reset link to the usermealie users get-logged-in- Get Logged In Usermealie users get-logged-in-favorites- Get Logged In User Favoritesmealie users get-logged-in-rating-for-recipe- Get Logged In User Rating For Recipemealie users get-logged-in-ratings- Get Logged In User Ratingsmealie users register-new- Register New Usermealie users reset-password- Resets the user passwordmealie users update- Resets the User Passwordmealie users update-itemid- Update User
utils
Manage utils
mealie utils- Uses a file token obtained by an active user to retrieve a file from the operating system.
Output Formats
# Human-readable table (default in terminal, JSON when piped)
mealie admin check-app-config
# JSON for scripting and agents
mealie admin check-app-config --json
# Filter to specific fields
mealie admin check-app-config --json --select id,name,status
# Dry run — show the request without sending
mealie admin check-app-config --dry-run
# Agent mode — JSON + compact + no prompts in one flag
mealie admin check-app-config --agent
Agent Usage
This CLI is designed for AI agent consumption:
- Non-interactive - never prompts, every input is a flag
- Pipeable -
--jsonoutput to stdout, errors to stderr - Filterable -
--select id,namereturns only fields you need - Previewable -
--dry-runshows the request without sending - Explicit retries - add
--idempotentto create retries and--ignore-missingto delete retries when a no-op success is acceptable - Confirmable -
--yesfor explicit confirmation of destructive actions - Piped input - write commands can accept structured input when their help lists
--stdin - Offline-friendly - sync/search commands can use the local SQLite store when available
- Agent-safe by default - no colors or formatting unless
--human-friendlyis set
Exit codes: 0 success, 2 usage error, 3 not found, 4 auth error, 5 API error, 7 rate limited, 10 config error.
Health Check
mealie doctor
Verifies configuration, credentials, and connectivity to the API.
Configuration
Config file: ~/.config/mealie/config.toml
Static request headers can be configured under headers; per-command header overrides take precedence.
Environment variables:
agentcookie (optional)
If you use agentcookie to sync secrets across machines, this CLI auto-adopts agentcookie-managed credentials with no extra setup. When the daemon writes to this CLI's config, mealie doctor reports agentcookie: detected and auth-status labels the source as agentcookie. Skip this section if you don't use agentcookie - the CLI works the same as any other.
Troubleshooting
Authentication errors (exit code 4)
- Run
mealie doctorto check credentials - Verify the environment variable is set:
echo $MEALIE_API_TOKENNot found errors (exit code 3) - Check the resource ID is correct
- Run the
listcommand to see available items
API-specific
- 401 Unauthorized on every call — Confirm MEALIE_API_TOKEN is a long-lived token from Profile -> API Tokens and MEALIE_BASE_URL has no trailing /api.
- cook-now or stats returns nothing — Run mealie sync first; transcendence commands read the local mirror.
- connection refused / DNS error — Check MEALIE_BASE_URL points at the reachable Mealie origin; run mealie doctor.
Sources & Inspiration
This CLI was built by studying these projects and resources:
- rldiao/mealie-mcp-server — Python
- mdlopresti/mealie-mcp — Python
- counterbeing/mealie-mcp-ts — TypeScript
- GrandMoff100/MealieAPI — Python
Generated by CLI Printing Press