131 lines
3.0 KiB
Markdown
131 lines
3.0 KiB
Markdown
---
|
|
name: ourgroceries
|
|
description: Manage OurGroceries shopping lists. Use when Steve wants to add, view, cross off, or remove items from his OurGroceries shopping lists. Also use when Steve mentions groceries, shopping list, or needs to track items to buy.
|
|
---
|
|
|
|
# OurGroceries Skill
|
|
|
|
Manage Steve's OurGroceries shopping lists via the `ourgroceries` Python package.
|
|
|
|
## Setup
|
|
|
|
**Credentials stored in:** `~/.config/ourgroceries/credentials.conf` (mode 600)
|
|
|
|
File format:
|
|
```
|
|
username=steve@myfamilyemail.co.uk
|
|
password=A98538
|
|
```
|
|
|
|
## Core Operations
|
|
|
|
### List All Lists
|
|
```python
|
|
python3 -c "
|
|
import asyncio
|
|
from ourgroceries import OurGroceries
|
|
|
|
async def main():
|
|
og = OurGroceries('USERNAME', 'PASSWORD')
|
|
await og.login()
|
|
lists = await og.get_my_lists()
|
|
for l in lists.get('lists', []):
|
|
print(f\"{l['id']} - {l['name']} ({l['listType']})\")
|
|
|
|
asyncio.run(main())
|
|
"
|
|
```
|
|
|
|
### Get List Items
|
|
```python
|
|
python3 -c "
|
|
import asyncio
|
|
from ourgroceries import OurGroceries
|
|
|
|
async def main():
|
|
og = OurGroceries('USERNAME', 'PASSWORD')
|
|
await og.login()
|
|
items = await og.get_list_items('LIST_ID')
|
|
for item in items.get('list', {}).get('items', []):
|
|
crossed = '✓' if item.get('crossedOff') else ' '
|
|
print(f\"[{crossed}] {item.get('value')} (id: {item.get('id')})\")
|
|
|
|
asyncio.run(main())
|
|
"
|
|
```
|
|
|
|
### Add Item to List
|
|
```python
|
|
python3 -c "
|
|
import asyncio
|
|
from ourgroceries import OurGroceries
|
|
|
|
async def main():
|
|
og = OurGroceries('USERNAME', 'PASSWORD')
|
|
await og.login()
|
|
result = await og.add_item_to_list('LIST_ID', 'Item name', category='Produce')
|
|
print(result)
|
|
|
|
asyncio.run(main())
|
|
"
|
|
```
|
|
|
|
### Toggle Item Crossed Off
|
|
```python
|
|
python3 -c "
|
|
import asyncio
|
|
from ourgroceries import OurGroceries
|
|
|
|
async def main():
|
|
og = OurGroceries('USERNAME', 'PASSWORD')
|
|
await og.login()
|
|
# cross_off=True marks as done, cross_off=False unmarks
|
|
result = await og.toggle_item_crossed_off('LIST_ID', 'ITEM_ID', cross_off=True)
|
|
print(result)
|
|
|
|
asyncio.run(main())
|
|
"
|
|
```
|
|
|
|
### Remove Item from List
|
|
```python
|
|
python3 -c "
|
|
import asyncio
|
|
from ourgroceries import OurGroceries
|
|
|
|
async def main():
|
|
og = OurGroceries('USERNAME', 'PASSWORD')
|
|
await og.login()
|
|
result = await og.remove_item_from_list('LIST_ID', 'ITEM_ID')
|
|
print(result)
|
|
|
|
asyncio.run(main())
|
|
"
|
|
```
|
|
|
|
## Workflows
|
|
|
|
### "Add X to my shopping list"
|
|
1. Get list ID from `get_my_lists()` (look for list named "Shopping" or "Main")
|
|
2. Add item with `add_item_to_list(list_id, item_name)`
|
|
|
|
### "What's on my shopping list?"
|
|
1. Get list ID
|
|
2. Fetch items with `get_list_items(list_id)`
|
|
3. Display with checkboxes for crossed-off status
|
|
|
|
### "Clear crossed-off items"
|
|
1. Use `delete_all_crossed_off_from_list(list_id)`
|
|
|
|
## Steve's Lists
|
|
|
|
Stored in `TOOLS.md`:
|
|
- **Shopping List:** `OIqZ7A85kWCITf9wspo_ae`
|
|
- **July 2026 Holiday:** `Cfl-96OqEU2IObGAUd7S0f`
|
|
|
|
## Notes
|
|
|
|
- `add_items_to_list(list_id, items)` accepts a list of tuples `(value, category, note)` for bulk adding
|
|
- Use `auto_category=True` to let OurGroceries guess the category
|
|
- List IDs are strings like `abc123xyz`
|