{"id":50999655,"url":"https://github.com/btafoya/postmark-send","last_synced_at":"2026-06-20T13:03:50.098Z","repository":{"id":365637013,"uuid":"1273042202","full_name":"btafoya/postmark-send","owner":"btafoya","description":"CLI tool for sending email via Postmark. Designed for AI agents: JSON stdin/stdout, env token auth, interactive setup.","archived":false,"fork":false,"pushed_at":"2026-06-18T07:37:26.000Z","size":7,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-06-18T08:25:14.207Z","etag":null,"topics":["ai-agent","automation","cli","email","go","postmark"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/btafoya.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-06-18T06:48:15.000Z","updated_at":"2026-06-18T07:40:46.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/btafoya/postmark-send","commit_stats":null,"previous_names":["btafoya/postmark-send"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/btafoya/postmark-send","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/btafoya%2Fpostmark-send","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/btafoya%2Fpostmark-send/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/btafoya%2Fpostmark-send/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/btafoya%2Fpostmark-send/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/btafoya","download_url":"https://codeload.github.com/btafoya/postmark-send/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/btafoya%2Fpostmark-send/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34570542,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-20T02:00:06.407Z","response_time":98,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai-agent","automation","cli","email","go","postmark"],"created_at":"2026-06-20T13:03:49.435Z","updated_at":"2026-06-20T13:03:50.085Z","avatar_url":"https://github.com/btafoya.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# postmark-send\n\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)\n[![Go Version](https://img.shields.io/github/go-mod/go-version/btafoya/postmark-send)](go.mod)\n[![Postmark](https://img.shields.io/badge/Postmark-API-blue)](https://postmarkapp.com)\n[![Built with Go](https://img.shields.io/badge/Built%20with-Go-00ADD8.svg)](https://go.dev)\n\nCLI tool for sending email via [Postmark](https://postmarkapp.com). Built to be called by AI agents — all output is newline-delimited JSON, errors included, exit codes are reliable.\n\n---\n\n## Requirements\n\n- Go 1.21+\n- A Postmark account with a Server API Token\n\n## Install\n\nThe fastest way is with `go install`:\n\n```bash\ngo install github.com/btafoya/postmark-send@v0.1.0\n```\n\nThe binary is installed to `$GOPATH/bin` or `~/go/bin` by default. Make sure that directory is on your `PATH`.\n\nOr install the latest untagged commit:\n\n```bash\nGOPROXY=direct go install github.com/btafoya/postmark-send@latest\n```\n\nOr clone and build from source:\n\n```bash\ngit clone https://github.com/btafoya/postmark-send\ncd postmark-send\ngo build -o postmark-send .\n```\n\n## Setup\n\nRun the interactive setup to save your API token to `~/.bashrc`:\n\n```bash\n./postmark-send --setup\n# Postmark API token: \u003cpaste token\u003e\n# Saved. Run: source ~/.bashrc\nsource ~/.bashrc\n```\n\nOr set it manually:\n\n```bash\nexport POSTMARK_API_TOKEN=your_server_token\n```\n\n---\n\n## Usage\n\n### Flags (human / scripted use)\n\n```bash\n./postmark-send \\\n  --from sender@example.com \\\n  --to recipient@example.com \\\n  --subject \"Hello\" \\\n  --text \"Plain text body\" \\\n  --html \"\u003cb\u003eHTML body\u003c/b\u003e\" \\\n  --tag onboarding\n```\n\n`--from`, `--to`, and `--subject` are required. At least one of `--text` or `--html` is required. `--tag` is optional.\n\n### JSON stdin (AI agent use)\n\nPass a single JSON object on stdin with `--json`:\n\n```bash\necho '{\n  \"from\": \"sender@example.com\",\n  \"to\": \"recipient@example.com\",\n  \"subject\": \"Hello\",\n  \"text\": \"Plain text body\",\n  \"html\": \"\u003cb\u003eHTML body\u003c/b\u003e\",\n  \"tag\": \"onboarding\"\n}' | ./postmark-send --json\n```\n\n---\n\n## Output\n\nAll output is JSON on stdout. **Never parse stderr** — errors are on stdout as `{\"error\":\"...\"}`.\n\n**Success:**\n```json\n{\"message_id\":\"abc-123-def\",\"to\":\"recipient@example.com\"}\n```\n\n**Error:**\n```json\n{\"error\":\"--from, --to, and --subject are required\"}\n```\n\nExit code `0` = success. Exit code `1` = error (check the `error` field).\n\n---\n\n## For AI Agents\n\nUse the `--json` flag and pipe a JSON object on stdin. Check the output for an `error` field before assuming success.\n\n### Send an email\n\n```bash\necho '{\"from\":\"you@example.com\",\"to\":\"them@example.com\",\"subject\":\"Hello\",\"text\":\"Hi there\"}' \\\n  | ./postmark-send --json\n```\n\n### Check the result\n\n```bash\nresult=$(echo '{\"from\":\"you@example.com\",\"to\":\"them@example.com\",\"subject\":\"Hello\",\"text\":\"Hi there\"}' \\\n  | ./postmark-send --json)\n\nif echo \"$result\" | grep -q '\"error\"'; then\n  echo \"Failed: $result\"\nelse\n  echo \"Sent. Message ID: $(echo \"$result\" | grep -o '\"message_id\":\"[^\"]*\"')\"\nfi\n```\n\n### With HTML body\n\n```bash\necho '{\n  \"from\": \"you@example.com\",\n  \"to\": \"them@example.com\",\n  \"subject\": \"Hello\",\n  \"text\": \"Hi there\",\n  \"html\": \"\u003cp\u003eHi there\u003c/p\u003e\",\n  \"tag\": \"welcome\"\n}' | ./postmark-send --json\n```\n\n### Expected output\n\nSuccess:\n```json\n{\"message_id\":\"abc-123\",\"to\":\"them@example.com\"}\n```\n\nFailure:\n```json\n{\"error\":\"POSTMARK_API_TOKEN not set — run with --setup or: export POSTMARK_API_TOKEN=your_token\"}\n```\n\nExit code `0` = sent. Exit code `1` = not sent.\n\n---\n\n## Flags reference\n\n| Flag | Description |\n|------|-------------|\n| `--from` | Sender email address |\n| `--to` | Recipient email address |\n| `--subject` | Email subject line |\n| `--text` | Plain text body |\n| `--html` | HTML body |\n| `--tag` | Postmark message tag (optional) |\n| `--json` | Read all fields from JSON on stdin instead of flags |\n| `--setup` | Interactive setup: writes `POSTMARK_API_TOKEN` to `~/.bashrc` |\n\n## JSON schema (stdin mode)\n\n```json\n{\n  \"from\":    \"string (required)\",\n  \"to\":      \"string (required)\",\n  \"subject\": \"string (required)\",\n  \"text\":    \"string (required if no html)\",\n  \"html\":    \"string (required if no text)\",\n  \"tag\":     \"string (optional)\"\n}\n```\n\n---\n\n## License\n\nMIT — see [LICENSE](LICENSE).\n\nBuilt on [mattevans/postmark-go](https://github.com/mattevans/postmark-go).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbtafoya%2Fpostmark-send","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbtafoya%2Fpostmark-send","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbtafoya%2Fpostmark-send/lists"}