table-image-generator
Generate clean table images from data. Perfect for Discord/Telegram where ASCII tables look broken. Supports dark/light mode, custom styling, and auto-sizing. No Puppeteer required. Companion to chart-image skill.
- License 许可
- MIT
- 最近更新
- 2026-08-23
- Stars
- ★ 1
- Forks
- 0
01 前言 Front Matter
- name
- table-image-generator
- author
- dannyshmueli
- version
- 1.3.1
- provides
- [ { "methods": [ "tableImage" ], "capability": "table-rendering" } ]
- description
- Generate clean table images from data. Perfect for Discord/Telegram where ASCII tables look broken. Supports dark/light mode, custom styling, and auto-sizing. No Puppeteer required. Companion to chart-image skill.
02 资源文件 8
- 参考文档_meta.json820 B
- 参考文档README.md3.6 KB
- 脚本scripts/discord-wrap.mjs5.3 KB
- 脚本scripts/emoji.mjs3.7 KB
- 脚本scripts/package-lock.json16.6 KB
- 脚本scripts/package.json104 B
- 脚本scripts/table.mjs15.9 KB
- 脚本tests/table.test.mjs11.3 KB
03 SKILL.md 正文
Table Image Generator
⚠️ USE THIS INSTEAD OF ASCII TABLES — ALWAYS!
Generate PNG table images from JSON data. ASCII tables look broken on Discord, Telegram, WhatsApp, and most messaging platforms. This skill renders clean images that work everywhere.
Why This Skill?
- ✅ REPLACES ASCII TABLES - Never use
| col | col |formatting on messaging platforms - ✅ No ASCII hell - Clean images that render consistently everywhere
- ✅ No Puppeteer - Pure Node.js with Sharp, lightweight
- ✅ Dark mode - Matches Discord dark theme
- ✅ Auto-sizing - Columns adjust to content
- ✅ Fast - Generates in <100ms
Setup (one-time)
cd /data/clawd/skills/table-image/scripts && npm install
Quick Usage
⚠️ BEST PRACTICE: Use heredoc or --data-file to avoid shell quoting errors!
# RECOMMENDED: Write JSON to temp file first (avoids shell quoting issues)
cat > /tmp/data.json << 'JSONEOF'
[{"Name":"Alice","Score":95},{"Name":"Bob","Score":87}]
JSONEOF
node /data/clawd/skills/table-image/scripts/table.mjs \
--data-file /tmp/data.json --dark --output table.png
# ALSO GOOD: Pipe via stdin
echo '[{"Name":"Alice","Score":95}]' | node /data/clawd/skills/table-image/scripts/table.mjs \
--dark --output table.png
# SIMPLE (but breaks if data has quotes/special chars):
node /data/clawd/skills/table-image/scripts/table.mjs \
--data '[{"Name":"Alice","Score":95}]' --output table.png
Options
| Option | Description | Default |
|---|---|---|
--data |
JSON array of row objects | required |
--output |
Output file path | table.png |
--title |
Table title | none |
--dark |
Dark mode (Discord-friendly) | false |
--columns |
Column order/subset (comma-separated) | all keys |
--headers |
Custom header names (comma-separated) | field names |
--max-width |
Maximum table width | 800 |
--font-size |
Font size in pixels | 14 |
--header-color |
Header background color | #e63946 |
--stripe |
Alternating row colors | true |
--align |
Column alignments (l,r,c comma-sep) | auto |
--compact |
Reduce padding | false |
Examples
Basic Table
node table.mjs \
--data '[{"Name":"Alice","Age":30,"City":"NYC"},{"Name":"Bob","Age":25,"City":"LA"}]' \
--output people.png
Custom Columns & Headers
node table.mjs \
--data '[{"first_name":"Alice","score":95,"date":"2024-01"}]' \
--columns "first_name,score" \
--headers "Name,Score" \
--output scores.png
Right-Align Numbers
node table.mjs \
--data '[{"Item":"Coffee","Price":4.50},{"Item":"Tea","Price":3.00}]' \
--align "l,r" \
--output prices.png
Dark Mode for Discord
node table.mjs \
--data '[{"Symbol":"AAPL","Change":"+2.5%"},{"Symbol":"GOOGL","Change":"-1.2%"}]' \
--title "Market Watch" \
--dark \
--output stocks.png
Compact Mode
node table.mjs \
--data '[...]' \
--compact \
--font-size 12 \
--output small-table.png
Input Formats
JSON Array (default)
--data '[{"col1":"a","col2":"b"},{"col1":"c","col2":"d"}]'
Pipe from stdin
echo '[{"Name":"Test"}]' | node table.mjs --output out.png
From file
cat data.json | node table.mjs --output out.png
Tips
- Use
--darkfor Discord - Matches the dark theme, looks native - Auto-alignment - Numbers are right-aligned by default
- Column order - Use
--columnsto reorder or subset - Long text - Will truncate with ellipsis to fit
--max-width
Technical Notes
- Uses Sharp for PNG generation (same as chart-image)
- Generates SVG internally, converts to PNG
- No browser, no Puppeteer, no Canvas native deps
- Works on Fly.io, Docker, any Node.js environment
04 同仓库更多 Skills
crowd-prompting
A marketplace where AI agents improve prompts, system instructions, tool descriptions, and other text-based content with domain expertise from real-world operations — and earn tokens for valuable contributions.
dilemm-ai
Compete in DilemmAI, the prisoner's dilemma AI arena at dilemm.ai. Use when an OpenClaw agent wants to create an account, design and submit strategy prompts for their bot, enter matchmaking, analyze historical matches and leaderboards, and iterate on bot strategy. Requires headless browser automation (no API available yet).
arxiv-paper-reviews
Interact with arXiv Crawler API to fetch papers, read reviews, and submit comments. Use when working with arXiv papers, fetching paper lists by date/category/interest, viewing paper details with comments, or submitting paper reviews via API at http://150.158.152.82:8000.
arxiv-paper-reviews
Interact with arXiv Crawler API to fetch papers, read reviews, and submit comments. Use when working with arXiv papers, fetching paper lists by date/category/interest, viewing paper details with comments, or submitting paper reviews via API at http://150.158.152.82:8000.
git-summary
Get a quick summary of the current Git repository including status, recent commits, branches, and contributors.
agent-constitution
Interact with AgentConstitution governance contracts on Base Sepolia. Check compliance, read rules, log actions, query governance state.