<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: zimmer</title>
    <description>The latest articles on DEV Community by zimmer (@zimmer_c).</description>
    <link>https://dev.to/zimmer_c</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4075935%2F7d6beaa7-78fb-4138-83cb-fc67699c9004.jpeg</url>
      <title>DEV Community: zimmer</title>
      <link>https://dev.to/zimmer_c</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/zimmer_c"/>
    <language>en</language>
    <item>
      <title>Let Codex, Claude Code, and Cursor Compress Images with PiPic</title>
      <dc:creator>zimmer</dc:creator>
      <pubDate>Thu, 13 Aug 2026 09:00:53 +0000</pubDate>
      <link>https://dev.to/zimmer_c/let-codex-claude-code-and-cursor-compress-images-with-pipic-5bim</link>
      <guid>https://dev.to/zimmer_c/let-codex-claude-code-and-cursor-compress-images-with-pipic-5bim</guid>
      <description>&lt;p&gt;Your coding agent can run a build and edit the code that ships it. Image&lt;br&gt;
compression often ends with a tool installation, a throwaway script and output the&lt;br&gt;
agent cannot interpret reliably.&lt;/p&gt;

&lt;p&gt;PiPic uses a two-part setup instead:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;code&gt;@pipic/cli&lt;/code&gt; performs the image compression.&lt;/li&gt;
&lt;li&gt;PiPic Skill teaches the agent when and how to call that CLI.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;PiPic is not an AI compression model. The agent operates the tool; the hosted PiPic&lt;br&gt;
service compresses PNG, JPEG, WebP and AVIF files.&lt;/p&gt;
&lt;h2&gt;
  
  
  Install the CLI and Skill
&lt;/h2&gt;

&lt;p&gt;Run the setup yourself once:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm i &lt;span class="nt"&gt;-g&lt;/span&gt; @pipic/cli
pipic login

npx skills add PiPic-cc/pipic-cli &lt;span class="nt"&gt;-g&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-a&lt;/span&gt; claude-code &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-a&lt;/span&gt; codex &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-a&lt;/span&gt; cursor &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-y&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The short form below asks which supported agents should receive the Skill:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npx skills add PiPic-cc/pipic-cli &lt;span class="nt"&gt;-g&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The Skill source is public in the&lt;br&gt;
&lt;a href="https://github.com/PiPic-cc/pipic-cli/blob/main/skills/pipic/SKILL.md" rel="noopener noreferrer"&gt;PiPic CLI repository&lt;/a&gt;.&lt;/p&gt;
&lt;h2&gt;
  
  
  Ask in plain English
&lt;/h2&gt;

&lt;p&gt;After setup, the task does not need a product name or flags:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Compress the images in ./assets in place.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The Skill matches image compression, shrinking and optimisation requests. It checks&lt;br&gt;
that &lt;code&gt;pipic&lt;/code&gt; exists and that the machine is signed in. “In place” gives it an&lt;br&gt;
explicit destination, so the agent runs:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;pipic ./assets &lt;span class="nt"&gt;--replace&lt;/span&gt; &lt;span class="nt"&gt;--json&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To preserve the originals, ask for a separate output directory. The agent then uses:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;pipic ./assets &lt;span class="nt"&gt;-o&lt;/span&gt; ./compressed &lt;span class="nt"&gt;--json&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;--replace&lt;/code&gt; and &lt;code&gt;-o&lt;/code&gt; are mutually exclusive, and one is required. PiPic exits with&lt;br&gt;
a usage error before uploading anything when the destination is missing.&lt;/p&gt;
&lt;h2&gt;
  
  
  Give the agent a result it can parse
&lt;/h2&gt;

&lt;p&gt;With &lt;code&gt;--json&lt;/code&gt;, stdout contains one NDJSON object per file:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nl"&gt;"file"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="s2"&gt;"assets/hero.png"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="nl"&gt;"status"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="s2"&gt;"ok"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="nl"&gt;"before"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="mi"&gt;2316198&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="nl"&gt;"after"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="mi"&gt;723577&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="nl"&gt;"saved"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="mi"&gt;1592621&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Those byte counts come from a published PiPic Agent CLI 1.0.6 benchmark run over a&lt;br&gt;
licensed PNG. They demonstrate the output shape; results vary by image.&lt;/p&gt;

&lt;p&gt;Every row has &lt;code&gt;file&lt;/code&gt;, &lt;code&gt;status&lt;/code&gt;, &lt;code&gt;before&lt;/code&gt;, &lt;code&gt;after&lt;/code&gt; and &lt;code&gt;saved&lt;/code&gt;. Skipped and failed rows&lt;br&gt;
also include &lt;code&gt;error&lt;/code&gt;. &lt;code&gt;status&lt;/code&gt; is always one of:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;ok&lt;/code&gt;: a smaller result was written.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;skipped&lt;/code&gt;: the original stayed in place, often because the result was larger.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;error&lt;/code&gt;: the file failed and may need attention.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The Skill explicitly teaches the agent that &lt;code&gt;skipped&lt;/code&gt; is not a failure. Without that&lt;br&gt;
rule, an agent can report an already-optimised image as broken.&lt;/p&gt;

&lt;h2&gt;
  
  
  Branch on exit codes
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Code&lt;/th&gt;
&lt;th&gt;Meaning&lt;/th&gt;
&lt;th&gt;What the agent does&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;0&lt;/td&gt;
&lt;td&gt;Everything succeeded&lt;/td&gt;
&lt;td&gt;Summarises the rows and stops&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;td&gt;Some files failed&lt;/td&gt;
&lt;td&gt;Re-runs only paths with &lt;code&gt;status: "error"&lt;/code&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2&lt;/td&gt;
&lt;td&gt;Usage error&lt;/td&gt;
&lt;td&gt;Fixes the command instead of repeating it&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;3&lt;/td&gt;
&lt;td&gt;Sign-in required&lt;/td&gt;
&lt;td&gt;Stops and asks the user to sign in&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;4&lt;/td&gt;
&lt;td&gt;Monthly allowance exhausted&lt;/td&gt;
&lt;td&gt;Stops; a retry cannot help&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Retry scope matters because every accepted file uses monthly allowance. If two files&lt;br&gt;
fail in a 100-file directory, re-running the entire directory uploads the other 98&lt;br&gt;
again. The Skill tells the agent to retry only the two failed paths.&lt;/p&gt;

&lt;p&gt;It also tells the agent never to run &lt;code&gt;pipic login&lt;/code&gt;. That command opens a browser or&lt;br&gt;
waits for device-code approval. A coding agent cannot provide the human approval and&lt;br&gt;
should stop instead of waiting for a timeout.&lt;/p&gt;

&lt;h2&gt;
  
  
  Know what each part does
&lt;/h2&gt;

&lt;p&gt;PiPic Skill is an instruction file. It does not contain an encoder or transport&lt;br&gt;
image bytes. The CLI resolves files, calls the hosted compression service, writes&lt;br&gt;
smaller output atomically and returns structured results.&lt;/p&gt;

&lt;p&gt;The remote MCP endpoint is separate and read-only. It helps agents discover the CLI&lt;br&gt;
and HTTP API; images do not move through JSON-RPC.&lt;/p&gt;

&lt;p&gt;CLI images leave the machine for processing and are deleted from the server as soon&lt;br&gt;
as compression completes. Teams that require local-only processing should choose a&lt;br&gt;
local encoder. PiPic CLI and API offer 100 images per month on Free and 5,000 on Pro;&lt;br&gt;
the browser compressor remains free, unlimited and account-free.&lt;/p&gt;

&lt;p&gt;Full contract: &lt;a href="https://pipic.cc/cli" rel="noopener noreferrer"&gt;PiPic Agent CLI documentation&lt;/a&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>tooling</category>
      <category>automation</category>
      <category>opensource</category>
    </item>
  </channel>
</rss>
