<?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: Victor Vlr</title>
    <description>The latest articles on DEV Community by Victor Vlr (@victorvlr).</description>
    <link>https://dev.to/victorvlr</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%2F4275396%2F2c6fe47a-c353-4193-be70-1a1082d94b66.png</url>
      <title>DEV Community: Victor Vlr</title>
      <link>https://dev.to/victorvlr</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/victorvlr"/>
    <language>en</language>
    <item>
      <title>PixKit: a local toolkit for Brazilian Pix BR Code payloads</title>
      <dc:creator>Victor Vlr</dc:creator>
      <pubDate>Tue, 01 Dec 2026 03:51:06 +0000</pubDate>
      <link>https://dev.to/victorvlr/pixkit-a-local-toolkit-for-brazilian-pix-br-code-payloads-36g3</link>
      <guid>https://dev.to/victorvlr/pixkit-a-local-toolkit-for-brazilian-pix-br-code-payloads-36g3</guid>
      <description>&lt;p&gt;Pix is Brazil's instant payment system. The string you paste into a bank app — &lt;em&gt;Copia e Cola&lt;/em&gt; — is a BR Code, an EMV payload with a CRC at the end. Getting that string wrong is easy: a bad CRC, a merchant name that overflows the 25-character ASCII limit, a city with an accent left in, or a key in the wrong shape.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/victorvlr/pixkit" rel="noopener noreferrer"&gt;PixKit&lt;/a&gt; is a small MIT-licensed toolkit that builds, parses, and validates those payloads on your machine. It ships as a TypeScript library, a CLI, a stdio MCP server for coding agents, and an agent skill.&lt;/p&gt;

&lt;h2&gt;
  
  
  What it is not
&lt;/h2&gt;

&lt;p&gt;PixKit is not a payment service provider. It does not move money, and it never talks to a bank, the DICT, or Banco Central APIs. If someone pays a payload you generated, the funds are credited to the bank or PSP that owns the Pix key you put in. Withdrawal happens in that institution's app, not in this tool.&lt;/p&gt;

&lt;p&gt;It also does not create dynamic charges (the EMV field 26-25 location URL). Those can be parsed and validated, but generating them requires a PSP. CPF and CNPJ checks are format-only: punctuation and length, not check digits.&lt;/p&gt;

&lt;p&gt;The library is ESM-only. There is no CommonJS &lt;code&gt;require()&lt;/code&gt; export.&lt;/p&gt;

&lt;h2&gt;
  
  
  Install (not on npm yet)
&lt;/h2&gt;

&lt;p&gt;The unscoped name &lt;code&gt;pixkit&lt;/code&gt; is already taken on npm by an unrelated placeholder, so this project will publish as &lt;code&gt;pixkit-br&lt;/code&gt;. Until that release, install from GitHub (the &lt;code&gt;prepare&lt;/code&gt; script builds &lt;code&gt;dist&lt;/code&gt;, so the CLI works):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm install github:victorvlr/pixkit

npx pixkit-br generate \
  --key 123e4567-e12b-12d1-a456-426655440000 \
  --name &lt;span class="s2"&gt;"Fulano de Tal"&lt;/span&gt; \
  --city BRASILIA
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That command reproduces the official static example from the Banco Central &lt;em&gt;Manual de Padrões para Iniciação do Pix&lt;/em&gt; (§2.6.3), including CRC &lt;code&gt;1D3D&lt;/code&gt;. Node.js 20+ is required.&lt;/p&gt;

&lt;p&gt;A one-shot run, without adding a dependency:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npx -y --package github:victorvlr/pixkit pixkit-br generate \
  --key 123e4567-e12b-12d1-a456-426655440000 \
  --name &lt;span class="s2"&gt;"Fulano de Tal"&lt;/span&gt; \
  --city BRASILIA
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Library
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;generateStaticPix&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;parsePix&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;validatePix&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;generateQr&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="s1"&gt;'pixkit-br'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;payload&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;generateStaticPix&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="n"&gt;key&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'123e4567-e12b-12d1-a456-426655440000'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;merchantName&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'Fulano de Tal'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;merchantCity&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'Brasília'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="c1"&gt;// accents are stripped → "Brasilia"&lt;/span&gt;
  &lt;span class="n"&gt;amount&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mf"&gt;10.5&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;txid&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'PEDIDO42'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;parsed&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;parsePix&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;payload&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;valid&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;issues&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;validatePix&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;payload&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;svg&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;generateQr&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;payload&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;format&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'svg'&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Supported key types follow the manual §2.5.1: EVP (UUID), e-mail, CPF, CNPJ (numeric or alphanumeric), and &lt;code&gt;+55&lt;/code&gt; phone numbers. Names and cities are normalized to a restricted ASCII subset. CRC-16/CCITT-FALSE is computed over the payload including the &lt;code&gt;6304&lt;/code&gt; header.&lt;/p&gt;

&lt;h2&gt;
  
  
  MCP server and skill
&lt;/h2&gt;

&lt;p&gt;For Claude Code, Cursor, Codex, or any other stdio MCP client, the tools are &lt;code&gt;pix_generate&lt;/code&gt;, &lt;code&gt;pix_parse&lt;/code&gt;, &lt;code&gt;pix_validate&lt;/code&gt;, and &lt;code&gt;pix_qr&lt;/code&gt;. Today the config that works is:&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;"mcpServers"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nl"&gt;"pixkit"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="nl"&gt;"command"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"npx"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="nl"&gt;"args"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"-y"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"--package"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"github:victorvlr/pixkit"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"pixkit-mcp"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After the npm release, switch the package argument to &lt;code&gt;pixkit-br&lt;/code&gt;. The skill lives in &lt;code&gt;skills/pixkit/SKILL.md&lt;/code&gt; and tells the agent to call PixKit instead of inventing a BR Code by hand.&lt;/p&gt;

&lt;h2&gt;
  
  
  CLI
&lt;/h2&gt;

&lt;p&gt;The same operations are available from the terminal. Quote the payload when you parse or validate it; if the shell splits a pasted string, the CLI joins the pieces with spaces so names like &lt;code&gt;Fulano de Tal&lt;/code&gt; survive.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npx pixkit-br parse &lt;span class="s2"&gt;"000201..."&lt;/span&gt;
npx pixkit-br validate &lt;span class="s2"&gt;"000201..."&lt;/span&gt;
npx pixkit-br qr &lt;span class="s2"&gt;"000201..."&lt;/span&gt; --out qr.png
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Generated payloads are cross-checked in CI against the &lt;code&gt;pix-utils&lt;/code&gt; parser and an independent Python EMV/CRC reference. QR PNGs are decoded back with jsQR.&lt;/p&gt;

&lt;h2&gt;
  
  
  Try it, then tell me what's wrong
&lt;/h2&gt;

&lt;p&gt;The repo is at &lt;a href="https://github.com/victorvlr/pixkit" rel="noopener noreferrer"&gt;github.com/victorvlr/pixkit&lt;/a&gt;. If you integrate Pix in production, I would like to hear what the static generator is still missing.&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>typescript</category>
      <category>opensource</category>
      <category>mcp</category>
    </item>
  </channel>
</rss>
