CLI tool that syncs purchases from Walmart, Costco, and Amazon with Monarch Money. Automatically splits transactions by category using AI.
- Fetches orders from retailers with item details
- Matches them to transactions in Monarch Money
- Categorizes items using an LLM (OpenAI or Anthropic Claude)
- Splits the transaction by category with proportional tax
Example: A $150 Walmart transaction becomes:
- $104.57 Groceries (milk, bread, eggs...)
- $28.42 Household (paper towels, cleaning supplies)
- $17.32 Personal Care (shampoo, toothpaste)
- Go 1.24+
- Monarch Money account
- An LLM API key — OpenAI or Anthropic (Claude)
- Retailer account(s)
git clone https://github.com/eshaffer321/itemize
cd itemize
go build -o itemize ./cmd/itemize/Set environment variables:
export MONARCH_TOKEN="your_monarch_token"
# Pick one LLM backend:
export OPENAI_API_KEY="your_openai_key"
# or
export ANTHROPIC_API_KEY="your_anthropic_key"Or create config.yaml:
monarch:
api_key: "${MONARCH_TOKEN}"
openai:
api_key: "${OPENAI_API_KEY}"
model: "gpt-5.4-nano"
anthropic:
api_key: "${ANTHROPIC_API_KEY}"
model: "claude-haiku-4-5-20251001"
# Optional: force a backend when both keys are set.
# Leave blank to auto-detect from whichever key is present.
categorizer:
provider: "" # "openai" | "anthropic" | ""
storage:
database_path: "monarch_sync.db"itemize picks the LLM backend based on which API key is configured:
- Only
OPENAI_API_KEYset → OpenAI is used. - Only
ANTHROPIC_API_KEY(orCLAUDE_API_KEY) set → Claude is used. - Both set → defaults to OpenAI; set
CATEGORIZER_PROVIDER=anthropicto force Claude.
Override the model with OPENAI_MODEL or ANTHROPIC_MODEL per run.
# Preview changes (dry run)
./itemize walmart -dry-run -days 14
./itemize costco -dry-run -days 7
./itemize amazon -dry-run -days 7
# Apply changes
./itemize walmart -days 14
./itemize costco -days 7
./itemize amazon -days 7| Flag | Default | Description |
|---|---|---|
-dry-run |
false | Preview without applying changes |
-days |
14 | Days to look back for orders |
-max |
0 | Max orders to process (0 = all) |
-verbose |
false | Show detailed logs |
-force |
false | Reprocess already-processed orders |
Requires cookies in ~/.walmart-api/cookies.json. See walmart-client-go.
Uses credentials saved by costco-go.
Requires amazon-order-scraper CLI:
npm install -g amazon-order-scraper
BROWSER_DATA_DIR="$HOME/.itemize/amazon" amazon-scraper --login # authenticate onceitemize uses the same persistent browser profile base by default. If you set
AMAZON_ACCOUNT_NAME, pass the matching scraper profile during login:
BROWSER_DATA_DIR="$HOME/.itemize/amazon" amazon-scraper --login --profile "$AMAZON_ACCOUNT_NAME""No matching transaction found"
- Transaction hasn't posted to Monarch yet (wait 1-3 days)
- Amount differs by more than $0.01
- Date differs by more than 5 days
"Order already processed"
- Use
-forceto reprocess
OpenAI errors
- Check
OPENAI_API_KEYis set and has credits
# Run tests
go test ./...
# With coverage
go test ./... -coverSee CLAUDE.md for architecture details and development guide.
MIT