跳到主要內容

ASCII 藝術

使用 pyfiglet(571 種字體)、cowsay、boxes、toilet、image-to-ascii、遠程 API(asciified、ascii.co.uk)以及 LLM 回退方案生成 ASCII 藝術。無需 API 密鑰。

技能元數據

來源捆綁(默認安裝)
路徑skills/creative/ascii-art
版本4.0.0
作者0xbyt4, Hermes Agent
許可證MIT
標籤ASCII, Art, Banners, Creative, Unicode, Text-Art, pyfiglet, figlet, cowsay, boxes
相關技能excalidraw

參考:完整 SKILL.md

信息

以下是 Hermes 在觸發此技能時加載的完整技能定義。這是技能激活時代理看到的指令。

ASCII 藝術技能

多種工具滿足不同的 ASCII 藝術需求。所有工具均為本地 CLI 程序或免費 REST API — 無需 API 密鑰。

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

將文本渲染為大型 ASCII 藝術橫幅。內置 571 種字體。

設置

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

用法

python3 -m pyfiglet "YOUR TEXT" -f slant
python3 -m pyfiglet "TEXT" -f doom -w 80 # Set width
python3 -m pyfiglet --list_fonts # List all 571 fonts
風格字體最佳用途
簡潔現代slant項目名稱、標題
粗體塊狀doom標題、Logo
大而清晰big橫幅
經典橫幅banner3寬屏顯示
緊湊small副標題
賽博朋克cyberlarge科技主題
3D 效果3-d啟動畫面
哥特式gothic戲劇性文本

提示

  • 預覽 2-3 種字體,讓用戶選擇他們最喜歡的
  • 短文本(1-8 個字符)最適合使用 doomblock 等細節豐富的字體
  • 長文本更適合使用 smallmini 等緊湊字體

工具 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 結合使用

python3 -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 藝術。

# 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 藝術。使用帶有 curlterminal

大型經典 ASCII 藝術收藏庫,按主題分類。藝術內容位於 HTML <pre> tags. Fetch the page with curl, then extract art with a small Python snippet.

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

Step 1 — Fetch the page:

curl -s 'https://ascii.co.uk/art/cat' -o /tmp/ascii_art.html

Step 2 — Extract art from pre tags:

import re, html
with open('/tmp/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')

Available subjects (use as URL path):

  • Animals: cat, dog, horse, bird, fish, dragon, snake, rabbit, elephant, dolphin, butterfly, owl, wolf, bear, penguin, turtle
  • Objects: car, ship, airplane, rocket, guitar, computer, coffee, beer, cake, house, castle, sword, crown, key
  • Nature: tree, flower, sun, moon, star, mountain, ocean, rainbow
  • Characters: skull, robot, angel, wizard, pirate, ninja, alien
  • Holidays: christmas, halloween, valentine

Tips:

  • Preserve artist signatures/initials — important etiquette
  • Multiple art pieces per page — pick the best one for the user
  • Works reliably via curl, no JavaScript needed

Source B: GitHub Octocat API (fun easter egg)

Returns a random GitHub Octocat with a wise quote. No auth needed.

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

Tool 8: Fun ASCII Utilities (via curl)

These free services return ASCII art directly — great for fun extras.

QR Codes as ASCII Art

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

Weather as ASCII Art

curl -s "wttr.in/London"          # 帶有 ASCII 圖形的完整天氣報告
curl -s "wttr.in/Moon" # ASCII 藝術月相
curl -s "v2.wttr.in/London" # 詳細版本

工具 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. 任何未安裝的工具 → 安裝它,或回退到下一個選項