Skip to content
Als Markdown

CLI

mo ist die Kommandozeilenoberfläche für Mottainai. Sie unterstützt den größeren Anti-Waste-Ansatz: weniger repetitive Handarbeit, weniger Kontextwechsel und schnellere Abläufe.

Sie ist ideal für:

  • schnelle Workflows im Terminal
  • Automationen mit Skripten und Cron
  • Integration in Agenten-Setups

Installation

bash
curl -sSfL mottainai.app/cli/install.sh | sh

Wenn /usr/local/bin nicht beschreibbar ist, nutzt der Installer automatisch ~/.local/bin.

Installationsseite: mottainai.app/cli

Update

bash
mo update

mo update aktualisiert direkt am aktuellen Installationsort, falls dieser beschreibbar ist. Sonst wird nach ~/.local/bin installiert. Mit --user kannst du das explizit erzwingen:

bash
mo update --user

Login

bash
mo auth login

Das öffnet den Browser für OAuth und speichert deinen Zugang lokal.

Für headless- oder Skript-Betrieb kannst du einen API-Token direkt übergeben (erstellt in den Einstellungen):

bash
mo auth login --token mot_...

Alternativ setzt du MOTTAINAI_TOKEN als Umgebungsvariable und brauchst gar keinen Login-Schritt:

bash
export MOTTAINAI_TOKEN=mot_...
mo container list --type storage

Häufige Befehle

bash
mo container list --type storage
mo item list STORAGE_ID
mo shopping list SHOPPING_CONTAINER_ID
mo board list
mo calendar list
mo notebook list
mo token list

Für Skripte

Viele Befehle unterstützen --json:

bash
# Alle Felder
mo container list --type storage --json

# Bestimmte Felder auswählen
mo container list --type storage --json=id,name

# jq-Abfrage für verschachtelte Antworten
mo search Milch --json='.results[] | {name, type}'

# jq-Filter
mo item list ID --json='[.[] | select(.quantity > 0) | {title, quantity}]'

Akzeptiert Feldnamen (id,name) oder jq-Ausdrücke zum Filtern und Umformen.

Suche

bash
mo search Milch
mo search "type:contact Max"
mo search "in:storage category:dairy"
mo search "Mandelmilch" --json

Unterstützt dieselbe Query-Syntax wie die Web-App: AND/OR, Phrasen, Prefix-Wildcards, Negation und Qualifier (in:, type:, category:, location:, label:, expires:, is:archived, sort:, limit:).

Geteilte Ausgaben

bash
# Gruppen
mo sharedpay list
mo sharedpay create --name "Sommerreise" --currency EUR
mo sharedpay get SHAREDPAY_ID
mo sharedpay update SHAREDPAY_ID --name "Sommerreise 2026"
mo sharedpay delete SHAREDPAY_ID --yes

# Ausgaben (Beträge in Cent: 8000 = 80,00 €)
mo sharedpay expense list SHAREDPAY_ID [--kind expense] [--currency EUR]
mo sharedpay expense create SHAREDPAY_ID --title "Abendessen" --amount 8000 [--payer USER_ID]
mo sharedpay expense delete EXPENSE_ID --yes

# Salden
mo sharedpay balance SHAREDPAY_ID

# Phantomteilnehmer (Personen ohne Konto)
mo sharedpay phantom list SHAREDPAY_ID
mo sharedpay phantom create SHAREDPAY_ID --name "Alice"
mo sharedpay phantom rename SHAREDPAY_ID PHANTOM_ID --name "Alice B."

# Mitglieder und Gruppen (wie bei anderen Containertypen)
mo sharedpay member list SHAREDPAY_ID
mo sharedpay member add SHAREDPAY_ID --email user@example.com
mo sharedpay group list SHAREDPAY_ID
mo sharedpay group link SHAREDPAY_ID --group-id GROUP_ID

Rezeptsammlungen

bash
# Rezepte auflisten
mo recipe list --container COLLECTION_ID

# Rezept abrufen (mit optionaler Skalierung)
mo recipe get RECIPE_ID
mo recipe get RECIPE_ID --servings 8

# Rezepte erstellen
mo recipe create --container COLLECTION_ID --title "Pasta Carbonara"
mo recipe create --container COLLECTION_ID --from-url "https://example.com/rezept"
mo recipe create --container COLLECTION_ID --from-text "2 Tassen Mehl, 1 Ei..."

# Aktualisieren und löschen
mo recipe update RECIPE_ID --title "Neuer Name" --difficulty easy
mo recipe delete RECIPE_ID --yes

# Skalieren (nur lesend)
mo recipe scale RECIPE_ID --servings 6

# Zur Einkaufsliste hinzufügen
mo recipe shopping RECIPE_ID --to SHOPPING_ID --servings 4 --exclude-in-stock

# Kochen protokollieren
mo recipe cooked RECIPE_ID --note "Perfekt"

# KI-Bearbeitung
mo recipe ai-edit RECIPE_ID --instruction "mach es vegan" --apply

# KI-Vorschläge
mo recipe suggest COLLECTION_ID [--storage-ids STORAGE_ID]

# Veröffentlichen
mo recipe publish RECIPE_ID --allow-fork
mo recipe unpublish RECIPE_ID --yes
mo recipe fork TOKEN --container COLLECTION_ID

# Exportieren und importieren
mo recipe export --container COLLECTION_ID --output recipes.json
mo recipe import --container COLLECTION_ID --file recipes.json

Notizbücher

bash
# Notizbücher
mo notebook list
mo notebook create "Meine Notizen" [--color "#3b82f6"]
mo notebook get NOTEBOOK_ID
mo notebook update NOTEBOOK_ID --name "Aktualisierte Notizen"
mo notebook delete NOTEBOOK_ID --yes

# Seiten
mo notebook page list --container NOTEBOOK_ID
mo notebook page get PAGE_ID --container NOTEBOOK_ID
mo notebook page create --container NOTEBOOK_ID --title "Neue Seite" [--content "# Hallo"] [--parent PARENT_PAGE_ID]
mo notebook page update PAGE_ID --container NOTEBOOK_ID --title "Aktualisiert" [--content "Neuer Inhalt"]
mo notebook page delete PAGE_ID --container NOTEBOOK_ID --yes
mo notebook page move PAGE_ID --container NOTEBOOK_ID [--parent NEW_PARENT_ID] [--position 0]

Webhooks

bash
mo webhooks list
mo webhooks create --url "https://example.com/hook" [--events item.created,item.updated] [--containers ID1,ID2]
mo webhooks get WEBHOOK_ID
mo webhooks update WEBHOOK_ID --url "https://example.com/new-hook"
mo webhooks delete WEBHOOK_ID --yes
mo webhooks test WEBHOOK_ID
mo webhooks rotate-secret WEBHOOK_ID
mo webhooks deliveries WEBHOOK_ID
mo webhooks retry WEBHOOK_ID DELIVERY_ID
mo webhooks enable WEBHOOK_ID

KI-Funktionen per CLI

bash
mo ai parse STORAGE_ID --text "2x Joghurt, 1x Reis"

Damit kannst du mehrere Artikel in einem Schritt hinzufügen.