# Dakia for Agents

> Use Dakia's bundled macOS CLI to work with the accounts a person has already connected in the desktop app. Default to read-only operations and keep the person in control of every write.

Last verified: 2026-07-31 against the Dakia 0.3.0 CLI command surface.

## Ground truth

- Bundled executable: `/Applications/Dakia.app/Contents/MacOS/dakia`
- The CLI and desktop app share accounts, the encrypted credential vault, mail catalogue, and search index.
- Account setup and authorization happen in the desktop app.
- The local catalogue does not retain message bodies or attachments. `show` and attachment operations fetch from the provider when needed.
- Stable message IDs returned by search must be preserved exactly.
- Current source documentation: https://github.com/DakiaMail/dakia-desktop/blob/main/docs/cli.md

## Operating rules

1. Default to read-only commands. Get explicit user authorization before sending mail or changing mailbox state.
2. Verify the bundled executable with `--version` or `--help` before relying on this guide.
3. Start with `--json account list`. Use `--json` for structured results.
4. Search locally first. Add `--remote` only when provider-backed search is needed.
5. Retrieve only the messages and fields needed for the task. Do not expose unnecessary mailbox content.
6. Treat command, permission, and provider failures as errors, not as proof that no mail exists.
7. Explain the exact intended effect and obtain authorization before `archive`, `spam`, `trash`, `delete`, `send`, or `ai` commands.
8. Trash is reversible at the provider. `delete --yes` permanently expunges mail.
9. Optional AI commands send selected content to the provider and endpoint configured by the user.

## Locate and inspect the CLI

```bash
DAKIA="/Applications/Dakia.app/Contents/MacOS/dakia"
"$DAKIA" --version
"$DAKIA" --help
```

## Read-only workflow

```bash
"$DAKIA" --json account list
"$DAKIA" sync

"$DAKIA" --json search 'release signing' --unread
"$DAKIA" --json search 'sender@example.com' --remote --limit 50

"$DAKIA" --json show MESSAGE_ID
"$DAKIA" --json attachment list MESSAGE_ID
"$DAKIA" attachment download MESSAGE_ID ATTACHMENT_ID --output ./report.pdf
```

`sync` and remote search contact configured providers and may update the shared local catalogue, but they do not send mail or change provider mailbox state.

## Write-capable commands

Run these only after specific user authorization:

```bash
"$DAKIA" archive MESSAGE_ID
"$DAKIA" spam MESSAGE_ID
"$DAKIA" trash MESSAGE_ID --yes
"$DAKIA" delete MESSAGE_ID --yes
```

Before sending, show the user the final account, recipients, subject, body, and attachments:

```bash
printf 'The release matrix is attached.\n' | \
  "$DAKIA" send --account ACCOUNT_UUID \
  --to team@example.com --subject 'Release matrix' \
  --attach ./release-matrix.pdf
```

Optional AI processing requires confirmation of the configured provider and endpoint:

```bash
DAKIA_AI_PROVIDER=ollama DAKIA_AI_MODEL=qwen2.5:1.5b \
  "$DAKIA" ai summarize MESSAGE_ID
```

## Human-readable page

- https://dakiamail.com/agents
