---
name: idoklad-cli
description: Manage invoices with iDoklad — list, create, download PDF, send, mark paid, search contacts. Use for any invoicing request.
allowed-tools: Bash(idoklad-cli:*)
---

# iDoklad Invoicing CLI

## Quick start

```bash
idoklad-cli invoices --unpaid           # Show unpaid invoices
idoklad-cli contacts --search "CONTACT" # Find a contact
idoklad-cli invoice-pdf 12345 -o inv.pdf  # Download PDF
```

## Commands

### List invoices

```bash
idoklad-cli invoices
idoklad-cli invoices --unpaid
idoklad-cli invoices --contact <id>
idoklad-cli invoices --unpaid --contact <id>
```

### Create an invoice

```bash
idoklad-cli invoice-create --contact <id> --items '[
  {
    "Name": "Consulting services - January 2026",
    "Amount": 40,
    "UnitPrice": 100,
    "Unit": "hrs",
    "VatRateType": 4,
    "PriceType": 1
  }
]'
```

Item fields:
- `Name` — line item description
- `Amount` — quantity
- `UnitPrice` — price per unit
- `Unit` — unit label (e.g., "hrs", "ks")
- `VatRateType` — 0=Zero, 1=Reduced1, 2=Reduced2, 3=Basic, 4=NonTaxable
- `PriceType` — 0=WithVat, 1=WithoutVat

See `clients.json` for per-client `vat_rate_type`, `price_type`, `invoice_unit`, `hourly_rate`, and `currency`.

### Download invoice PDF

```bash
idoklad-cli invoice-pdf <id>              # Saves as invoice-<id>.pdf
idoklad-cli invoice-pdf <id> -o file.pdf  # Custom filename
```

### Send invoice by email

```bash
idoklad-cli invoice-send <id>                 # Send to default contact email
idoklad-cli invoice-send <id> --email a@b.com # Send to specific email
```

### Mark invoice as paid

```bash
idoklad-cli invoice-pay <id>
```

### Search contacts

```bash
idoklad-cli contacts                     # List all contacts
idoklad-cli contacts --search "name"     # Search by company name
```

## Client Configuration

Check `clients.json` in your workspace for:
- `idoklad_contact_id` — iDoklad contact ID for the client
- `hourly_rate` and `currency` — billing rate
- `invoice_line_item` — default line item description template
- `invoice_unit` — unit for time entries (e.g., "hrs")
- `invoice_language` — invoice language code
- `vat_rate_type` and `price_type` — tax configuration
