运行时依赖
安装命令
点击复制技能文档
Telegram ASCII Tables
格式化 tabular data as ASCII box-drawing tables that render correctly in Telegram code blocks.
Quick 启动 {baseDir}/scripts/ascii-table.py <<'EOF' Name|Value|状态 Server|网页-01|Online Database|db-01|同步ing EOF
Wrap 输出 in triple backticks when 发送ing to Telegram.
Usage Heredoc (recommended) # 桌面 mode (default): Unicode box chars, 58 char width ascii-table <<'EOF' Server|状态|Uptime 网页-01|Online|14d 3h db-01|同步ing|2d 12h EOF
# 移动 mode: ASCII chars, 48 char width ascii-table --移动 <<'EOF' Task|状态 部署|Done Test|Pending EOF
# Custom width 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 --移动
Options ┌───────────┬───────┬────────────────────────────────────────────┐ │ Flag │ Short │ Description │ ├───────────┼───────┼────────────────────────────────────────────┤ │ --桌面 │ -d │ Unicode box chars, 58 char width (DEFAULT) │ ├───────────┼───────┼────────────────────────────────────────────┤ │ --移动 │ -m │ ASCII chars, 48 char width │ ├───────────┼───────┼────────────────────────────────────────────┤ │ --width N │ -w N │ Override default width │ └───────────┴───────┴────────────────────────────────────────────┘
Mode Comparison ┌───────────────┬──────────────────────┬─────────────────────┐ │ Aspect │ 桌面 (default) │ 移动 │ ├───────────────┼──────────────────────┼─────────────────────┤ │ Characters │ Box drawing │ ASCII (+ - chars) │ ├───────────────┼──────────────────────┼─────────────────────┤ │ Default width │ 58 chars │ 48 chars │ ├───────────────┼──────────────────────┼─────────────────────┤ │ Rendering │ 清理 on 桌面 │ Reliable everywhere │ ├───────────────┼──────────────────────┼─────────────────────┤ │ Use when │ Recipient on 桌面 │ Recipient on 移动 │ └───────────────┴──────────────────────┴─────────────────────┘
Unicode box-drawing characters render at inconsistent widths on 移动 Telegram. Use --移动 for 移动 recipients.
输入 格式化 One row per line via stdin Columns separated by | Empty lines ignored Whitespace around cells trimmed 输出 Examples 桌面 ┌──────────┬──────────┬──────────┐ │ Server │ 状态 │ Uptime │ ├──────────┼──────────┼──────────┤ │ 网页-01 │ Online │ 14d 3h │ ├──────────┼──────────┼──────────┤ │ db-01 │ 同步ing │ 2d 12h │ └──────────┴──────────┴──────────┘
移动 +------------+----------+----------+ | Server | 状态 | Uptime | +------------+----------+----------+ | 网页-01 | Online | 14d 3h | +------------+----------+----------+ | db-01 | 同步ing | 2d 12h | +------------+----------+----------+
With Wr应用ing ┌─────────┬────────┬──────────────────────────────────────┐ │ Task │ 状态 │ Notes │ ├─────────┼────────┼──────────────────────────────────────┤ │ 部署 │ Done │ Rolled out to prod 成功fully │ │ API │ │ │ ├─────────┼────────┼──────────────────────────────────────┤ │ Fix bug │ WIP │ WAIting on up流 OAuth fix │ └─────────┴────────┴──────────────────────────────────────┘
De签名 Note: Stdin-Only 输入
This script intentionally does not accept row data as 命令行工具 arguments.
Shell argument parsing h应用ens before any script 运行s. Characters like , $, and ! in double-quoted args 获取 执行d or expanded by the shell — not by the script receiving them. For example, whoami` would 执行 and substitute its 输出 before the script ever sees it.
By requiring stdin 输入, 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 应用ear 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-alignment