# zimba

CLI and Claude Code skills for Zimbra email, calendar, and contacts.

## Install

```bash
pip install zimba
```

## Setup

```bash
zimba setup https://mail.example.com user@example.com
```

Credentials are stored in `~/.config/zimba/config.json` (mode 600).

## Usage

### Email

```bash
zimba email search "in:inbox is:unread"
zimba email read 12345
zimba email read 12345 /tmp/attachments    # download attachments
zimba email send "to@example.com" "Subject" "Body"
zimba email send "to@example.com" "Subject" "Body" /path/to/file.pdf
zimba email reply 12345 "Thanks!"
zimba email reply 12345 "Thanks!" --all
zimba email forward 12345 "to@example.com" "FYI"
zimba email folders
zimba email move <folder_id> <msg_id>
zimba email delete <msg_id>
zimba email mark-read <msg_id>
zimba email flag <msg_id>
```

### Calendar

```bash
zimba calendar events
zimba calendar details <event_id>
echo '{"subject":"Meeting","start":"20260315T100000","end":"20260315T110000"}' | zimba calendar create
zimba calendar delete <event_id>
```

### Contacts

```bash
zimba contacts search "John"
zimba contacts get <contact_id>
echo '{"email":"j@example.com","first_name":"John","last_name":"Doe"}' | zimba contacts create
zimba contacts delete <contact_id>
```

## Claude Code Skills

Copy the `skills/` directory into your project's `.claude/skills/` or `~/.claude/skills/` to enable `/zimba-email`, `/zimba-calendar`, and `/zimba-contacts` slash commands.

## Key design decisions

- **No external dependencies** — stdlib only (urllib, json, ssl)
- **Attachments are file paths** — no base64 in the terminal, files are uploaded/downloaded automatically
- **Zimbra SOAP API** — uses the JSON SOAP interface, not REST, for full feature coverage
- **Token caching** — authenticates once, caches the token until it expires

## License

MIT
