fix: overhaul ascii-art skill with working sources (#662)
Major issues fixed: - Removed dead APIs: artii.herokuapp.com (404 since Heroku free tier ended 2022), patorjk.com TAAG AJAX endpoint (404) - Removed unusable sources: emojicombos.com (3.3MB JS blob, not curl-accessible), asciiart.eu (art loads via JavaScript only) New working sources added: - asciified API (asciified.thelicato.io): free text-to-ASCII REST API, 250+ FIGlet fonts, returns plain text, no auth — perfect remote alternative when pyfiglet isn't installed - ascii.co.uk: classic ASCII art archive, art in <pre> tags, extractable with simple curl + Python parsing - qrenco.de: QR codes as ASCII art via curl - wttr.in: weather and moon phase as ASCII art via curl Also fixed: Tool 6 no longer relies on web_extract inside execute_code (which was the original #662 bug). All web lookups now use terminal curl which is universally available.
This commit is contained in:
parent
192501528f
commit
7c30ac2141
1 changed files with 103 additions and 73 deletions
|
|
@ -1,7 +1,7 @@
|
||||||
---
|
---
|
||||||
name: ascii-art
|
name: ascii-art
|
||||||
description: Generate ASCII art using pyfiglet (571 fonts), cowsay, boxes, toilet, image-to-ascii conversion, and search curated art from emojicombos.com and asciiart.eu (11,000+ artworks). Falls back to LLM-generated art.
|
description: Generate ASCII art using pyfiglet (571 fonts), cowsay, boxes, toilet, image-to-ascii, remote APIs (asciified, ascii.co.uk), and LLM fallback. No API keys required.
|
||||||
version: 3.1.0
|
version: 4.0.0
|
||||||
author: 0xbyt4, Hermes Agent
|
author: 0xbyt4, Hermes Agent
|
||||||
license: MIT
|
license: MIT
|
||||||
dependencies: []
|
dependencies: []
|
||||||
|
|
@ -14,9 +14,9 @@ metadata:
|
||||||
|
|
||||||
# ASCII Art Skill
|
# ASCII Art Skill
|
||||||
|
|
||||||
Multiple tools for different ASCII art needs. All tools are local CLI programs — no API keys required.
|
Multiple tools for different ASCII art needs. All tools are local CLI programs or free REST APIs — no API keys required.
|
||||||
|
|
||||||
## Tool 1: Text Banners (pyfiglet)
|
## Tool 1: Text Banners (pyfiglet — local)
|
||||||
|
|
||||||
Render text as large ASCII art banners. 571 built-in fonts.
|
Render text as large ASCII art banners. 571 built-in fonts.
|
||||||
|
|
||||||
|
|
@ -53,7 +53,35 @@ python3 -m pyfiglet --list_fonts # List all 571 fonts
|
||||||
- Short text (1-8 chars) works best with detailed fonts like `doom` or `block`
|
- Short text (1-8 chars) works best with detailed fonts like `doom` or `block`
|
||||||
- Long text works better with compact fonts like `small` or `mini`
|
- Long text works better with compact fonts like `small` or `mini`
|
||||||
|
|
||||||
## Tool 2: Cowsay (Message Art)
|
## Tool 2: Text Banners (asciified API — remote, no install)
|
||||||
|
|
||||||
|
Free REST API that converts text to ASCII art. 250+ FIGlet fonts. Returns plain text directly — no parsing needed. Use this when pyfiglet is not installed or as a quick alternative.
|
||||||
|
|
||||||
|
### Usage (via terminal curl)
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# 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"
|
||||||
|
```
|
||||||
|
|
||||||
|
### Tips
|
||||||
|
|
||||||
|
- URL-encode spaces as `+` in the text parameter
|
||||||
|
- The response is plain text ASCII art — no JSON wrapping, ready to display
|
||||||
|
- Font names are case-sensitive; use the fonts endpoint to get exact names
|
||||||
|
- Works from any terminal with curl — no Python or pip needed
|
||||||
|
|
||||||
|
## Tool 3: Cowsay (Message Art)
|
||||||
|
|
||||||
Classic tool that wraps text in a speech bubble with an ASCII character.
|
Classic tool that wraps text in a speech bubble with an ASCII character.
|
||||||
|
|
||||||
|
|
@ -97,7 +125,7 @@ cowsay -e "OO" "Msg" # Custom eyes
|
||||||
cowsay -T "U " "Msg" # Custom tongue
|
cowsay -T "U " "Msg" # Custom tongue
|
||||||
```
|
```
|
||||||
|
|
||||||
## Tool 3: Boxes (Decorative Borders)
|
## Tool 4: Boxes (Decorative Borders)
|
||||||
|
|
||||||
Draw decorative ASCII art borders/frames around any text. 70+ built-in designs.
|
Draw decorative ASCII art borders/frames around any text. 70+ built-in designs.
|
||||||
|
|
||||||
|
|
@ -124,13 +152,15 @@ echo "Hello World" | boxes -a c # Center text
|
||||||
boxes -l # List all 70+ designs
|
boxes -l # List all 70+ designs
|
||||||
```
|
```
|
||||||
|
|
||||||
### Combine with pyfiglet
|
### Combine with pyfiglet or asciified
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
python3 -m pyfiglet "HERMES" -f slant | boxes -d stone
|
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
|
||||||
```
|
```
|
||||||
|
|
||||||
## Tool 4: TOIlet (Colored Text Art)
|
## Tool 5: TOIlet (Colored Text Art)
|
||||||
|
|
||||||
Like pyfiglet but with ANSI color effects and visual filters. Great for terminal eye candy.
|
Like pyfiglet but with ANSI color effects and visual filters. Great for terminal eye candy.
|
||||||
|
|
||||||
|
|
@ -160,14 +190,14 @@ toilet -F list # List available filters
|
||||||
|
|
||||||
**Note**: toilet outputs ANSI escape codes for colors — works in terminals but may not render in all contexts (e.g., plain text files, some chat platforms).
|
**Note**: toilet outputs ANSI escape codes for colors — works in terminals but may not render in all contexts (e.g., plain text files, some chat platforms).
|
||||||
|
|
||||||
## Tool 5: Image to ASCII Art
|
## Tool 6: Image to ASCII Art
|
||||||
|
|
||||||
Convert images (PNG, JPEG, GIF, WEBP) to ASCII art.
|
Convert images (PNG, JPEG, GIF, WEBP) to ASCII art.
|
||||||
|
|
||||||
### Option A: ascii-image-converter (recommended, modern)
|
### Option A: ascii-image-converter (recommended, modern)
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# Install via snap or Go
|
# Install
|
||||||
sudo snap install ascii-image-converter
|
sudo snap install ascii-image-converter
|
||||||
# OR: go install github.com/TheZoraiz/ascii-image-converter@latest
|
# OR: go install github.com/TheZoraiz/ascii-image-converter@latest
|
||||||
```
|
```
|
||||||
|
|
@ -190,63 +220,77 @@ jp2a --width=80 image.jpg
|
||||||
jp2a --colors image.jpg # Colorized
|
jp2a --colors image.jpg # Colorized
|
||||||
```
|
```
|
||||||
|
|
||||||
## Tool 6: Search Pre-Made ASCII Art (Web APIs)
|
## Tool 7: Search Pre-Made ASCII Art
|
||||||
|
|
||||||
Search curated ASCII art databases via `web_extract`. No API keys needed.
|
Search curated ASCII art from the web. Use `terminal` with `curl`.
|
||||||
|
|
||||||
### Source A: emojicombos.com (recommended first)
|
### Source A: ascii.co.uk (recommended for pre-made art)
|
||||||
|
|
||||||
Huge collection of ASCII art, dot art, kaomoji, and emoji combos. Modern, meme-aware, user-submitted content. Great for pop culture, animals, objects, aesthetics.
|
Large collection of classic ASCII art organized by subject. Art is inside HTML `<pre>` tags. Fetch the page with curl, then extract art with a small Python snippet.
|
||||||
|
|
||||||
**URL pattern:** `https://emojicombos.com/{term}-ascii-art`
|
**URL pattern:** `https://ascii.co.uk/art/{subject}`
|
||||||
|
|
||||||
|
**Step 1 — Fetch the page:**
|
||||||
|
|
||||||
|
```bash
|
||||||
|
curl -s 'https://ascii.co.uk/art/cat' -o /tmp/ascii_art.html
|
||||||
```
|
```
|
||||||
web_extract(urls=["https://emojicombos.com/cat-ascii-art"])
|
|
||||||
web_extract(urls=["https://emojicombos.com/rocket-ascii-art"])
|
**Step 2 — Extract art from pre tags:**
|
||||||
web_extract(urls=["https://emojicombos.com/dragon-ascii-art"])
|
|
||||||
web_extract(urls=["https://emojicombos.com/skull-ascii-art"])
|
```python
|
||||||
web_extract(urls=["https://emojicombos.com/heart-ascii-art"])
|
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:**
|
**Tips:**
|
||||||
- Use hyphenated search terms: `hello-kitty-ascii-art`, `star-wars-ascii-art`
|
- Preserve artist signatures/initials — important etiquette
|
||||||
- Returns a mix of classic ASCII, Braille dot art, and kaomoji — pick the best style for the user
|
- Multiple art pieces per page — pick the best one for the user
|
||||||
- Includes modern meme art and pop culture references
|
- Works reliably via curl, no JavaScript needed
|
||||||
- Great for kaomoji/emoticons too: `https://emojicombos.com/cat-kaomoji`
|
|
||||||
|
|
||||||
### Source B: asciiart.eu (classic archive)
|
### Source B: GitHub Octocat API (fun easter egg)
|
||||||
|
|
||||||
11,000+ classic ASCII artworks organized by category. More traditional/vintage art.
|
Returns a random GitHub Octocat with a wise quote. No auth needed.
|
||||||
|
|
||||||
**Browse by category** (use as URL paths):
|
|
||||||
- `animals/cats`, `animals/dogs`, `animals/birds`, `animals/horses`
|
|
||||||
- `animals/dolphins`, `animals/dragons`, `animals/insects`
|
|
||||||
- `space/rockets`, `space/stars`, `space/planets`
|
|
||||||
- `vehicles/cars`, `vehicles/ships`, `vehicles/airplanes`
|
|
||||||
- `food-and-drinks/coffee`, `food-and-drinks/beer`
|
|
||||||
- `computers/computers`, `electronics/robots`
|
|
||||||
- `art-and-design/hearts`, `art-and-design/skulls`
|
|
||||||
- `plants/flowers`, `plants/trees`
|
|
||||||
- `mythology/dragons`, `mythology/unicorns`
|
|
||||||
|
|
||||||
```
|
|
||||||
web_extract(urls=["https://www.asciiart.eu/animals/cats"])
|
|
||||||
web_extract(urls=["https://www.asciiart.eu/search?q=rocket"])
|
|
||||||
```
|
|
||||||
|
|
||||||
**Tips:**
|
|
||||||
- Preserve artist initials/signatures (e.g., `jgs`, `hjw`) — this is important etiquette
|
|
||||||
- Better for classic/vintage ASCII art style
|
|
||||||
|
|
||||||
### Source C: GitHub Octocat API (fun easter egg)
|
|
||||||
|
|
||||||
Returns a random GitHub Octocat with a quote. No auth needed.
|
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
curl -s https://api.github.com/octocat
|
curl -s https://api.github.com/octocat
|
||||||
```
|
```
|
||||||
|
|
||||||
## Tool 7: LLM-Generated Custom Art (Fallback)
|
## Tool 8: Fun ASCII Utilities (via curl)
|
||||||
|
|
||||||
|
These free services return ASCII art directly — great for fun extras.
|
||||||
|
|
||||||
|
### QR Codes as ASCII Art
|
||||||
|
|
||||||
|
```bash
|
||||||
|
curl -s "qrenco.de/Hello+World"
|
||||||
|
curl -s "qrenco.de/https://example.com"
|
||||||
|
```
|
||||||
|
|
||||||
|
### Weather as ASCII Art
|
||||||
|
|
||||||
|
```bash
|
||||||
|
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
|
||||||
|
```
|
||||||
|
|
||||||
|
## Tool 9: LLM-Generated Custom Art (Fallback)
|
||||||
|
|
||||||
When tools above don't have what's needed, generate ASCII art directly using these Unicode characters:
|
When tools above don't have what's needed, generate ASCII art directly using these Unicode characters:
|
||||||
|
|
||||||
|
|
@ -264,28 +308,14 @@ When tools above don't have what's needed, generate ASCII art directly using the
|
||||||
- Max height: 15 lines for banners, 25 for scenes
|
- Max height: 15 lines for banners, 25 for scenes
|
||||||
- Monospace only: output must render correctly in fixed-width fonts
|
- Monospace only: output must render correctly in fixed-width fonts
|
||||||
|
|
||||||
## Fun Extras
|
|
||||||
|
|
||||||
### Star Wars in ASCII (via telnet)
|
|
||||||
|
|
||||||
```bash
|
|
||||||
telnet towel.blinkenlights.nl
|
|
||||||
```
|
|
||||||
|
|
||||||
### Useful Resources
|
|
||||||
|
|
||||||
- [asciiart.eu](https://www.asciiart.eu/) — 11,000+ artworks, searchable
|
|
||||||
- [patorjk.com/software/taag](http://patorjk.com/software/taag/) — Web-based text-to-ASCII with font preview
|
|
||||||
- [asciiflow.com](http://asciiflow.com/) — Interactive ASCII diagram editor (browser)
|
|
||||||
- [awesome-ascii-art](https://github.com/moul/awesome-ascii-art) — Curated resource list
|
|
||||||
|
|
||||||
## Decision Flow
|
## Decision Flow
|
||||||
|
|
||||||
1. **Text as a banner** → pyfiglet (or toilet for colored output)
|
1. **Text as a banner** → pyfiglet if installed, otherwise asciified API via curl
|
||||||
2. **Wrap a message in fun character art** → cowsay
|
2. **Wrap a message in fun character art** → cowsay
|
||||||
3. **Add decorative border/frame** → boxes (can combine with pyfiglet)
|
3. **Add decorative border/frame** → boxes (can combine with pyfiglet/asciified)
|
||||||
4. **Art of a thing** (cat, rocket, dragon) → emojicombos.com first, then asciiart.eu
|
4. **Art of a specific thing** (cat, rocket, dragon) → ascii.co.uk via curl + parsing
|
||||||
5. **Kaomoji / emoticons** → emojicombos.com (`{term}-kaomoji`)
|
5. **Convert an image to ASCII** → ascii-image-converter or jp2a
|
||||||
6. **Convert an image to ASCII** → ascii-image-converter or jp2a
|
6. **QR code** → qrenco.de via curl
|
||||||
7. **Something custom/creative** → LLM generation with Unicode palette
|
7. **Weather/moon art** → wttr.in via curl
|
||||||
8. **Any tool not installed** → install it, or fall back to next option
|
8. **Something custom/creative** → LLM generation with Unicode palette
|
||||||
|
9. **Any tool not installed** → install it, or fall back to next option
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue