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.
Go CLI for the Mealie recipe manager API: full endpoint coverage, local SQLite mirror, offline search, MCP server, and novel cross-recipe commands (cook-now, plan shopping-list, stats).
星數
3
工具
—
可用率
—
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
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 households create-mealplans-2 - create_random_meal is 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 One
mealie households create-recipeactions - Create One
mealie households create-shopping - Create One
mealie households create-shopping-2 - Create One
mealie households create-shopping-3 - Create Many
mealie households create-webhooks - Create One
mealie households delete - Delete One
mealie households delete-events - Delete One
mealie households delete-mealplans - Delete One
mealie households delete-mealplans-2 - Delete One
mealie households delete-recipeactions - Delete One
mealie mealie-auth refresh-token - Use a valid token to get another token
media
Manage media
mealie media get-recipe-asset - Returns a recipe asset
mealie 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 production
mealie 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 production
mealie 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 production
mealie media get-validation-text - Get Validation Text
organizers
Manage organizers
mealie organizers create - Creates a Category in the database
mealie organizers create-tags - Creates a Tag in the database
mealie organizers create-tools - Create One
mealie 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 it
mealie 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 it
mealie organizers delete-tools - Delete One
mealie organizers get-all - Returns a list of available categories in the database
mealie organizers get-all-empty - Returns a list of categories that do not contain any recipes
mealie organizers get-all-tags - Returns a list of available tags in the database
mealie organizers get-all-tools - Get All
mealie organizers get-empty-tags - Returns a list of tags that do not contain any recipes
mealie 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 category
mealie organizers get-one-by-slug-tags - Get One By Slug
mealie organizers get-one-by-slug-tools - Get One By Slug
mealie organizers get-one-tags - Returns a list of recipes associated with the provided tag.
mealie organizers get-one-tools - Get One
mealie organizers update - Updates an existing Tag in the database
mealie organizers update-tags - Updates an existing Tag in the database
mealie recipes create - Takes in a JSON string and loads data into the database as a new entry
mealie recipes create-create - Takes in raw HTML or a https://schema.org/Recipe object as a JSON string and parses it like a URL
mealie 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 archive
mealie 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 SSE
mealie recipes create-timeline - Create One
mealie recipes delete - Deletes a recipe by slug
mealie recipes delete-timeline - Delete One
mealie recipes get-all - Get All
mealie recipes get-all-timeline - Get All
mealie recipes get-exported-data - Get Exported Data
mealie recipes get-exported-data-token - Returns a token to download a file
mealie recipes get-formats-and-templates - Get Recipe Formats And Templates
mealie recipes get-one - Takes in a recipe's slug or id and returns all data for a recipe
mealie recipes get-one-timeline - Get One
mealie recipes get-shared - Get Shared Recipe
mealie recipes get-shared-as-zip - Get a recipe and its original image as a Zip file
mealie recipes parse-url - Takes in a URL and attempts to scrape data and load it into the database
mealie recipes parse-url-bulk - Takes in a URL and attempts to scrape data and load it into the database
mealie recipes parse-url-stream - Takes in a URL and attempts to scrape data and load it into the database,
streaming progress via SSE
mealie recipes patch-many - Patch Many
mealie 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 entry
mealie recipes suggest - Suggest Recipes
mealie recipes test-parse-url - Test Parse Recipe Url
mealie recipes update - Update Many
mealie recipes update-slug - Updates a recipe by existing slug and data.
mealie users create - Create api_token in the Database
mealie users delete - Delete api_token from the Database
mealie users forgot-password - Sends an email with a reset link to the user
mealie users get-logged-in - Get Logged In User
mealie users get-logged-in-favorites - Get Logged In User Favorites
mealie users get-logged-in-rating-for-recipe - Get Logged In User Rating For Recipe
mealie users get-logged-in-ratings - Get Logged In User Ratings
mealie users register-new - Register New User
mealie users reset-password - Resets the user password
mealie users update - Resets the User Password
mealie 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 - --json output to stdout, errors to stderr
Filterable - --select id,name returns only fields you need
Previewable - --dry-run shows the request without sending
Explicit retries - add --idempotent to create retries and --ignore-missing to delete retries when a no-op success is acceptable
Confirmable - --yes for 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-friendly is set
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:
Name
Kind
Required
Description
MEALIE_API_TOKEN
per_call
Yes
Set to your API credential.
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 doctor to 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 list command 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:
Go CLI for the Mealie recipe manager API: full endpoint coverage, local SQLite mirror, offline search, MCP server, and novel cross-recipe commands (cook-now, plan shopping-list, stats).
上次檢查時間:2026-10-28。 Go CLI for the Mealie recipe manager API: full endpoint coverage, local SQLite mirror, offline search, MCP server, and novel cross-recipe commands (cook-now, plan shopping-list, stats).