Skill: septianw/grocy-inventory (version 1.0.0)

--- name: grocy-inventory description: "Manage Grocy inventory, shopping list, batteries, and barcodes. Use when user wants to: (1) Check what's in their fridge/pantry, (2) See expiring products, (3) Manage stock by barcode, (4) Add/Consume/Transfer products, (5) Track rechargeable batteries. Grocy is a self-hosted inventory management app running at http://localhost:14611" --- # Grocy Inventory Skill Check and manage your Grocy inventory, shopping list, and batteries. This skill connects to your local Grocy instance. ## Configuration | Variable | Value | |----------|-------| | URL | `http://localhost:14611` | | API Key | [REDACTED_SECRET] | ## Quick Commands ### Check Stock (Fridge/Pantry) ```bash curl -s -H "GROCY-[REDACTED_SECRET]" "$URL/api/stock" ``` ### Lookup Details by Barcode ```bash curl -s -H "GROCY-[REDACTED_SECRET]" "$URL/api/stock/products/by-barcode/{barcode}" ``` ### Consume Stock by Barcode ```bash curl -s -X POST -H "GROCY-[REDACTED_SECRET]" \ -H "Content-Type: application/json" \ -d '{"amount": 1, "transaction_type": "consume"}' \ "$URL/api/stock/products/by-barcode/{barcode}/consume" ``` ### Mark Stock as Opened by Barcode ```bash curl -s -X POST -H "GROCY-[REDACTED_SECRET]" \ -H "Content-Type: application/json" \ -d '{"amount": 1}' \ "$URL/api/stock/products/by-barcode/{barcode}/open" ``` ### Transfer Stock by Barcode ```bash curl -s -X POST -H "GROCY-[REDACTED_SECRET]" \ -H "Content-Type: application/json" \ -d '{"amount": 1, "location_id_from": 6, "location_id_to": 2}' \ "$URL/api/stock/products/by-barcode/{barcode}/transfer" ``` ### Get All Batteries ```bash curl -s -H "GROCY-[REDACTED_SECRET]" "$URL/api/batteries" ``` ### Track Battery Charge ```bash curl -s -X POST -H "GROCY-[REDACTED_SECRET]" \ -H "Content-Type: application/json" \ -d '{"battery_id": 7}' \ "$URL/api/batteries/7/charge" ``` ## Common Tasks | Task | Command | |------|---------| | Find product by barcode | GET `/api/stock/products/by-barcode/{barcode}` | | Consume by barcode | POST `/api/stock/products/by-barcode/{barcode}/consume` | | Open by barcode | POST `/api/stock/products/by-barcode/{barcode}/open` | | Transfer by barcode | POST `/api/stock/products/by-barcode/{barcode}/transfer` | | Check battery status | GET `/api/batteries` | | Track battery charge | POST `/api/batteries/{id}/charge` | ## Tips - Use `jq` for pretty JSON logs: `curl ... | jq` - For barcodes, use the direct `/by-barcode/{barcode}` endpoints found in the `Stock "by-barcode"` tags. - Full API docs: See `references/grocy-api.md`

path: references/grocy-api.md
content: # Grocy API Reference

## Base URL
```
http://localhost:14611
```

## Authentication
Header: `GROCY-[REDACTED_SECRET]`

## Stock "by-barcode" API

Grocy **does** feature specialized endpoints to manage stock via barcode directly!

### Get Product Details by Barcode
```bash
GET /api/stock/products/by-barcode/{barcode}
```
Returns a `ProductDetailsResponse` object.

### Add Product to Stock by Barcode
```bash
POST /api/stock/products/by-barcode/{barcode}/add
```
```json
{
  "amount": 1,
  "best_before_date": "2026-06-01",
  "transaction_type": "purchase",
  "price": 1.99,
  "location_id": 3
}
```

### Consume Product by Barcode
```bash
POST /api/stock/products/by-barcode/{barcode}/consume
```
```json
{
  "amount": 1,
  "transaction_type": "consume",
  "spoiled": false,
  "location_id": 3,
  "exact_amount": false
}
```

### Transfer Product by Barcode
```bash
POST /api/stock/products/by-barcode/{barcode}/transfer
```
```json
{
  "amount": 1,
  "location_id_from": 1,
  "location_id_to": 2
}
```

### Inventory (Audit) Product by Barcode
```bash
POST /api/stock/products/by-barcode/{barcode}/inventory
```
```json
{
  "new_amount": 5,
  "best_before_date": "2026-06-01",
  "location_id": 3,
  "price": 1.99
}
```

### Mark Product as Opened by Barcode
```bash
POST /api/stock/products/by-barcode/{barcode}/open
```
```json
{
  "amount": 1
}
```

---

## Battery API

### Get All Batteries
```bash
GET /api/batteries
```

### Get Battery Definition
```bash
GET /api/objects/batteries
```

### Track Battery Charge
```bash
POST /api/batteries/track
```
```json
{
  "battery_id": 1,
  "tracked_time": "2026-03-04T05:50:00"
}
```

---

## Example: Consume Milk via Barcode
```bash
curl -s -X POST -H "GROCY-[REDACTED_SECRET]" \
  -H "Content-Type: application/json" \
  -d '{"amount": 1, "transaction_type": "consume", "location_id": 6}' \
  "http://localhost:14611/api/stock/products/by-barcode/8998009010620/consume"
```


Security scan verdicts — ClawScan: suspicious | static analysis: clean | VirusTotal: clean | SkillSpector: suspicious (HIGH)