Skip to main content

monsieur-cuisine-cli

A command-line client for managing recipes in a monsieur-cuisine.com account.

This project is at an early stage. Account sign-in and a read-only profile command are implemented; recipe management commands are planned.

The command tree is built with classyclick, a class-based wrapper around Click.

Install for development

This project uses uv for Python environment and dependency management.

uv sync --dev

Sign in

Start the Lidl OAuth login flow used by the Monsieur Cuisine Android app:

uv run monsieur-cuisine auth login

By default, login opens its own visible Chromium window through Playwright and captures the app's OAuth callback automatically. If Playwright Chromium is missing, the CLI runs python -m playwright install chromium automatically before opening the browser. Complete sign-in and any reCAPTCHA challenge there; the CLI then exchanges the authorization code and performs the app's encrypted API login.

To use your system browser instead, pass the boolean --browser flag:

uv run monsieur-cuisine auth login --browser

After sign-in, copy the final redirect URL beginning with lidl-com.monsieur-cuisine.companion:// and paste it into the terminal prompt. Depending on the browser, you may need to copy the URL from its address bar or redirect/error page. The CLI validates the callback's scheme, path, and OAuth state before exchanging the one-time authorization code.

The API session is stored as session.json beside the active config TOML file (by default ~/.config/monsieur-cuisine/session.json, or under $XDG_CONFIG_HOME). If you pass --config PATH, the session and companion ID are stored beside that file. The session has owner-only file permissions. The global --lang option sets the locale for API requests and Lidl sign-in, and defaults to en-US. The login flow uses that locale for the OAuth Language and CountryCode parameters. For example: uv run monsieur-cuisine --lang de-DE auth login.

Check or clear the saved session:

uv run monsieur-cuisine auth status
uv run monsieur-cuisine auth renew
uv run monsieur-cuisine profile
uv run monsieur-cuisine auth logout

auth status reports whether a session file is saved, the account name when available, and the OAuth token expiry in your local timezone. auth renew exchanges the saved OAuth refresh token and updates the OAuth access token, expiry, and rotated refresh token in the session file.

Call an API endpoint

Use api to call a path on the Monsieur Cuisine API with the saved app session. The command adds the app's standard request headers and bearer token, then prints the JSON response:

uv run monsieur-cuisine api api/v2/recipes/238467
uv run monsieur-cuisine api api/v1/my-recipes/page/1/size/20
uv run monsieur-cuisine api api/v1/custom-endpoint --method POST --data '{"name":"My recipe"}'

Supported methods are GET, POST, PUT, PATCH, and DELETE. Pass an optional JSON request body with --data. API calls default to Accept-Language: en-US, matching the mobile app's default API locale. Set the global option before the command to override it, for example uv run monsieur-cuisine --lang pt-PT api api/v1/users. Recipe URL lookups use the viewer language discovered from the recipe page. Supply a relative API path rather than a URL; the command always targets mc-api.tecpal.com so the saved bearer token is not sent to another host. Endpoints requiring the app's encrypted request/response format are not automatically encrypted or decrypted by this command. Write methods call the account API directly and can change account data.

Use recipes list to list recipes in your account, and recipes get to fetch one by ID. The list command defaults to page 1 with 20 recipes; use --page and --size to change the pagination:

uv run monsieur-cuisine recipes list
uv run monsieur-cuisine recipes list --page 2 --size 50
uv run monsieur-cuisine recipes get 238467

These use the authenticated mobile API routes GET api/v1/my-recipes/page/{page}/size/{size} and GET api/v1/my-recipes/{id}, with Accept-Language: en-US by default. Use the global --lang option to select another locale.

Use recipes url to resolve a public recipe page URL. It extracts recipeId and the viewer locale from the page, calls the public recipe detail endpoint, and returns the ID, locale, and API response:

uv run monsieur-cuisine recipes url 'https://www.monsieur-cuisine.com/pt-pt/recipe/pasta-de-abacate-com-salmao-2'

Configuration

The CLI reads TOML settings from ~/.config/monsieur-cuisine/config.toml (or the platform's user config directory). On first run it creates this file from the packaged default config. Login defaults can be edited with:

uv run monsieur-cuisine config
uv run monsieur-cuisine config --edit

The default config stores the global locale as root-level lang = "en-US" and the browser setting under [auth.login]. Command-line options override config values. Use the root --config PATH option to select a different file, or --env NAME to merge a named [env.NAME] section.

Planned capabilities

  • Add a recipe to the account.
  • Update an existing recipe.
  • Remove a recipe from the account.

Research notes

The Android app is used as a reference for the undocumented account and recipe API. Monsieur Cuisine App 1.4.2 was downloaded from the APKMirror Monsieur Cuisine App listing and decoded to smali with fopina/docker-dedroid. The APK and generated decompilation are kept in the local, gitignored .apk-analysis/ directory; download the APK from APKMirror yourself before running the command below.

mkdir -p .apk-analysis
# Save the APKMirror download as .apk-analysis/monsieur-cuisine-1.4.2.apk
docker run --rm -v "$PWD/.apk-analysis:/work" fopina/dedroid apktool d \
  /work/monsieur-cuisine-1.4.2.apk -o /work/decompiled -f

The decoded manifest registers lidl-com.monsieur-cuisine.companion://login/prod as the app's login callback. The app uses https://accounts.lidl.com for sign-in and calls https://mc-api.tecpal.com directly for its API, authenticating account-specific requests with a bearer token. Decompiled Retrofit interfaces include public recipe routes such as GET api/v2/recipes/page/{page}/size/{size}, GET api/v2/recipes/{id}, and GET api/v1/recipes/search/page/{page}/size/{size}. They also include authenticated account routes GET api/v1/my-recipes/page/{page}/size/{size} and GET api/v1/my-recipes/{id}. No mobile API method for updating recipe content has been identified so far; the RecipeUpdateModel type is used as the response model for the recipe detail GET route.

The website uses a same-origin POST https://www.monsieur-cuisine.com/proxy-api wrapper. Its JSON body contains an upstream endpoint, lang, and HTTP method, with an optional payload; for example, a profile request uses {"endpoint":"api/v1/users","lang":"pt-PT","method":"GET"}. The website authenticates these requests through its browser session cookies, rather than the mobile app's bearer-token request flow. The proxy forwards requests to the same API routes used by the app, so endpoint methods and payloads discovered through either client are likely useful for the other as well. The transport, authentication, and required headers still differ, and this cross-client compatibility has not been verified for every route. These observations come from app version 1.4.2 and a website request example, not a supported public API contract.

Disclaimer

This is an unofficial community project and is not affiliated with or endorsed by monsieur-cuisine.com, Lidl, or their operators. Use it only with an account you are authorized to access, and follow the services' terms and applicable policies.

Metadata

Release files for monsieur-cuisine-cli 0.0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for monsieur-cuisine-cli 0.0.2
File Size Uploaded Provenance Actions
monsieur_cuisine_cli-0.0.2.tar.gz 18.8 kB Without provenance Details for monsieur_cuisine_cli-0.0.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for monsieur-cuisine-cli 0.0.2
File Interpreter ABI Platform Actions
monsieur_cuisine_cli-0.0.2-py3-none-any.whl Python 3 none any Details for monsieur_cuisine_cli-0.0.2-py3-none-any.whl

Total release size: 34.5 kB

Release files / monsieur_cuisine_cli-0.0.2.tar.gz

Download URL monsieur_cuisine_cli-0.0.2.tar.gz
Size 18.8 kB
Tags Source
SHA-256 checksum
How to use checksums
15fd2f885ad1cbb62e29fec945fe962dc19933484c4353c869ad35312e67d002
BLAKE2b-256 checksum
How to use checksums
f4b4a1b9278a8a4985eb9a5d46e64e9d7002a1b0fd6a639acec62bd4ddb864e0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.10.22

Release files / monsieur_cuisine_cli-0.0.2-py3-none-any.whl

Download URL monsieur_cuisine_cli-0.0.2-py3-none-any.whl
Size 15.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e6c1a4e29c46eb19dd3259ae5ba89adec2e6c9ce1fecc482ce7a443c7cbd53a5
BLAKE2b-256 checksum
How to use checksums
ffcf8687c35f3f3b00ffe9b54cf7475cacffe7a6fe7a44252870eacbe10a9e1b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.10.22

Security for monsieur-cuisine-cli 0.0.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page