| name | telegram-ascii-table |
| description | Format tabular data as ASCII box tables for Telegram. Stdin-only input eliminates shell injection risks. Handles smart column sizing, text wrapping, and proper padding for monospace display. |
Telegram ASCII Tables
Format tabular data as ASCII box-drawing tables that render correctly in Telegram code blocks.
Quick Start
{baseDir}/scripts/ascii-table.py <<'EOF'
Name|Value|Status
Server|web-01|Online
Database|db-01|Syncing
EOF
Wrap output in triple backticks when sending to Telegram.
Usage
Heredoc (recommended)
ascii-table <<'EOF'
Server|Status|Uptime
web-01|Online|14d 3h
db-01|Syncing|2d 12h
EOF
ascii-table --mobile <<'EOF'
Task|Status
Deploy|Done
Test|Pending
EOF
ascii-table --width 80 <<'EOF'
Column|Another Column
data|more data
EOF
Pipe
cat data.txt | ascii-table
echo -e 'Name|Value\nRow1|Data1' | ascii-table
some-command | ascii-table --mobile
Options
┌───────────┬───────┬────────────────────────────────────────────┐
│ Flag │ Short │ Description │
├───────────┼───────┼────────────────────────────────────────────┤
│ --desktop │ -d │ Unicode box chars, 58 char width (DEFAULT) │
├───────────┼───────┼────────────────────────────────────────────┤
│ --mobile │ -m │ ASCII chars, 48 char width │
├───────────┼───────┼────────────────────────────────────────────┤
│ --width N │ -w N │ Override default width │
└───────────┴───────┴────────────────────────────────────────────┘