bx Fix broken ASCII diagrams → perfect Unicode box-drawing

Pipe-friendly CLI. Single binary. Zero dependencies.

cat rough.txt | bx fix

Before → After

Input: Rough ASCII
+----------+       +----------+
|  Frontend |----->|   API    |
+----------+       +----------+
                       |
                       v
                  +---------+
                  |  Auth   |
                  +---------+
Output: Clean Unicode
┌──────────┐    ┌─────┐
│ Frontend │───▶│ API │
└──────────┘    └─────┘
                   │
                   ▼
               ┌──────┐
               │ Auth │
               └──────┘

Features

Install

Go
go install github.com/justEstif/bx@latest
mise
mise use -g go:github.com/justEstif/bx@latest
mise reshim
From source
git clone https://github.com/justEstif/bx.git
cd bx && go build -o bx .

Usage

# Fix from stdin
cat rough.txt | bx fix

# Choose style: single (default), rounded, double, bold
echo '...' | bx fix --style rounded

# Fix diagrams inside markdown code blocks
bx fix --markdown README.md

# Fix a file directly
bx fix diagram.txt

Styles

Single (default)
┌──────┐
│ Auth │
└──────┘
Rounded
╭──────╮
│ Auth │
╰──────╯
Double
╔══════╗
║ Auth ║
╚══════╝
Bold
┏━━━━━━┓
┃ Auth ┃
┗━━━━━━┛

Why?

LLMs and humans constantly produce broken ASCII diagrams — misaligned corners, off-by-one edges, inconsistent characters. bx takes that mess and snaps everything into geometrically perfect Unicode box-drawing. Works in terminals and markdown code blocks.