### Build example plugin from TideMail checkout Source: https://github.com/allisonhere/tidemail/wiki/Plugin-Getting-Started Copies the example plugin.toml and builds the plugin binary from the examples directory using go build. Requires a TideMail checkout. ```sh mkdir -p ~/.config/tidemail/plugins/example cp examples/plugins/example/plugin.toml ~/.config/tidemail/plugins/example/ go build -o ~/.config/tidemail/plugins/example/tidemail-plugin-example ./examples/plugins/example ``` -------------------------------- ### Install TideMail with curl installer Source: https://github.com/allisonhere/tidemail/blob/main/README.md Downloads and runs the official install script. Writes to ~/.local/bin by default and installs a man page. Set INSTALL_DIR to change the destination. ```bash curl -fsSL https://raw.githubusercontent.com/allisonhere/tidemail/main/install.sh | sh ``` -------------------------------- ### Install TideMail with custom INSTALL_DIR Source: https://github.com/allisonhere/tidemail/wiki/Installation Runs the same install script but sets INSTALL_DIR to a writable directory of your choice (e.g., $HOME/bin) before execution. Use this if you prefer a different installation location than the default ~/.local/bin. ```bash curl -fsSL https://raw.githubusercontent.com/allisonhere/tidemail/main/install.sh | INSTALL_DIR="$HOME/bin" sh ``` -------------------------------- ### Start TideMail from the command line Source: https://github.com/allisonhere/tidemail/wiki/First-run Run the `tidemail` command to launch TideMail. After starting, press `M` to open the account manager and add your IMAP and SMTP details. ```bash tidemail ``` -------------------------------- ### Install TideMail skill for agents Source: https://github.com/allisonhere/tidemail/wiki/CLI-reference Commands to print the portable skill document and install TideMail's SKILL.md for Codex, Claude, Pi, or Hermes. Use --dry-run to print the destination without writing. Installation refuses to overwrite an existing skill; use --force to consent to replacement. Restart or reload the agent after installation. ```bash tidemail skill tidemail install-skill codex --dry-run tidemail install-skill codex tidemail install-skill claude tidemail install-skill pi tidemail install-skill hermes ``` -------------------------------- ### Create plugin directory and initialize Go module Source: https://github.com/allisonhere/tidemail/wiki/Plugin-Getting-Started Manual setup for a plugin: create a directory and initialize a Go module. This is an alternative to the scaffold workflow. ```sh mkdir -p ~/src/tidemail-plugin-example && cd ~/src/tidemail-plugin-example go mod init example.com/tidemail-plugin-example ``` -------------------------------- ### Example settings manifest (TOML) Source: https://github.com/allisonhere/tidemail/blob/main/docs/plugins/settings.md Shows how to declare settings in a plugin manifest with keys, labels, types, options, defaults, and help text. Includes a select, a bool, and a secret. ```toml [[settings]] key = "mode" # required label = "Classification mode" # required type = "select" # required: bool, select, or secret options = ["local", "hybrid"] # select only: 1-16 options default = "local" # optional; not allowed for secret help = "Hybrid also asks an online model." # optional [[settings]] key = "notify_only" label = "Only tag, never summarize" type = "bool" default = true [[settings]] key = "api_key" label = "API key" type = "secret" help = "Sent only to example.com, only in hybrid mode." ``` -------------------------------- ### Report fixture JSON example Source: https://github.com/allisonhere/tidemail/wiki/Plugin-Developer-Tools Example JSON for a report fixture. Messages take the header fields from protocol.md plus in_reply_to, references, read, starred, has_attachment, and flags; unknown fields (including any body) are rejected. The report starts in the first account's first folder. ```json { "me": ["me@example.com"], "now": "2026-09-27T12:00:00Z", "accounts": [{"name": "Work", "mailboxes": [ {"name": "INBOX", "messages": [ {"message_id": "<1@x>", "from": "Ann ", "to": "me@example.com", "subject": "Invoice", "date": "2026-09-26T10:00:00Z", "annotations": [{"plugin": "smart", "key": "category", "value": "billing"}], "overrides": {"category": "work"}, "dismissed": false, "snoozed_until": ""} ]}, {"name": "Sent", "flags": ["\\Sent"], "messages": []} ]}] } ``` -------------------------------- ### Install plugin manually with shell commands Source: https://github.com/allisonhere/tidemail/wiki/Plugin-Getting-Started Creates the plugin directory, copies plugin.toml and the plugin binary, and makes the binary executable. Run these commands from a shell. ```sh mkdir -p ~/.config/tidemail/plugins/example cp plugin.toml tidemail-plugin-example ~/.config/tidemail/plugins/example/ chmod +x ~/.config/tidemail/plugins/example/tidemail-plugin-example ``` -------------------------------- ### Clone, build, and run TideMail Source: https://github.com/allisonhere/tidemail/blob/main/README.md Clone the repository, build the binary with `go build -o tidemail .`, and run it with `./tidemail`. Requires Go to be installed. ```bash git clone https://github.com/allisonhere/tidemail cd tidemail go build -o tidemail . ./tidemail ``` -------------------------------- ### analytics.attention request example Source: https://github.com/allisonhere/tidemail/wiki/Plugin-Analytics Example request for the analytics.attention query. It takes no parameters. ```json {"method": "analytics.attention"} ``` -------------------------------- ### TideMail config.toml example Source: https://github.com/allisonhere/tidemail/blob/main/README.md Example configuration file at ~/.config/tidemail/config.toml. Shows theme, default_account, display settings, and an account block with IMAP/SMTP settings. The signature uses a multi-line TOML string. Account order determines display order. Malformed config prevents startup. ```toml theme = "lavender-fields-forever" # The account new messages are sent from, and the one focused at startup. # Holds an account id, so renaming or reordering never moves it. Omit it and # TideMail uses the first account below. Set it with Space in Accounts. default_account = "8f43c9e644384bd5a25a27ff0d9c2701" [display] send_delay_seconds = 5 send_max_attempts = 3 # total attempts; 1 disables automatic retries compose_vim = true images = "auto" # "auto" (inline + blocked remote), or "off" (text placeholders) [[account]] id = "8f43c9e644384bd5a25a27ff0d9c2701" # generated by TideMail; do not copy or edit name = "Personal" imap_host = "imap.example.com" imap_port = 993 imap_tls = true smtp_host = "smtp.example.com" smtp_port = 587 smtp_tls = true user = "mira@example.com" from = "Mira Chen " # optional, but a name alone is not an address signature = """ Mira Sent with TideMail""" sync_minutes = 0 # push via IMAP IDLE; N polls every N min, -1 is manual only ``` -------------------------------- ### analytics.volume request example Source: https://github.com/allisonhere/tidemail/wiki/Plugin-Analytics Example request for the analytics.volume query, using a 30d range and grouping by day. ```json {"method": "analytics.volume", "range": "30d", "group_by": "day"} ``` -------------------------------- ### analytics.response_times response example Source: https://github.com/allisonhere/tidemail/wiki/Plugin-Analytics Example response for analytics.response_times, showing response time statistics in seconds. ```json { "user_sample_count": 41, "median_user_response_s": 5400, "average_user_response_s": 20160, "other_sample_count": 37, "median_other_response_s": 9000, "average_other_response_s": 33300, "excluded_count": 0 } ``` -------------------------------- ### analytics.response_times request example Source: https://github.com/allisonhere/tidemail/wiki/Plugin-Analytics Example request for the analytics.response_times query, using a 90d range. ```json {"method": "analytics.response_times", "range": "90d"} ``` -------------------------------- ### query.annotations example request Source: https://github.com/allisonhere/tidemail/wiki/Plugin-Queries Example query.annotations request to retrieve stored plugin annotations. Requires message_ids (1 to 500); plugin_ids and keys are optional and narrow the result. ```json {"method": "query.annotations", "message_ids": [1234, 1235], "plugin_ids": ["smart"], "keys": ["category"]} ``` -------------------------------- ### Build and run old version for install confirmation preview Source: https://github.com/allisonhere/tidemail/wiki/Development-flags Builds an older version of TideMail and runs it with a scratch profile to preview the install confirmation window. Requires a real release newer than the running build. ```sh go build -ldflags "-X main.version=v1.0.1" -o /tmp/tidemail-old . XDG_CONFIG_HOME=/tmp/tm-cfg XDG_DATA_HOME=/tmp/tm-data /tmp/tidemail-old ``` -------------------------------- ### analytics.categories request example Source: https://github.com/allisonhere/tidemail/wiki/Plugin-Analytics Example request for the analytics.categories query, using a 30d range. ```json {"method": "analytics.categories", "range": "30d"} ``` -------------------------------- ### analytics.contacts response example Source: https://github.com/allisonhere/tidemail/wiki/Plugin-Analytics Example response for analytics.contacts, showing top correspondents and domains. ```json { "correspondents": [{"address": "ann@example.com", "name": "Ann Lee", "received": 40, "sent": 22, "total": 62}], "domains": [{"domain": "example.com", "received": 90, "sent": 31, "total": 121}] } ``` -------------------------------- ### analytics.volume response example Source: https://github.com/allisonhere/tidemail/wiki/Plugin-Analytics Example response for analytics.volume, showing received and sent counts per bucket. Every bucket in the range is present, even empty ones. ```json { "group_by": "day", "from": "2026-08-28T12:00:00-05:00", "to": "2026-09-27T12:00:00-05:00", "received": 428, "sent": 73, "buckets": [{"start": "2026-08-28", "received": 12, "sent": 3}] } ``` -------------------------------- ### Complete plugin.toml manifest example Source: https://github.com/allisonhere/tidemail/wiki/Plugin-Manifest A complete manifest showing every field TideMail accepts. Only id, name, api, and command are required. Permissions default to false, and settings are optional. ```toml id = "example" # required name = "Example Plugin" # required version = "0.1.0" # optional, shown in the plugin list description = "Tag invoices as billing" # optional, shown in the picker and plugin page homepage = "https://example.com/tidemail-plugin" # optional, https only api = 1 # required; the protocol version command = "tidemail-plugin-example" # required; relative to the plugin directory timeout = 60 # optional; seconds for message.decode/prepare (max 120) events = ["message.received"] # optional; automatic events capabilities = ["plugin.test"] # optional; extra protocol features [permissions] # all default to false message_metadata = true annotations = true network = false message_body = false message_raw = false # decrypt/verify received mail (message.decode) message_compose = false # sign/encrypt outgoing mail (message.prepare) messages_query = false # read-only queries (report.run) threads_query = false annotations_query = false analytics_read = false [[settings]] # optional; zero or more key = "strict" label = "Strict matching" type = "bool" default = false help = "Only tag subjects that start with Invoice." ``` -------------------------------- ### Install TideMail from AUR with yay or paru Source: https://github.com/allisonhere/tidemail/blob/main/README.md Install the tidemail-bin package from the AUR using either yay or paru. Updates come from your AUR helper; plain pacman -Syu will not update it. ```bash yay -S tidemail-bin # or paru -S tidemail-bin ``` -------------------------------- ### Add app launcher entry manually Source: https://github.com/allisonhere/tidemail/wiki/Installation Installs the TideMail icon and desktop entry from a repository checkout. The desktop entry runs tidemail in your default terminal, so tidemail must be on your PATH. This is optional because the Arch Linux package (tidemail-bin) installs these for you. ```bash install -Dm644 images/tidemail-icon.png ~/.local/share/icons/tidemail.png install -Dm644 packaging/linux/tidemail.desktop ~/.local/share/applications/tidemail.desktop ``` -------------------------------- ### Example presentation JSON structure Source: https://github.com/allisonhere/tidemail/wiki/Plugin-Presentation Example JSON response with annotations and a presentation block. The presentation includes title, summary, status, confidence, facts, and reasons. Required fields: title. Optional: summary, status, confidence, facts, reasons. ```json { "annotations": [{"key": "category", "value": "newsletter", "confidence": 0.85}], "presentation": { "title": "This looks like a newsletter", "summary": "Automated list mail with low expected priority.", "status": "info", "confidence": "high", "facts": [ {"label": "Type", "value": "Newsletter"}, {"label": "Priority", "value": "Low"} ], "reasons": ["Matches newsletter/list-mail patterns", "Sent by an automated mailing source"] } } ``` -------------------------------- ### query.classification request example Source: https://github.com/allisonhere/tidemail/blob/main/docs/plugins/queries.md Example JSON request for the query.classification method, specifying message IDs to query. ```json {"method": "query.classification", "message_ids": [1234]} ``` -------------------------------- ### analytics.attention response example Source: https://github.com/allisonhere/tidemail/wiki/Plugin-Analytics Example response for analytics.attention, showing current counts for attention views. ```json { "needs_you_current": 12, "needs_you_dismissed_current": 3, "waiting_current": 5, "snoozed_messages_current": 2, "snoozed_threads_current": 1, "corrections_current": 9 } ``` -------------------------------- ### query.threads example request Source: https://github.com/allisonhere/tidemail/wiki/Plugin-Queries Example query.threads request using scope all_cached and fields for thread information. Returns threads with newest conversation first. ```json {"method": "query.threads", "scope": "all_cached", "fields": ["thread_id", "participants", "message_count", "latest_date", "waiting_on_them"], "limit": 50} ``` -------------------------------- ### analytics.contacts request example Source: https://github.com/allisonhere/tidemail/wiki/Plugin-Analytics Example request for the analytics.contacts query, using a 365d range and a limit of 10. ```json {"method": "analytics.contacts", "range": "365d", "limit": 10} ``` -------------------------------- ### Manifest permissions table with defaults Source: https://github.com/allisonhere/tidemail/wiki/Plugin-Permissions Example TOML manifest `[permissions]` table showing all permissions and their default values. All permissions default to `false`. ```toml [permissions] message_metadata = true annotations = true network = false message_body = false message_raw = false message_compose = false messages_query = false threads_query = false annotations_query = false analytics_read = false ``` -------------------------------- ### Agent mode mail commands Source: https://github.com/allisonhere/tidemail/wiki/CLI-reference Example commands using --agent for listing accounts, searching messages, creating drafts, sending with approval, and processing the outbox. Sending requires mail.send permission and user approval via --yes or interactive preview. ```bash tidemail accounts list --agent --json tidemail messages search "invoice" --agent --json tidemail draft create --to user@example.com --subject "Reply" \ --body-file response.md --agent --json # Requires configured mail.send and user approval of this exact message. tidemail send --to user@example.com --subject "Approved reply" \ --body-file approved-response.md --agent --yes --json # Authorized processor for an already approved queue. tidemail outbox process --agent --yes --json ``` -------------------------------- ### query.threads example result Source: https://github.com/allisonhere/tidemail/blob/main/docs/plugins/queries.md Example JSON response for query.threads, showing the structure with a threads array and next_cursor. The result is newest conversation first. ```json {"threads": [...], "next_cursor": "…"} ``` -------------------------------- ### query.classification response example Source: https://github.com/allisonhere/tidemail/blob/main/docs/plugins/queries.md Example JSON response showing classification fields with source annotations (plugin, user, none). Requires both annotations_query and analytics_read permissions. ```json {"classifications": [{ "message_id": 1234, "needs_reply": {"value": true, "source": "plugin"}, "urgent": {"value": false, "source": "none"}, "important": {"value": false, "source": "none"}, "category": {"value": "personal", "source": "user"} }]} ``` -------------------------------- ### query.messages example result Source: https://github.com/allisonhere/tidemail/wiki/Plugin-Queries Example result for query.messages, containing a messages array and a next_cursor for pagination. The next_cursor is present when there are more pages. ```json { "messages": [ {"id": 1234, "sender": "Ann ", "subject": "Invoice", "date": "2026-09-26T10:00:00-05:00", "read": false} ], "next_cursor": "eyJkIjoxNzkwNTQy…" } ``` -------------------------------- ### analytics.categories response example Source: https://github.com/allisonhere/tidemail/wiki/Plugin-Analytics Example response for analytics.categories, showing total and per-category counts. Uncategorized mail is 'none'. ```json {"total": 999, "categories": [{"category": "newsletter", "count": 471}, {"category": "github", "count": 298}, {"category": "none", "count": 87}]} ``` -------------------------------- ### query.annotations example result Source: https://github.com/allisonhere/tidemail/wiki/Plugin-Queries Example result for query.annotations, containing an annotations array with message_id, plugin_id, key, value, and confidence. Unknown IDs are skipped; user corrections never appear. ```json {"annotations": [{"message_id": 1234, "plugin_id": "smart", "key": "category", "value": "billing", "confidence": 0.9}]} ``` -------------------------------- ### query.messages example request Source: https://github.com/allisonhere/tidemail/wiki/Plugin-Queries Example query.messages request showing required fields (scope, fields) and optional parameters (limit, sort, cursor, filters). The fields allowlist includes id, sender, subject, date, read; filters can include read, date_from, and others. ```json { "method": "query.messages", "scope": "inbox", "fields": ["id", "sender", "subject", "date", "read"], "limit": 100, "sort": "date_desc", "cursor": "", "filters": {"read": false, "date_from": "2026-09-01T00:00:00Z"} } ``` -------------------------------- ### Example TideMail configuration in TOML Source: https://github.com/allisonhere/tidemail/wiki/Configuration-files Shows the full structure of a TideMail config.toml file, including theme, default_account, display settings, and an account block. The account id is generated by TideMail and should not be copied or edited. The images setting can be "auto" (inline + blocked remote) or "off" (text placeholders). auth_method is "password" (default) or "oauth2". sync_minutes: 0 = push (IDLE), N = poll every N min, -1 = manual only. ```toml theme = "catppuccin-mocha" default_account = "8f43c9e644384bd5a25a27ff0d9c2701" [display] send_delay_seconds = 5 send_max_attempts = 3 images = "auto" # "auto" (inline + blocked remote), or "off" (text placeholders) [[account]] id = "8f43c9e644384bd5a25a27ff0d9c2701" # generated by TideMail; do not copy or edit name = "Personal" imap_host = "imap.example.com" imap_port = 993 imap_tls = true smtp_host = "smtp.example.com" smtp_port = 587 smtp_tls = true user = "alice@example.com" auth_method = "password" # "password" (default) or "oauth2" password = "app-password" from = "Alice " signature = "Alice\nSent with TideMail" sync_minutes = 0 # 0 = push (IDLE), N = poll every N min, -1 = manual only ``` -------------------------------- ### Example message metadata JSON Source: https://github.com/allisonhere/tidemail/wiki/Plugin-Getting-Started Shows the structure of the 'data' field when the plugin is run on a message. Contains fields like id, from, subject, date, read, starred, has_attachment, and mailbox_name. ```json {"id": 1234, "from": "Billing ", "subject": "Invoice 2026-09", "date": "2026-09-26T10:00:00Z", "read": false, "starred": false, "has_attachment": true, "mailbox_name": "INBOX"} ``` -------------------------------- ### Example JSON request from TideMail Source: https://github.com/allisonhere/tidemail/wiki/Plugin-Getting-Started Shows the JSON object TideMail writes to the plugin's stdin, followed by a newline, before closing stdin. The request includes api, type, request_id, and method fields. ```json {"api": 1, "type": "request", "request_id": "5c1e0b9a6f2d7e3a4b8c9d01", "method": "ping"} ``` -------------------------------- ### Plugin development workflow Source: https://github.com/allisonhere/tidemail/wiki/Plugin-Developer-Tools The headless contributor loop for TideMail plugins: scaffold, build, validate, test, install. These commands do not open Bubble Tea, connect to IMAP/SMTP, read the TideMail database, or require configured accounts. ```text scaffold → build → validate → test → install ``` -------------------------------- ### Available scopes for query.messages Source: https://github.com/allisonhere/tidemail/wiki/Plugin-Queries Lists the available scopes for query.messages: all_cached, current_account, current_mailbox, inbox, sent. The current_* scopes fail with scope_unavailable when the report was not started from an account or folder. ```text all_cached current_account current_mailbox inbox sent ``` -------------------------------- ### Python plugin example Source: https://github.com/allisonhere/tidemail/wiki/Plugin-Getting-Started A Python plugin that reads a JSON request from stdin and writes a JSON response to stdout. It handles 'ping' and 'message.metadata'/'message.received' methods, annotating messages containing 'invoice' in the subject. Requires the file to be executable with a shebang line, as TideMail runs it directly without a shell. ```python #!/usr/bin/env python3 import json import sys req = json.loads(sys.stdin.readline()) resp = {"api": 1, "type": "response", "request_id": req.get("request_id", "")} method = req.get("method") if method == "ping": resp.update(ok=True, data={"message": "pong"}) elif method in ("message.metadata", "message.received"): subject = (req.get("data") or {}).get("subject", "") anns = [{"key": "category", "value": "billing"}] if "invoice" in subject.lower() else [] resp.update(ok=True, data={"annotations": anns}) else: resp.update(ok=False, error={"code": "unsupported_method", "message": str(method)}) sys.stdout.write(json.dumps(resp) + "\n") ``` -------------------------------- ### Read one request from stdin Source: https://github.com/allisonhere/tidemail/wiki/Plugin-Getting-Started TideMail starts the executable, writes one JSON object and a newline to stdin, and closes stdin. The plugin must decode exactly one JSON value from stdin. ```APIDOC ## Read one request from stdin ### Description TideMail starts the executable, writes one JSON object and a newline to stdin, and closes stdin. The plugin must decode exactly one JSON value from stdin. ### Input A single JSON object on stdin, followed by a newline. Example: ```json {"api": 1, "type": "request", "request_id": "5c1e0b9a6f2d7e3a4b8c9d01", "method": "ping"} ``` ### Request Structure - **api** (int) - Required - API version number. - **type** (string) - Required - Must be `"request"`. - **request_id** (string) - Required - Unique identifier for the request. - **method** (string) - Required - The method to invoke. - **settings** (map[string]any) - Optional - Additional settings. - **data** (json.RawMessage) - Optional - Additional data. ### Decoding Example (Go) ```go type request struct { API int `json:"api"` Type string `json:"type"` RequestID string `json:"request_id"` Method string `json:"method"` Settings map[string]any `json:"settings,omitempty"` Data json.RawMessage `json:"data,omitempty"` } var req request if err := json.NewDecoder(os.Stdin).Decode(&req); err != nil { fmt.Fprintln(os.Stderr, "example: cannot read request:", err) os.Exit(1) } ``` ``` -------------------------------- ### TideMail headless CLI commands Source: https://github.com/allisonhere/tidemail/blob/main/README.md Commands for shell scripts and AI agents to list unread messages, create drafts, send mail, process the outbox, and install an agent skill. The --yes flag queues mail with the configured delay; send saves a draft unless delivery is authorized. ```bash tidemail messages list --unread --json tidemail draft create --to me@example.com --subject "Draft" --body-file message.md tidemail send --to me@example.com --subject "Hello" --body "Hello" --yes tidemail outbox process --json tidemail install-skill codex ``` -------------------------------- ### TideMail JSON success envelope Source: https://github.com/allisonhere/tidemail/wiki/CLI-reference Example of the versioned JSON envelope returned by mail commands with --json on success. Scripts must check ok and the delivery state rather than treating exit code 0 as proof that a queued message was sent. ```json {"schema_version":1,"ok":true,"data":{"state":"queued","id":42}} ``` -------------------------------- ### analytics.volume request and response Source: https://github.com/allisonhere/tidemail/blob/main/docs/plugins/analytics.md Request and response for analytics.volume, which returns received and sent counts per period. group_by can be day (default), week (ISO weeks starting Monday), or month, in the report's timezone. Every bucket in the range is present, even empty ones; a range with more than 2000 buckets fails. ```json {"method": "analytics.volume", "range": "30d", "group_by": "day"} ``` ```json { "group_by": "day", "from": "2026-08-28T12:00:00-05:00", "to": "2026-09-27T12:00:00-05:00", "received": 428, "sent": 73, "buckets": [{"start": "2026-08-28", "received": 12, "sent": 3}] } ``` -------------------------------- ### Scaffold a new plugin Source: https://github.com/allisonhere/tidemail/wiki/Plugin-Developer-Tools Creates a small dependency-free Go plugin with plugin.toml, main.go, go.mod, README.md, and .gitignore. Refuses to overwrite an existing directory. ```sh tidemail plugin scaffold invoice-tagger ``` -------------------------------- ### Build and test plugin locally Source: https://github.com/allisonhere/tidemail/wiki/Plugin-Getting-Started Builds the plugin binary and pipes a sample request JSON to it. The request uses method 'message.metadata' with subject 'Your invoice'. ```sh go build -o tidemail-plugin-example . echo '{"api":1,"type":"request","request_id":"t1","method":"message.metadata","data":{"id":1,"subject":"Your invoice"}}' | ./tidemail-plugin-example ``` -------------------------------- ### Import a public key from a file with gpg --import Source: https://github.com/allisonhere/tidemail/blob/main/docs/guide.md Use this command to import a public key that a recipient sent you as a file. ```bash gpg --import FILE.asc ``` -------------------------------- ### Set environment variables and run development build Source: https://github.com/allisonhere/tidemail/wiki/Google-OAuth-release Exports the Google Desktop client ID and secret, then runs the Go application. Setting both variables enables Google sign-in; without them it stays off. These exports override saved settings. ```sh export TIDEMAIL_GOOGLE_CLIENT_ID='your-desktop-client-id.apps.googleusercontent.com' export TIDEMAIL_GOOGLE_CLIENT_SECRET='your-desktop-client-secret' go run . ``` -------------------------------- ### Build release script with credentials Source: https://github.com/allisonhere/tidemail/wiki/Google-OAuth-release Runs the release build script with a test version and output path. The script requires both credentials and embeds them via Go linker flags. It respects GOOS and GOARCH and sets CGO_ENABLED=0. ```sh bash scripts/build-release.sh v0.0.0-test ./tidemail ``` -------------------------------- ### Render PKGBUILD manually Source: https://github.com/allisonhere/tidemail/blob/main/packaging/aur/README.md Renders the PKGBUILD from the template with the given version, pkgrel, and SHA256 checksums, then generates .SRCINFO and builds the package. The checksums must come from the release assets, not a local build. ```bash bash packaging/aur/render-pkgbuild.sh \ --version v1.0.16 --pkgrel 1 \ --sha256-x86_64 --sha256-aarch64 --sha256-license \ --sha256-icon --sha256-desktop \ --output /tmp/aur/PKGBUILD cd /tmp/aur && makepkg --printsrcinfo > .SRCINFO && makepkg -f ``` -------------------------------- ### Run TideMail test suite Source: https://github.com/allisonhere/tidemail/blob/main/README.md Run the test suite with `go test ./...`. ```bash go test ./... ``` -------------------------------- ### Build and verify CLI interactively Source: https://github.com/allisonhere/tidemail/wiki/CLI-reference Build the CLI binary and run a Python verification script with temporary accounts and a local SMTP fixture. This provides a repeatable terminal check. ```bash go build -o /tmp/tidemail-agent-cli . python scripts/verify-cli-interactive.py /tmp/tidemail-agent-cli ``` -------------------------------- ### Create plugin.toml manifest Source: https://github.com/allisonhere/tidemail/wiki/Plugin-Getting-Started Manifest file for the plugin. Defines stable id, name, version, API version, command executable, and permissions. The command is relative to the plugin directory and never looked up on $PATH. ```toml id = "example" name = "Example Plugin" version = "0.1.0" api = 1 command = "tidemail-plugin-example" [permissions] message_metadata = true annotations = true ``` -------------------------------- ### Run full quality gate Source: https://github.com/allisonhere/tidemail/blob/main/HANDOVER.md Run these commands to validate the repository after changes. The commands include formatting, building, vetting, testing with race detection, linting, and checking the diff. ```shell gofmt -w . go build ./... go vet ./... go test ./... -race golangci-lint run git diff --check ``` -------------------------------- ### List configured accounts as JSON Source: https://github.com/allisonhere/tidemail/wiki/CLI-reference Reports configured account IDs, names, sender addresses, and the default account. Does not expose passwords or OAuth tokens. ```bash tidemail accounts list --json ``` -------------------------------- ### Implement ping method in Go Source: https://github.com/allisonhere/tidemail/wiki/Plugin-Getting-Started Handles the 'ping' method by returning a response with OK and data. For unsupported methods, sets an error with code 'unsupported_method'. Always exits with status 0; non-zero exit is reported as a crash. ```go resp := response{API: 1, Type: "response", RequestID: req.RequestID} switch req.Method { case "ping": resp.OK, resp.Data = true, map[string]string{"message": "pong"} default: resp.Error = &errorBody{Code: "unsupported_method", Message: req.Method} } json.NewEncoder(os.Stdout).Encode(resp) ``` -------------------------------- ### Preview presentation with tidemail plugin test Source: https://github.com/allisonhere/tidemail/wiki/Plugin-Presentation Commands to preview a plugin's presentation. The first prints a presentation preview; the --verbose flag also prints the raw response JSON. ```sh tidemail plugin test ./my-plugin # prints a presentation preview tidemail plugin test --verbose ./my-plugin # also the raw response JSON ``` -------------------------------- ### Request with settings (JSON) Source: https://github.com/allisonhere/tidemail/blob/main/docs/plugins/settings.md Shows a request object that includes the plugin's settings on every call, including ping and plugin.test. ```json {"api": 1, "type": "request", "request_id": "…", "method": "message.received", "settings": {"mode": "hybrid", "notify_only": true}, "data": {}} ``` -------------------------------- ### Run CI checks before pushing Source: https://github.com/allisonhere/tidemail/blob/main/CONTRIBUTING.md Run these commands locally to match CI checks on every push and pull request. Includes formatting, build, vet, tests with race detector, and linting. ```bash gofmt -w . go build ./... go vet ./... go test ./... -race golangci-lint run ``` -------------------------------- ### Declare message.received event in manifest Source: https://github.com/allisonhere/tidemail/wiki/Plugin-Events Declares the message.received event in the plugin manifest along with required permissions (message_metadata and annotations). The plugin starts disabled; the user must enable it. ```toml events = ["message.received"] [permissions] message_metadata = true annotations = true ``` -------------------------------- ### Fetch a missing public key with gpg --locate-keys Source: https://github.com/allisonhere/tidemail/blob/main/docs/guide.md Use this command to fetch a missing public key for a recipient. It tries the recipient's domain and key servers. ```bash gpg --locate-keys ADDRESS ``` -------------------------------- ### Cron entry to process outbox queue every minute Source: https://github.com/allisonhere/tidemail/wiki/CLI-reference Run the outbox processor once a minute while the client is closed. Use the actual absolute binary path and create the log directory first. Run as the same user with the same configuration and cache paths, and ensure access to the credential store and network. A locked or unavailable keychain can prevent unattended delivery. ```cron * * * * * /home/YOUR_USER/.local/bin/tidemail outbox process --json >> /home/YOUR_USER/.local/state/tidemail-worker.log 2>&1 ``` -------------------------------- ### Add an email address to your own key with gpg --quick-add-uid Source: https://github.com/allisonhere/tidemail/blob/main/docs/guide.md Use this command to add another address of yours to your existing key. It asks for your passphrase, and you should re-publish your public key afterward if you shared it. ```bash gpg --quick-add-uid KEYID "Your Name
" ``` -------------------------------- ### TideMail JSON error envelope Source: https://github.com/allisonhere/tidemail/wiki/CLI-reference Example of the versioned JSON envelope returned on errors, with a machine-readable error code and message. Scripts must check ok and the delivery state rather than treating exit code 0 as proof that a queued message was sent. ```json {"schema_version":1,"ok":false,"error":{"code":"permission_denied","message":"Agent capability mail.send is not enabled."}} ``` -------------------------------- ### CI plugin validation and test Source: https://github.com/allisonhere/tidemail/wiki/Plugin-Developer-Tools A plugin project can use the built TideMail binary in CI. Build the generated Go starter with -buildvcs=false when the checkout is a source directory without Git metadata. ```yaml - run: tidemail plugin validate . - run: tidemail plugin test . ``` -------------------------------- ### Scaffold with custom ID and name Source: https://github.com/allisonhere/tidemail/wiki/Plugin-Developer-Tools Use --id and --name when the directory ID and display name need to differ. ```sh tidemail plugin scaffold --id invoices --name "Invoice Tags" invoice-tagger ``` -------------------------------- ### Plugin directory layout Source: https://github.com/allisonhere/tidemail/wiki/Plugin-Manifest Shows the expected directory structure for TideMail plugins under ~/.config/tidemail/plugins/. Each plugin has its own directory containing a plugin.toml and an executable command. ```text ~/.config/tidemail/plugins/ ($XDG_CONFIG_HOME/tidemail/plugins/) example/ plugin.toml tidemail-plugin-example smart/ plugin.toml tidemail-plugin-smart ``` -------------------------------- ### Opt-in configuration for report.run and analytics_read Source: https://github.com/allisonhere/tidemail/wiki/Plugin-Queries TOML configuration to enable the report.run capability and grant analytics_read permission. The capability alone grants no data access; each query requires its specific permission. ```toml capabilities = ["report.run"] [permissions] analytics_read = true # only what you need; see the table below ``` -------------------------------- ### Send email with piped body, markdown, preview, and dry-run Source: https://github.com/allisonhere/tidemail/wiki/CLI-reference Four send invocations: pipe the body, use a Markdown file with attachments, preview the compose wizard, and validate with --dry-run. Body options are mutually exclusive; without one, a pipe supplies the body. ```bash printf 'Build finished successfully.\n' | tidemail send --to me@example.com --subject "Build report" --yes ``` ```bash tidemail send --to team@example.com --subject "Weekly report" \ --markdown report.md --attach totals.csv --attach chart.png --yes ``` ```bash tidemail send --to me@example.com --subject "Review" \ --body-file message.txt --preview ``` ```bash tidemail send --to me@example.com --subject "Validate" \ --markdown report.md --attach totals.csv --dry-run --json ``` -------------------------------- ### Scaffold a plugin with tidemail plugin scaffold Source: https://github.com/allisonhere/tidemail/wiki/Plugin-Getting-Started Recommended workflow when the TideMail binary is available. Generates a starter plugin that tags subjects containing 'invoice' as 'category=billing'. Commands are headless and do not require configuration, database, mail account, or TUI. ```sh tidemail plugin scaffold invoice-tagger cd invoice-tagger go build -buildvcs=false -o invoice-tagger . tidemail plugin validate . tidemail plugin test . ``` -------------------------------- ### Setting types (text) Source: https://github.com/allisonhere/tidemail/blob/main/docs/plugins/settings.md Lists the three supported setting types: bool, select, and secret. ```text bool select secret ``` -------------------------------- ### Create a draft with tidemail draft create Source: https://github.com/allisonhere/tidemail/wiki/CLI-reference Saves a local draft using the selected account. Accepts message preparation options but not delivery authorization options. The result contains `state: drafted` and the draft ID. ```bash tidemail draft create --account ACCOUNT_ID --to user@example.com \ --subject "Follow-up" --body-file response.md --attach notes.pdf --json ``` -------------------------------- ### Display help for tidemail commands Source: https://github.com/allisonhere/tidemail/wiki/CLI-reference Shows help for the main tidemail command and its subcommands: send, messages, and outbox. ```bash tidemail --help tidemail send --help tidemail messages --help tidemail outbox --help ``` -------------------------------- ### tidemail CLI commands Source: https://github.com/allisonhere/tidemail/wiki/CLI-reference Run `tidemail cli` to open the interactive menu. Bare `send` and incomplete compose commands open the wizard when both stdin and stdout are terminals. Supplied flags prefill fields. `--interactive` explicitly opens an interactive flow, even with piped body text or JSON output. ```bash tidemail cli tidemail send tidemail draft create tidemail send --to me@example.com --interactive printf 'Build finished.\n' | tidemail send --interactive --subject 'Build report' ``` -------------------------------- ### Expected response JSON Source: https://github.com/allisonhere/tidemail/wiki/Plugin-Getting-Started Shows the expected output from the plugin when run with the sample request. Contains the annotation with key 'category' and value 'billing'. ```json {"api":1,"type":"response","request_id":"t1","ok":true,"data":{"annotations":[{"key":"category","value":"billing","confidence":0.9}]}} ``` -------------------------------- ### Send email with draft, queued, and immediate delivery options Source: https://github.com/allisonhere/tidemail/wiki/CLI-reference Three send invocations: save a draft without authorizing, authorize a durable queued send using the configured delay, and persist the send with immediate delivery. The --yes flag authorizes delivery for this invocation only. ```bash # Save a draft without authorizing delivery. tidemail send --account ACCOUNT_ID --to me@example.com \ --subject "Hello" --body "Prepared through TideMail" ``` ```bash # Authorize a durable queued send using the configured delay. tidemail send --account ACCOUNT_ID --to me@example.com \ --subject "Hello" --body "Sent through TideMail" --yes --json ``` ```bash # Persist the send and attempt delivery immediately. tidemail send --account ACCOUNT_ID --to me@example.com \ --subject "Hello" --body "Send now" --send-now --yes --json ``` -------------------------------- ### Test a plugin Source: https://github.com/allisonhere/tidemail/wiki/Plugin-Developer-Tools Runs a real API v1 ping, then metadata and message.received checks when the manifest permits or declares them. Secret values are read from environment variables and never printed. The default test path is offline and does not run plugin.test; use --config-test --allow-network only when explicitly testing a remote configuration check. API v1 is not an OS sandbox, so only test plugins you trust. ```sh tidemail plugin test ./invoice-tagger ``` ```sh tidemail plugin test --metadata ./fixture.json ./invoice-tagger ``` ```sh tidemail plugin test --set mode=local ./invoice-tagger ``` ```sh tidemail plugin test --secret-env api_key=TYPESAFE_API_KEY ./invoice-tagger ``` ```sh tidemail plugin test --json ./invoice-tagger ``` -------------------------------- ### Check for a recipient's public key with gpg --list-keys Source: https://github.com/allisonhere/tidemail/blob/main/docs/guide.md Use this command to verify that a public key exists in your GnuPG keyring for a recipient address. If the key is missing, encryption will not be sent. ```bash gpg --list-keys ADDRESS ``` -------------------------------- ### Multi-line signature in TOML Source: https://github.com/allisonhere/tidemail/wiki/Configuration-files Shows how to write a multi-line signature using a TOML multi-line string, which is easier to read than escape sequences. The signature is a multi-line box in the account form; editing the file by hand works too. ```toml signature = """ Alice Sent with TideMail""" ``` -------------------------------- ### List of available query methods Source: https://github.com/allisonhere/tidemail/wiki/Plugin-Queries Lists all query methods available to plugins: query.messages, query.threads, query.annotations, query.classification, and analytics methods. Every query is an object with a method and its parameters; unknown fields or values cause an invalid_query error. ```text query.messages query.threads query.annotations query.classification analytics.volume analytics.categories analytics.attention analytics.response_times analytics.contacts ``` -------------------------------- ### message.prepare Source: https://github.com/allisonhere/tidemail/wiki/Plugin-Protocol Sent when the user sends a message with Sign or Encrypt on. The plugin performs the cryptographic step and returns a signature or encrypted message. ```APIDOC ## message.prepare ### Description Sent, with the `message_compose` permission, when the user sends a message with Sign or Encrypt on. TideMail builds the MIME entity and the final `multipart/signed` or `multipart/encrypted` message itself; you only perform the cryptographic step. ### Event `message.prepare` ### Payload - **from** (string) - The sender's address, to choose the signing key. - **recipients** (array of strings) - Every To, Cc, and Bcc address; empty when only signing. - **entity** (base64) - The canonical MIME entity to protect (CRLF line endings), exactly the bytes to sign or encrypt. - **sign** (boolean) - Indicates whether signing is requested. - **encrypt** (boolean) - Indicates whether encryption is requested. ### Response Answer with exactly one of the following JSON objects: ```json {"signature": "", "micalg": "pgp-sha256"} ``` or ```json {"encrypted": ""} ``` The first is for `sign` without `encrypt`. The second is for `encrypt`; when `sign` is also true, sign inside the encrypted message. ### Error Handling A reply of the wrong shape (plaintext, or a signature when encryption was asked for) is an error. Any error stops the send: TideMail never falls back to sending the message unprotected. ### Timeout Both methods may wait on a passphrase or smartcard prompt, so they get the manifest's `timeout` (up to 120 seconds) instead of the 5-second default. ``` -------------------------------- ### Manual update window preview text Source: https://github.com/allisonhere/tidemail/wiki/Development-flags Shows the text displayed in the manual update window when using --preview-manual-update. It fakes a pacman-owned tidemail-bin to render the AUR user wording. ```text Update available: v0.0.39 TideMail was installed by pacman as tidemail-bin, so it cannot replace its own binary. Run this outside TideMail: yay -S tidemail-bin c copy esc close ``` -------------------------------- ### API Methods Overview Source: https://github.com/allisonhere/tidemail/blob/main/docs/plugins/protocol.md Lists the seven methods in the TideMail plugin protocol API v1. ```APIDOC ## TideMail Plugin Protocol API v1 ### Methods - `ping` - `message.metadata` - `message.received` - `plugin.test` - `report.run` - `message.decode` - `message.prepare` ``` -------------------------------- ### List, check status, and process outbox queue Source: https://github.com/allisonhere/tidemail/wiki/CLI-reference Use these commands to inspect and process the outbox queue. 'outbox process' attempts due entries and exits, without waiting for future scheduled entries. It connects to SMTP and, for providers that require it, IMAP to append delivered mail to Sent. Multiple instances use atomic database claims to avoid duplicate delivery. ```bash tidemail outbox list --json tidemail outbox status 42 --json tidemail outbox process --json ``` -------------------------------- ### TOML agent_permissions configuration Source: https://github.com/allisonhere/tidemail/wiki/CLI-reference Top-level setting that defines allowed agent capabilities. When absent, defaults to accounts.read, messages.metadata, messages.search, drafts.create, and outbox.read. An explicit empty array denies all agent capabilities. ```toml # Top-level setting, before any [section] or [[accounts]] table. agent_permissions = [ "accounts.read", "messages.metadata", "messages.search", "drafts.create", "outbox.read", ] ``` -------------------------------- ### GnuPG commands for PGP key management Source: https://github.com/allisonhere/tidemail/blob/main/man/tidemail.1 Useful GnuPG commands for managing keys used by the PGP plugin. These commands list, locate, import, and add UIDs to keys. The passphrase prompt comes from GnuPG's pinentry, which must be graphical. ```shell gpg --list-keys ADDRESS gpg --locate-keys ADDRESS gpg --import FILE.asc gpg --quick-add-uid KEYID "Name
" ```