{"id":52059637,"url":"https://github.com/jtemporal/sharepreview","last_synced_at":"2026-08-02T21:30:50.720Z","repository":{"id":369382646,"uuid":"1289597829","full_name":"jtemporal/sharepreview","owner":"jtemporal","description":"Preview Open Graph share cards from localhost — X, LinkedIn, Facebook, Slack, and more. Agent-friendly CLI with JSON output for dev workflows.","archived":false,"fork":false,"pushed_at":"2026-07-05T01:39:41.000Z","size":35,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-07-05T03:15:10.928Z","etag":null,"topics":["agents","ai-agents","cli","developer-tools","jekyll","linkedin","localhost","metadata","nodejs","og-image","open-graph","opengraph","seo","share-cards","social-preview","static-site","twitter-cards"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/jtemporal.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","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},"funding":{"buy_me_a_coffee":"jesstemporal"}},"created_at":"2026-07-05T00:45:39.000Z","updated_at":"2026-07-05T01:39:45.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/jtemporal/sharepreview","commit_stats":null,"previous_names":["jtemporal/sharepreview"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/jtemporal/sharepreview","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jtemporal%2Fsharepreview","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jtemporal%2Fsharepreview/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jtemporal%2Fsharepreview/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jtemporal%2Fsharepreview/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jtemporal","download_url":"https://codeload.github.com/jtemporal/sharepreview/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jtemporal%2Fsharepreview/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":36210045,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-07-20T02:08:10.276Z","status":"online","status_checked_at":"2026-08-02T02:00:06.915Z","response_time":58,"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":["agents","ai-agents","cli","developer-tools","jekyll","linkedin","localhost","metadata","nodejs","og-image","open-graph","opengraph","seo","share-cards","social-preview","static-site","twitter-cards"],"created_at":"2026-08-02T21:30:50.098Z","updated_at":"2026-08-02T21:30:50.715Z","avatar_url":"https://github.com/jtemporal.png","language":"JavaScript","funding_links":["https://buymeacoffee.com/jesstemporal"],"categories":[],"sub_categories":[],"readme":"# sharepreview\n\nPreview Open Graph share cards from a **localhost URL** — the way they look when shared on X/Twitter, LinkedIn, or Slack.\n\nBuilt for developers and AI agents working on static sites, blogs, and apps with local preview servers.\n\n**This is a local development tool.** It is not meant to be hosted publicly, tunneled, or pointed at untrusted URLs. The preview server binds to `127.0.0.1` only and all outbound fetches are restricted to localhost.\n\n## Install\n\n```bash\ngit clone \u003cyour-remote\u003e/sharepreview.git\ncd sharepreview\nnpm link\n```\n\nOr run directly:\n\n```bash\nnode bin/sharepreview.mjs http://127.0.0.1:4000/my-post/\n```\n\nRequires **Node 18+**. Zero runtime dependencies.\n\nUse whatever port your dev server runs on (`4000`, `4321`, `5173`, etc.) — sharepreview only checks that the host is localhost.\n\n## Usage\n\n```bash\n# Start your site preview first (Jekyll, Astro, etc.)\nbundle exec jekyll serve --port 4000\n\n# Launch share preview on a separate port (default :4711)\nsharepreview http://127.0.0.1:4000/my-post/\n\n# Agent-friendly JSON output\nsharepreview http://127.0.0.1:4000/my-post/ --json\n\n# Fail when required OG tags are missing\nsharepreview http://127.0.0.1:4000/my-post/ --validate\n\n# Open the preview in your browser\nsharepreview http://127.0.0.1:4000/my-post/ --open\n\n# Save a PNG of the preview page (requires puppeteer)\nnpm install puppeteer\nsharepreview http://127.0.0.1:4000/my-post/ --screenshot my-post-share.png\n```\n\nThe CLI fetches your page, extracts `og:*` and `twitter:*` meta tags, checks `og:image` dimensions, then serves a share-card mock UI on `http://127.0.0.1:4711/` (or the next free port).\n\nThe preview page includes:\n\n- X/Twitter, LinkedIn, Facebook, Slack, Discord, and iMessage mocks\n- Light/dark mode toggle\n- Validation banner for missing tags or image warnings\n- Collapsible extracted metadata JSON\n\nWhile the preview server is running:\n\n- **Another page** — paste a new localhost URL in the Source field and click **Load**\n- **Same page, updated OG tags** — click **Refresh** (or reload the tab)\n\nNo need to stop and restart the CLI. Agents can switch pages with:\n\n```bash\ncurl -X POST http://127.0.0.1:4711/source \\\n  -H 'Content-Type: application/json' \\\n  -d '{\"url\":\"http://127.0.0.1:4000/another-post/\"}'\n```\n\nPress **Ctrl+C** to stop the preview server.\n\nRun tests:\n\n```bash\nnpm test\n```\n\n## Agent skills\n\nInstall the bundled skill for your agent:\n\n```bash\nsharepreview install-skill --target grok\nsharepreview install-skill --target cursor\nsharepreview install-skill --target claude\n```\n\nThe skill lives at `skills/sharepreview/SKILL.md` and documents the preview workflow for agents.\n\n## JSON output\n\n```json\n{\n  \"source_url\": \"http://127.0.0.1:4000/my-post/\",\n  \"preview_url\": \"http://127.0.0.1:4711/\",\n  \"preview_port\": 4711,\n  \"valid\": true,\n  \"missing\": [],\n  \"og\": {\n    \"title\": \"My post\",\n    \"description\": \"…\",\n    \"image\": \"http://127.0.0.1:4000/images/og/my-post.png\",\n    \"url\": \"http://127.0.0.1:4000/my-post/\",\n    \"type\": \"article\",\n    \"site_name\": \"My Site\"\n  },\n  \"twitter\": {\n    \"card\": \"summary_large_image\",\n    \"title\": \"My post\",\n    \"description\": \"…\",\n    \"image\": \"http://127.0.0.1:4000/images/og/my-post.png\"\n  },\n  \"warnings\": []\n}\n```\n\n## Security\n\nsharepreview is hardened for **local-only** use:\n\n| Guard | What it does |\n|-------|----------------|\n| **Localhost-only fetches** | Source pages, `og:image`, and the image proxy only accept `http://127.0.0.1`, `http://localhost`, or `http://[::1]` |\n| **Redirect validation** | Each redirect hop is checked — a public URL cannot redirect you to an internal address |\n| **Timeouts** | Fetches abort after 10 seconds |\n| **Size limits** | HTML capped at 5 MB; images at 20 MB |\n| **Loopback bind** | Preview server listens on `127.0.0.1` only |\n\nDo **not** expose the preview server to the internet (ngrok, Cloudflare Tunnel, `0.0.0.0` bind, etc.). If you ever host a shared version, that would need a separate design with authentication and stricter sandboxing.\n\n`og:image` must resolve to a localhost URL (relative paths are fine — they resolve against your dev server). External CDN images are intentionally not fetched.\n\n## How it differs from other tools\n\n| Tool | What you get |\n|------|----------------|\n| Opening `images/og/foo.png` | Raw card image only |\n| `ogpk` / `og-check` | Terminal meta dump + inline image |\n| Facebook/Twitter debuggers | Requires a public URL |\n| **sharepreview** | Full share-card mock from localhost + agent JSON |\n\n## Links\n\n- Author: [Jessica Temporal](https://jtemporal.com)\n- Repository: [github.com/jtemporal/sharepreview](https://github.com/jtemporal/sharepreview)\n- Support: [buymeacoffee.com/jesstemporal](https://buymeacoffee.com/jesstemporal)\n\n## License\n\nMIT","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjtemporal%2Fsharepreview","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjtemporal%2Fsharepreview","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjtemporal%2Fsharepreview/lists"}