<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>Kitty图形协议 | 锤子前端</title><description>Now vibe coding, so learning hammer FE ?</description><link>https://channel.meo-ai.com</link><item><title>《在本地终端预览OpenGraph卡片》</title><link>https://channel.meo-ai.com/posts/602</link><guid isPermaLink="true">https://channel.meo-ai.com/posts/602</guid><pubDate>Sat, 18 Apr 2026 08:39:56 GMT</pubDate><content:encoded>&lt;span class=&quot;post-title-source&quot;&gt;《在本地终端预览OpenGraph卡片》&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;标签：&lt;a href=&quot;/search/result?q=%23%E5%89%8D%E7%AB%AF&quot; title=&quot;#前端&quot;&gt;#前端&lt;/a&gt; &lt;a href=&quot;/search/result?q=%23OpenGraph&quot; title=&quot;#OpenGraph&quot;&gt;#OpenGraph&lt;/a&gt; &lt;a href=&quot;/search/result?q=%23CLI%E5%B7%A5%E5%85%B7&quot; title=&quot;#CLI工具&quot;&gt;#CLI工具&lt;/a&gt; &lt;a href=&quot;/search/result?q=%23Zig&quot; title=&quot;#Zig&quot;&gt;#Zig&lt;/a&gt; &lt;a href=&quot;/search/result?q=%23Kitty%E5%9B%BE%E5%BD%A2%E5%8D%8F%E8%AE%AE&quot; title=&quot;#Kitty图形协议&quot;&gt;#Kitty图形协议&lt;/a&gt; &lt;a href=&quot;/search/result?q=%23%E5%BC%80%E5%8F%91%E5%B7%A5%E5%85%B7&quot; title=&quot;#开发工具&quot;&gt;#开发工具&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;总结：&lt;br /&gt;作者为解决OpenGraph调试痛点，开发了CLI工具&lt;code&gt;og-check&lt;/code&gt;，可直接在终端内渲染本地开发环境的OG卡片预览，无需部署到公网或使用隧道服务。工具基于Zig编写，支持Kitty图形协议在终端内显示图片，并提供OpenGraph、Twitter Card、表格和JSON四种输出格式，同时可作为CI检查工具确保OG标签完整性。&lt;br /&gt;&lt;br /&gt;文章要点：&lt;br /&gt;- 传统OG调试流程繁琐：需要部署到公网或使用隧道工具，且Facebook等平台的调试器缓存机制会导致反复迭代困难&lt;br /&gt;- &lt;code&gt;og-check&lt;/code&gt;支持在本地终端直接预览OG卡片，包含图片渲染，将反馈周期从分钟级缩短到秒级&lt;br /&gt;- 终端图片渲染基于Kitty图形协议，兼容Ghostty、iTerm2、WezTerm等主流终端，不支持的终端会自动降级为文本输出&lt;br /&gt;- 工具内部使用Zig的&lt;code&gt;std.http.Client&lt;/code&gt;抓取页面，解析meta标签并按命名空间分类（og:、twitter:等），通过zigdown渲染Markdown到终端&lt;br /&gt;- 提供四种输出模式：OpenGraph预览（默认）、Twitter Card预览、表格视图、JSON格式，后者支持管道操作（如配合jq使用）&lt;br /&gt;- 具备校验功能：当缺少必需的OG字段（title、type、image、url）时会输出错误并返回非零退出码，适合集成到CI流程作为布局模板检查&lt;br /&gt;- 安装方式灵活：支持预编译二进制、源码编译（Zig 0.15+）和mise工具管理&lt;br /&gt;&lt;br /&gt;文章URL：&lt;a href=&quot;https://simonhartcher.com/posts/2026-04-15-testing-opengraph-on-localhost-from-the-cli/&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot; title=&quot;https://simonhartcher.com/posts/2026-04-15-testing-opengraph-on-localhost-from-the-cli/&quot;&gt;https://simonhartcher.com/posts/2026-04-15-testing-opengraph-on-localhost-from-the-cli/&lt;/a&gt;&lt;a class=&quot;tgme_widget_message_link_preview&quot; href=&quot;https://simonhartcher.com/posts/2026-04-15-testing-opengraph-on-localhost-from-the-cli&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot; title=&quot;og-check fetches a URL and renders its OpenGraph and Twitter Card metadata directly in your terminal, images and all. Point it at localhost and skip the tunnel.&quot;&gt;
  
  &lt;div class=&quot;link_preview_site_name accent_color&quot;&gt;Simon Hartcher&lt;/div&gt;
  &lt;img class=&quot;link_preview_image&quot; alt=&quot;Testing OpenGraph on localhost from the CLI before you go public | Simon Hartcher&quot; src=&quot;/static/https://cdn4.telesco.pe/file/Ai-97E7GvAgxwag_beQJlkJCsxZj6bIjoR3S3AgoPLvfcnzZMyR-XVXuo6wRE-PVhwmckjCqWVXVc5DGN-m2_gl9GwO7irjjVQupvdk9MjfoB1Vw2XL4tWwv4lo8vi0PdEgso14pNC4wav98YQaLTwxR5GD9R4HPexShcqjx2e7AzLIXqVzZ0hCbfQavrXOeg127ysD_k-RePyLFKSlHwqZjO7fk2gokkxTxBBunk-C3BAwCSYBuNjkGJnnMeyketNlb46_Ur_-dnJdGRJigGVPj7YMj3BeumDhIbTPdQjYxh91OlZ0q4_9my9JWCj3TOJR-dLDx6EhJ2KIy2jmjwA.jpg&quot; width=&quot;1200&quot; height=&quot;630&quot; loading=&quot;eager&quot; /&gt;
  &lt;div class=&quot;link_preview_title&quot;&gt;Testing OpenGraph on localhost from the CLI before you go public | Simon Hartcher&lt;/div&gt;
  &lt;div class=&quot;link_preview_description&quot;&gt;og-check fetches a URL and renders its OpenGraph and Twitter Card metadata directly in your terminal, images and all. Point it at localhost and skip the tunnel.&lt;/div&gt;
&lt;/a&gt;</content:encoded></item></channel></rss>