Skip to content
Als Markdown

CLI

mo is Mottainai's command-line interface. It is built for the broader anti-waste workflow: less manual repetition, less context switching, and faster execution.

Use it for:

  • Fast terminal workflows
  • Script and cron automation
  • Agent-based integrations

Install

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

If /usr/local/bin is not writable, installer falls back to ~/.local/bin.

Install page: mottainai.app/cli

Update

bash
mo update

mo update updates in place when the current install location is writable. If not, it installs to ~/.local/bin. You can force user-space install with:

bash
mo update --user

Login

bash
mo auth login

This opens your browser for OAuth and stores credentials locally.

For headless or script use, pass an API token directly (create one in Settings):

bash
mo auth login --token mot_...

You can also set MOTTAINAI_TOKEN as an environment variable to skip login entirely:

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

Common commands

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

Script-friendly output

Many commands support --json:

bash
# All fields
mo container list --type storage --json

# Select specific fields
mo container list --type storage --json=id,name

# jq query on wrapped responses
mo search milk --json='.results[] | {name, type}'

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

Accepts field names (id,name) or full jq expressions for filtering and reshaping.

bash
mo search milk
mo search "type:contact john"
mo search "in:storage category:dairy"
mo search "almond milk" --json

Supports the same query syntax as the web app: AND/OR, phrases, prefix wildcards, negation, and qualifiers (in:, type:, category:, location:, label:, expires:, is:archived, sort:, limit:).

SharedPay

bash
# Containers
mo sharedpay list
mo sharedpay create --name "Summer Trip" --currency EUR
mo sharedpay get SHAREDPAY_ID
mo sharedpay update SHAREDPAY_ID --name "Summer Trip 2026"
mo sharedpay delete SHAREDPAY_ID --yes

# Expenses (amounts in cents: 8000 = €80.00)
mo sharedpay expense list SHAREDPAY_ID [--kind expense] [--currency EUR]
mo sharedpay expense create SHAREDPAY_ID --title "Dinner" --amount 8000 [--payer USER_ID]
mo sharedpay expense delete EXPENSE_ID --yes

# Balances
mo sharedpay balance SHAREDPAY_ID

# Phantom participants (non-users)
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."

# Members and groups (same as other container types)
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

Recipe Collections

bash
# List recipes
mo recipe list --container COLLECTION_ID

# Get recipe (with optional scaling)
mo recipe get RECIPE_ID
mo recipe get RECIPE_ID --servings 8

# Create recipes
mo recipe create --container COLLECTION_ID --title "Pasta Carbonara"
mo recipe create --container COLLECTION_ID --from-url "https://example.com/recipe"
mo recipe create --container COLLECTION_ID --from-text "2 cups flour, 1 egg..."

# Update and delete
mo recipe update RECIPE_ID --title "New Name" --difficulty easy
mo recipe delete RECIPE_ID --yes

# Scale (read-only)
mo recipe scale RECIPE_ID --servings 6

# Shopping list integration
mo recipe shopping RECIPE_ID --to SHOPPING_ID --servings 4 --exclude-in-stock

# Log a cook
mo recipe cooked RECIPE_ID --note "Perfect"

# AI editing
mo recipe ai-edit RECIPE_ID --instruction "make it vegan" --apply

# AI suggestions
mo recipe suggest COLLECTION_ID [--storage-ids STORAGE_ID]

# Publishing
mo recipe publish RECIPE_ID --allow-fork
mo recipe unpublish RECIPE_ID --yes
mo recipe fork TOKEN --container COLLECTION_ID

# Export and import
mo recipe export --container COLLECTION_ID --output recipes.json
mo recipe import --container COLLECTION_ID --file recipes.json

Notebooks

bash
# Notebooks
mo notebook list
mo notebook create "My Notes" [--color "#3b82f6"]
mo notebook get NOTEBOOK_ID
mo notebook update NOTEBOOK_ID --name "Updated Notes"
mo notebook delete NOTEBOOK_ID --yes

# Pages
mo notebook page list --container NOTEBOOK_ID
mo notebook page get PAGE_ID --container NOTEBOOK_ID
mo notebook page create --container NOTEBOOK_ID --title "New Page" [--content "# Hello"] [--parent PARENT_PAGE_ID]
mo notebook page update PAGE_ID --container NOTEBOOK_ID --title "Updated" [--content "New content"]
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

AI from CLI

bash
mo ai parse STORAGE_ID --text "2x yogurt, 1x rice"

This adds multiple items in one step.