{"id":51318580,"url":"https://github.com/michaljach/opencode-messages","last_synced_at":"2026-07-01T10:31:17.600Z","repository":{"id":349771839,"uuid":"1203829732","full_name":"michaljach/opencode-messages","owner":"michaljach","description":"OpenCode plugin for controlling OpenCode from iMessage via Messages.dev on iPhone","archived":false,"fork":false,"pushed_at":"2026-04-07T14:26:47.000Z","size":15,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-04-07T14:52:33.530Z","etag":null,"topics":["ai-agent","coding-assistant","developer-tools","imessage","iphone","messages-dev","opencode","opencode-plugin","remote-control","typescript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/michaljach.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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-04-07T12:26:42.000Z","updated_at":"2026-04-07T14:27:09.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/michaljach/opencode-messages","commit_stats":null,"previous_names":["michaljach/opencode-messages"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/michaljach/opencode-messages","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/michaljach%2Fopencode-messages","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/michaljach%2Fopencode-messages/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/michaljach%2Fopencode-messages/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/michaljach%2Fopencode-messages/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/michaljach","download_url":"https://codeload.github.com/michaljach/opencode-messages/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/michaljach%2Fopencode-messages/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":35003452,"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-07-01T02:00:05.325Z","response_time":130,"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","coding-assistant","developer-tools","imessage","iphone","messages-dev","opencode","opencode-plugin","remote-control","typescript"],"created_at":"2026-07-01T10:31:17.009Z","updated_at":"2026-07-01T10:31:17.525Z","avatar_url":"https://github.com/michaljach.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# opencode-messages\n\nInstallable OpenCode plugin package for controlling a running OpenCode instance from your iPhone over iMessage using [Messages.dev](https://www.messages.dev/).\n\nThe package exports `OpencodeMessagesPlugin` and is designed so users can configure everything directly in `opencode.json`.\n\nIf you provide a public tunnel URL, the plugin will create or reuse the Messages.dev webhook automatically. That removes the manual webhook setup step entirely.\n\nIt:\n\n- receives `message.received` webhooks from Messages.dev\n- verifies the webhook signature\n- maps each allowed sender to an OpenCode session\n- sends prompts, slash commands, shell commands, and permission replies into OpenCode\n- sends the resulting assistant response back over iMessage\n\n## What It Supports\n\n- normal prompt messages\n- `/new [title]`\n- `/use \u003csession-id\u003e`\n- `/status`\n- `/abort`\n- `/cmd \u003c/slash-command args\u003e`\n- `/shell \u003ccommand\u003e`\n- `/approve \u003cpermission-id\u003e`\n- `/deny \u003cpermission-id\u003e`\n\n## Quick Start\n\n1. Install the package:\n\n```bash\nnpm install opencode-messages\n```\n\n2. Put this in `opencode.json`:\n\n```json\n{\n  \"$schema\": \"https://opencode.ai/config.json\",\n  \"plugin\": [\"opencode-messages\"],\n  \"opencodeMessages\": {\n    \"apiKey\": \"sk_live_...\",\n    \"line\": \"+15551234567\",\n    \"publicUrl\": \"https://paste-your-tunnel-url-here.trycloudflare.com\",\n    \"allowedSenders\": [\"+15559876543\"]\n  }\n}\n```\n\n3. Start OpenCode in the project.\n4. Expose the local bridge over HTTPS:\n\n```bash\ncloudflared tunnel --url http://127.0.0.1:8787\n```\n\n5. Replace `publicUrl` in `opencode.json` with the tunnel URL that `cloudflared` printed.\n6. Restart OpenCode if it was already running.\n7. Send `/help` from your iPhone.\n\nNo manual Messages.dev webhook creation is needed in this mode.\n\n## Install\n\nPublished package usage in `opencode.json`:\n\n```json\n{\n  \"$schema\": \"https://opencode.ai/config.json\",\n  \"plugin\": [\"opencode-messages\"],\n  \"opencodeMessages\": {\n    \"apiKey\": \"sk_live_...\",\n    \"line\": \"+15551234567\",\n    \"publicUrl\": \"https://your-tunnel-url.trycloudflare.com\",\n    \"allowedSenders\": [\"+15559876543\"]\n  }\n}\n```\n\nThat is the lowest-friction setup path because users already need this file for the plugin entry.\n\n## Manual Setup\n\nYou can also use environment variables instead of `opencode.json`:\n\n```bash\nexport OPENCODE_MESSAGES_API_KEY=\"sk_live_...\"\nexport OPENCODE_MESSAGES_LINE=\"+15551234567\"\nexport OPENCODE_MESSAGES_PUBLIC_URL=\"https://your-tunnel-url.trycloudflare.com\"\nexport OPENCODE_MESSAGES_ALLOWED_SENDERS=\"+15559876543\"\n```\n\nIf you do not want the plugin to auto-manage the webhook, you can still configure a webhook yourself and provide a secret manually:\n\n```bash\nexport OPENCODE_MESSAGES_WEBHOOK_SECRET=\"whsec_...\"\n```\n\nOptional overrides:\n\n```bash\nexport OPENCODE_MESSAGES_HOST=\"127.0.0.1\"\nexport OPENCODE_MESSAGES_PORT=\"8787\"\nexport OPENCODE_MESSAGES_WEBHOOK_PATH=\"/opencode-messages/webhook\"\nexport OPENCODE_MESSAGES_STATE_FILE=\".opencode/opencode-messages-state.json\"\nexport OPENCODE_MESSAGES_MAX_CHUNK_CHARS=\"1800\"\n```\n\n## Package Layout\n\n- `index.ts`: source for the package plugin entrypoint\n- `dist/index.js`: built plugin entrypoint published to npm\n- `.opencode/plugins/opencode-messages.ts`: local development wrapper that re-exports the package plugin\n\n## Notes\n\n- The plugin reads `opencode.json` from the `opencodeMessages` block, and environment variables override file values when both are present.\n- The plugin accepts both the new `OPENCODE_MESSAGES_*` variables and the older `OPENCODE_MESSAGES_DEV_*` names for compatibility.\n- `publicUrl` is the preferred setup path. When present, the plugin creates or reuses the Messages.dev webhook automatically.\n- The plugin only accepts senders listed in `allowedSenders` or `OPENCODE_MESSAGES_ALLOWED_SENDERS`.\n- If you do not want secrets in `opencode.json`, use environment variables instead.\n- State is persisted in `.opencode/opencode-messages-state.json` so sender-to-session mappings survive restarts.\n- Permission prompts from OpenCode are sent back to iMessage, and you can reply with `/approve \u003cid\u003e` or `/deny \u003cid\u003e`.\n- Incoming webhooks must reach the machine running OpenCode. Messages.dev requires an HTTPS endpoint for webhook delivery.\n\n## Health Check\n\nThe plugin exposes a local health endpoint:\n\n```text\nGET /health\n```\n\nExample:\n\n```bash\ncurl http://127.0.0.1:8787/health\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmichaljach%2Fopencode-messages","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmichaljach%2Fopencode-messages","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmichaljach%2Fopencode-messages/lists"}