{/* This page is auto-generated from the skill's SKILL.md by website/scripts/generate-skill-docs.py. Edit the source SKILL.md, not this page. */}

Ascii Art

ASCII 艺术:pyfiglet、cowsay、boxes、图片转 ASCII。

Skill 元数据

来源可选 — 通过 hermes skills install official/creative/ascii-art 安装
路径optional-skills/creative/ascii-art
版本4.0.0
作者0xbyt4, Hermes Agent
许可证MIT
平台linux, macos, windows
标签ASCII, Art, Banners, Creative, Unicode, Text-Art, pyfiglet, figlet, cowsay, boxes
相关 skillexcalidraw

参考:完整 SKILL.md

INFO

以下是 Hermes 在触发本 skill 时加载的完整 skill 定义。这是 agent 在 skill 激活时所看到的指令内容。

ASCII Art Skill

面向不同 ASCII 艺术需求的多种工具。所有工具都是本地 CLI 程序或免费 REST API——无需 API 密钥。

工具 1:文字横幅(pyfiglet — 本地)

把文字渲染成大号 ASCII 艺术横幅。内置 571 种字体。

安装

pip install pyfiglet --break-system-packages -q

用法

python -m pyfiglet "YOUR TEXT" -f slant
python -m pyfiglet "TEXT" -f doom -w 80    # Set width
python -m pyfiglet --list_fonts             # List all 571 fonts

推荐字体

风格字体最适合
干净现代slant项目名、标题
粗厚方块doom标题、logo
大号易读big横幅
经典横幅banner3宽幅展示
紧凑small副标题
赛博朋克cyberlarge科技主题
3D 效果3-d启动画面
哥特gothic戏剧性文字

技巧

  • 预览 2-3 种字体,让用户挑最喜欢的
  • 短文本(1-8 字符)最适合 doom 或 block 这类细节丰富的字体
  • 长文本更适合 small 或 mini 这类紧凑字体

工具 2:文字横幅(asciified API — 远程,无需安装)

免费 REST API,把文字转成 ASCII 艺术。250+ FIGlet 字体。直接返回纯文本——无需解析。当 pyfiglet 未安装,或想快速替代时使用。

用法(通过终端 curl)

# Basic text banner (default font)
curl -s "https://asciified.thelicato.io/api/v2/ascii?text=Hello+World"

# With a specific font
curl -s "https://asciified.thelicato.io/api/v2/ascii?text=Hello&font=Slant"
curl -s "https://asciified.thelicato.io/api/v2/ascii?text=Hello&font=Doom"
curl -s "https://asciified.thelicato.io/api/v2/ascii?text=Hello&font=Star+Wars"
curl -s "https://asciified.thelicato.io/api/v2/ascii?text=Hello&font=3-D"
curl -s "https://asciified.thelicato.io/api/v2/ascii?text=Hello&font=Banner3"

# List all available fonts (returns JSON array)
curl -s "https://asciified.thelicato.io/api/v2/fonts"

技巧

  • 在 text 参数中用 + 表示 URL 编码的空格
  • 响应是纯文本 ASCII 艺术——没有 JSON 包裹,可直接显示
  • 字体名区分大小写;用 fonts 端点获取准确名称
  • 任何带 curl 的终端都能用——无需 Python 或 pip

工具 3:Cowsay(消息艺术)

经典工具,用一个 ASCII 字符把文字包进对话气泡里。

安装

sudo apt install cowsay -y    # Debian/Ubuntu
# brew install cowsay         # macOS

用法

cowsay "Hello World"
cowsay -f tux "Linux rules"       # Tux the penguin
cowsay -f dragon "Rawr!"          # Dragon
cowsay -f stegosaurus "Roar!"     # Stegosaurus
cowthink "Hmm..."                  # Thought bubble
cowsay -l                          # List all characters

可用角色(50+)

beavis.zen, bong, bunny, cheese, daemon, default, dragon, dragon-and-cow, elephant, eyes, flaming-skull, ghostbusters, hellokitty, kiss, kitty, koala, luke-koala, mech-and-cow, meow, moofasa, moose, ren, sheep, skeleton, small, stegosaurus, stimpy, supermilker, surgery, three-eyes, turkey, turtle, tux, udder, vader, vader-koala, www

眼睛/舌头修饰符

cowsay -b "Borg"       # =_= eyes
cowsay -d "Dead"       # x_x eyes
cowsay -g "Greedy"     # $_$ eyes
cowsay -p "Paranoid"   # @_@ eyes
cowsay -s "Stoned"     # *_* eyes
cowsay -w "Wired"      # O_O eyes
cowsay -e "OO" "Msg"   # Custom eyes
cowsay -T "U " "Msg"   # Custom tongue

工具 4:Boxes(装饰边框)

在任意文字周围画出装饰性 ASCII 边框/外框。内置 70+ 种设计。

安装

sudo apt install boxes -y    # Debian/Ubuntu
# brew install boxes         # macOS

用法

echo "Hello World" | boxes                    # Default box
echo "Hello World" | boxes -d stone           # Stone border
echo "Hello World" | boxes -d parchment       # Parchment scroll
echo "Hello World" | boxes -d cat             # Cat border
echo "Hello World" | boxes -d dog             # Dog border
echo "Hello World" | boxes -d unicornsay      # Unicorn
echo "Hello World" | boxes -d diamonds        # Diamond pattern
echo "Hello World" | boxes -d c-cmt           # C-style comment
echo "Hello World" | boxes -d html-cmt        # HTML comment
echo "Hello World" | boxes -a c               # Center text
boxes -l                                       # List all 70+ designs

与 pyfiglet 或 asciified 组合

python -m pyfiglet "HERMES" -f slant | boxes -d stone
# Or without pyfiglet installed:
curl -s "https://asciified.thelicato.io/api/v2/ascii?text=HERMES&font=Slant" | boxes -d stone

工具 5:TOIlet(彩色文字艺术)

类似 pyfiglet,但带 ANSI 颜色效果和视觉滤镜。适合做终端里的养眼装饰。

安装

sudo apt install toilet toilet-fonts -y    # Debian/Ubuntu
# brew install toilet                      # macOS

用法

toilet "Hello World"                    # Basic text art
toilet -f bigmono12 "Hello"            # Specific font
toilet --gay "Rainbow!"                 # Rainbow coloring
toilet --metal "Metal!"                 # Metallic effect
toilet -F border "Bordered"             # Add border
toilet -F border --gay "Fancy!"         # Combined effects
toilet -f pagga "Block"                 # Block-style font (unique to toilet)
toilet -F list                          # List available filters

滤镜

crop, gay(彩虹), metal, flip, flop, 180, left, right, border

注意:toilet 输出带颜色的 ANSI 转义码——在终端里能用,但并非所有场合都能正确渲染(例如纯文本文件、某些聊天平台)。

工具 6:图片转 ASCII 艺术

把图片(PNG、JPEG、GIF、WEBP)转成 ASCII 艺术。

选项 A:ascii-image-converter(推荐,现代)

# Install
sudo snap install ascii-image-converter
# OR: go install github.com/TheZoraiz/ascii-image-converter@latest
ascii-image-converter image.png                  # Basic
ascii-image-converter image.png -C               # Color output
ascii-image-converter image.png -d 60,30         # Set dimensions
ascii-image-converter image.png -b               # Braille characters
ascii-image-converter image.png -n               # Negative/inverted
ascii-image-converter https://url/image.jpg      # Direct URL
ascii-image-converter image.png --save-txt out   # Save as text

选项 B:jp2a(轻量,仅 JPEG)

sudo apt install jp2a -y
jp2a --width=80 image.jpg
jp2a --colors image.jpg              # Colorized

工具 7:搜索现成 ASCII 艺术

从网上搜索精选的 ASCII 艺术。用 terminal 配合 curl。

来源 A:ascii.co.uk(推荐用于现成作品)

大量经典 ASCII 艺术,按主题分类。作品位于 HTML <pre> 标签内。用 curl 抓取页面,再用一小段 Python 提取作品。

URL 模式: https://ascii.co.uk/art/{subject}

第 1 步 — 抓取页面:

curl -s 'https://ascii.co.uk/art/cat' -o ~/.hermes/cache/scratch/ascii_art.html

第 2 步 — 从 pre 标签提取作品:

import os, re, html
with open(os.path.expanduser('~/.hermes/cache/scratch/ascii_art.html')) as f:
    text = f.read()
arts = re.findall(r'<pre[^>]*>(.*?)</pre>', text, re.DOTALL)
for art in arts:
    clean = re.sub(r'<[^>]+>', '', art)
    clean = html.unescape(clean).strip()
    if len(clean) > 30:
        print(clean)
        print('\n---\n')

可用主题(用作 URL 路径):

  • 动物:cat, dog, horse, bird, fish, dragon, snake, rabbit, elephant, dolphin, butterfly, owl, wolf, bear, penguin, turtle
  • 物品:car, ship, airplane, rocket, guitar, computer, coffee, beer, cake, house, castle, sword, crown, key
  • 自然:tree, flower, sun, moon, star, mountain, ocean, rainbow
  • 角色:skull, robot, angel, wizard, pirate, ninja, alien
  • 节日:christmas, halloween, valentine

技巧:

  • 保留作者签名/首字母——这是重要礼节
  • 每页有多件作品——为用户挑最好的一件
  • 通过 curl 可靠工作,无需 JavaScript

来源 B:GitHub Octocat API(有趣的彩蛋)

返回一个随机的 GitHub Octocat 配一句睿智语录。无需鉴权。

curl -s https://api.github.com/octocat

工具 8:趣味 ASCII 小工具(通过 curl)

这些免费服务直接返回 ASCII 艺术——适合做有趣的小点缀。

二维码转 ASCII 艺术

curl -s "qrenco.de/Hello+World"
curl -s "qrenco.de/https://example.com"

天气转 ASCII 艺术

curl -s "wttr.in/London"          # Full weather report with ASCII graphics
curl -s "wttr.in/Moon"            # Moon phase in ASCII art
curl -s "v2.wttr.in/London"       # Detailed version

工具 9:LLM 生成自定义艺术(回退方案)

当以上工具都满足需求时,直接用这些 Unicode 字符生成 ASCII 艺术:

字符调色板

制表框线字符: ╔ ╗ ╚ ╝ ║ ═ ╠ ╣ ╦ ╩ ╬ ┌ ┐ └ ┘ │ ─ ├ ┤ ┬ ┴ ┼ ╭ ╮ ╰ ╯

块元素: ░ ▒ ▓ █ ▄ ▀ ▌ ▐ ▖ ▗ ▘ ▝ ▚ ▞

几何与符号: ◆ ◇ ◈ ● ○ ◉ ■ □ ▲ △ ▼ ▽ ★ ☆ ✦ ✧ ◀ ▶ ◁ ▷ ⬡ ⬢ ⌂

规则

  • 最大宽度:每行 60 字符(终端安全)
  • 最大高度:横幅 15 行,场景 25 行
  • 仅等宽:输出必须在固定宽度字体下正确渲染

决策流程

  1. 把文字做成横幅 → 装了 pyfiglet 就用它,否则用 curl 调 asciified API
  2. 把一条消息包进有趣的角色艺术里 → cowsay
  3. 加装饰边框/外框 → boxes(可与 pyfiglet/asciified 组合)
  4. 某个具体事物的艺术(猫、火箭、龙)→ 用 curl 抓 ascii.co.uk 并解析
  5. 把图片转成 ASCII → ascii-image-converter 或 jp2a
  6. 二维码 → 用 curl 调 qrenco.de
  7. 天气/月亮艺术 → 用 curl 调 wttr.in
  8. 自定义/有创意的内容 → 用 Unicode 调色板让 LLM 生成
  9. 任一工具未安装 → 安装它,或回退到下一个选项