---
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
```bash
{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)
```bash
# Desktop mode (default): Unicode box chars, 58 char width
ascii-table <<'EOF'
Server|Status|Uptime
web-01|Online|14d 3h
db-01|Syncing|2d 12h
EOF
# Mobile mode: ASCII chars, 48 char width
ascii-table --mobile <<'EOF'
Task|Status
Deploy|Done
Test|Pending
EOF
# Custom width
ascii-table --width 80 <<'EOF'
Column|Another Column
data|more data
EOF
```
### Pipe
```bash
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 ā
āāāāāāāāāāāāā“āāāāāāāā“āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
```
## Mode Comparison
```
āāāāāāāāāāāāāāāāā¬āāāāāāāāāāāāāāāāāāāāāāā¬āāāāāāāāāāāāāāāāāāāāāā
ā Aspect ā Desktop (default) ā Mobile ā
āāāāāāāāāāāāāāāāā¼āāāāāāāāāāāāāāāāāāāāāāā¼āāāāāāāāāāāāāāāāāāāāāā¤
ā Characters ā Box drawing ā ASCII (+ - chars) ā
āāāāāāāāāāāāāāāāā¼āāāāāāāāāāāāāāāāāāāāāāā¼āāāāāāāāāāāāāāāāāāāāāā¤
ā Default width ā 58 chars ā 48 chars ā
āāāāāāāāāāāāāāāāā¼āāāāāāāāāāāāāāāāāāāāāāā¼āāāāāāāāāāāāāāāāāāāāāā¤
ā Rendering ā Clean on desktop ā Reliable everywhere ā
āāāāāāāāāāāāāāāāā¼āāāāāāāāāāāāāāāāāāāāāāā¼āāāāāāāāāāāāāāāāāāāāāā¤
ā Use when ā Recipient on desktop ā Recipient on mobile ā
āāāāāāāāāāāāāāāāā“āāāāāāāāāāāāāāāāāāāāāāā“āāāāāāāāāāāāāāāāāāāāāā
```
Unicode box-drawing characters render at inconsistent widths on mobile Telegram. Use `--mobile` for mobile recipients.
## Input Format
- One row per line via stdin
- Columns separated by `|`
- Empty lines ignored
- Whitespace around cells trimmed
## Output Examples
### Desktop
```
āāāāāāāāāāāā¬āāāāāāāāāāā¬āāāāāāāāāāā
ā Server ā Status ā Uptime ā
āāāāāāāāāāāā¼āāāāāāāāāāā¼āāāāāāāāāāā¤
ā web-01 ā Online ā 14d 3h ā
āāāāāāāāāāāā¼āāāāāāāāāāā¼āāāāāāāāāāā¤
ā db-01 ā Syncing ā 2d 12h ā
āāāāāāāāāāāā“āāāāāāāāāāā“āāāāāāāāāāā
```
### Mobile
```
+------------+----------+----------+
| Server | Status | Uptime |
+------------+----------+----------+
| web-01 | Online | 14d 3h |
+------------+----------+----------+
| db-01 | Syncing | 2d 12h |
+------------+----------+----------+
```
### With Wrapping
```
āāāāāāāāāāā¬āāāāāāāāā¬āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
ā Task ā Status ā Notes ā
āāāāāāāāāāā¼āāāāāāāāā¼āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā¤
ā Deploy ā Done ā Rolled out to prod successfully ā
ā API ā ā ā
āāāāāāāāāāā¼āāāāāāāāā¼āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā¤
ā Fix bug ā WIP ā Waiting on upstream OAuth fix ā
āāāāāāāāāāā“āāāāāāāāā“āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
```
## Design Note: Stdin-Only Input
This script intentionally does not accept row data as CLI arguments.
Shell argument parsing happens *before* any script runs. Characters like `` ` ``, `
OpenClaw Resources Directory ā Skills, Tools, Plugins & Guides | The Claw Guy
, and `!` in double-quoted args get executed or expanded by the shell ā not by the script receiving them. For example, `` `whoami` `` would execute and substitute its output before the script ever sees it.
By requiring stdin input, user data bypasses shell parsing entirely. A quoted heredoc (`<<'EOF'`) passes everything through literally ā no escaping needed, no execution possible.
## Limitations
- **Pipe delimiter** ā `|` separates columns (cannot appear in cell content)
- **Word breaks** ā long words may split mid-word
- **Wide characters** ā emoji/CJK may cause alignment issues
- **Left-aligned only** ā no numeric right-alignmentBackend architecture patterns, API design, database
Query Copilot Money personal finance data
The agent gives you the ability to extract data
The Analytics Engine for Moltbook.