惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

人人都是产品经理
人人都是产品经理
Blog — PlanetScale
Blog — PlanetScale
MyScale Blog
MyScale Blog
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
WordPress大学
WordPress大学
Vercel News
Vercel News
D
Docker
博客园 - 聂微东
T
Tailwind CSS Blog
aimingoo的专栏
aimingoo的专栏
云风的 BLOG
云风的 BLOG
D
DataBreaches.Net
B
Blog RSS Feed
酷 壳 – CoolShell
酷 壳 – CoolShell
博客园 - Franky
Microsoft Security Blog
Microsoft Security Blog
美团技术团队
F
Fortinet All Blogs
MongoDB | Blog
MongoDB | Blog
T
The Blog of Author Tim Ferriss
GbyAI
GbyAI
N
Netflix TechBlog - Medium
G
Google Developers Blog
腾讯CDC

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant
🦋 I Built a Living Terminal Animation with Hermes Agent —...
Aditya Madho · 2026-05-27 · via DEV Community

Hey DEV community! I'm Aditya Madhok, and this is my submission for the Hermes Agent Challenge — a $1,000 prize pool challenge to build something cool using the open-source Hermes Agent. I ended up building something I genuinely didn't expect to pull off: a fully animated, living Butterfly Garden that runs right inside your terminal.

No GUI. No browser. Just pure Python + ANSI escape codes + a surprisingly capable AI agent.

🌸 What Is Butterfly Garden?

It's a terminal animation — a little scene that plays out in your 80x24 character grid. Here's what's happening on screen at any given moment:

  • 🦋 A butterfly with a full state machine (Seeking → Landing → Sipping Nectar → Taking Off), flapping its wings in animated sprite cycles
  • 🌺 Three flowers (a tulip, a daisy, and a rosebud) that sway gently with a sine-wave wind effect
  • Floating pollen/sparkle particles drifting across the scene
  • 🌿 Two layers of animated grass at the bottom, tilting left and right with the breeze
  • 📜 A live narrative caption that changes based on what the butterfly is doing

The whole thing runs at ~12fps using a double-buffered render loop — meaning every frame, a fresh character and color buffer is computed, then flushed to the terminal in one write. No flicker. No tearing.

python butterfly_garden.py

Enter fullscreen mode Exit fullscreen mode

That's all it takes. Press Ctrl+C to exit gracefully (cursor is restored, colors reset).


🤖 Where Does Hermes Agent Come In?

Here's the honest truth about how this got built.

I had the idea — a terminal animation with a butterfly visiting flowers. I knew the broad shape of it. What I didn't have was hours to manually tune physics, sprite timing, state machine transitions, and sine-wave grass. That's where Hermes Agent came in.

Hermes Agent is an open-source agentic system built for planning, tool use, and multi-step reasoning. It runs on your own infrastructure. I described what I wanted and let it help me reason through the architecture piece by piece:

Me: "I want a butterfly that realistically seeks out flowers, lands on them, sips nectar, then flies to the next one."

Hermes: Suggested a 4-state machine — SEEKING, LANDING, RESTING, TAKEOFF — with spring-based physics for smooth movement and a flutter noise layer for organic-looking flight.

That's the kind of architectural help that turns a vague idea into structured code fast. Hermes wasn't just autocompleting lines — it was helping me think about the problem.


🧠 The Interesting Technical Bits

Double-Buffered Terminal Rendering

def create_double_buffer():
    char_buf = [[" " for _ in range(WIDTH)] for _ in range(HEIGHT)]
    color_buf = [[RESET_COLOR for _ in range(WIDTH)] for _ in range(HEIGHT)]
    return char_buf, color_buf

Enter fullscreen mode Exit fullscreen mode

Every frame builds two full 80×24 grids — one for characters, one for ANSI color codes. This gets flushed in a single sys.stdout.write() call, which prevents the partial-frame flickering you'd get from printing line by line.

Spring Physics + Flutter Noise

The butterfly doesn't just teleport to targets. It uses velocity + spring acceleration:

ax = (target_x - bx) * 0.06
ay = (target_y - by) * 0.06

flutter_x = math.sin(frame * 0.8) * 0.6
flutter_y = math.cos(frame * 1.1) * 0.4

vx = vx * 0.8 + ax + flutter_x * 0.1
vy = vy * 0.8 + ay + flutter_y * 0.1

Enter fullscreen mode Exit fullscreen mode

The damping (* 0.8) prevents oscillation. The flutter noise (different frequencies on X and Y) creates that natural drifting quality real butterflies have.

Swaying Flowers via Sine Waves

def update(self, frame):
    self.sway_x = math.sin(frame * 0.04 + self.base_x) * 2.5

Enter fullscreen mode Exit fullscreen mode

Each flower has a phase offset (+ self.base_x) so they don't all sway in sync — that one line makes the scene feel alive instead of mechanical.

The Butterfly Locks to the Flower While Sipping

When the butterfly is in RESTING state, it doesn't use physics at all:

elif b_state == 2:
    bx = flower_top_x  # flower_top_x updates every frame as flower sways
    by = flower_top_y

Enter fullscreen mode Exit fullscreen mode

This means the butterfly visually rides the swaying flower — a tiny detail that sells the whole illusion.


🎨 What It Looks Like

────────────────────────────────────────────────────────────────────────────────
         BUTTERFLY GARDEN

     ✧  ·  ✧       o   o          ✧
                  / \_/ \
           \_/  (_ _O_)   (@)
            v   \_/ \_/   \|/
        |        |  |      |
      y |      y |  | p    | p
        |        |  |      |
 \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/
         Sipping sweet nectar from a swaying blossom...
wvwvwvwvwvwvwvwvwvwvwvwvwvwvwvwvwvwvwvwvwvwvwvwvwvwvwvwvwvwvwvwvwv

Enter fullscreen mode Exit fullscreen mode

(ANSI colors render in the terminal — the butterfly shifts between orange and magenta, flowers bloom in cyan, red, and purple, grass glows green)


💡 What I Learned from Using Hermes Agent

  1. It's excellent for architecture decisions. Asking "how should I structure the state machine?" got me a clean answer with tradeoffs explained. That's different from autocomplete.

  2. It accelerates the boring math parts. Sine wave phase offsets, spring damping coefficients, sprite index oscillation from sin() — Hermes helped me get these right without trial-and-error guessing.

  3. You still write the code. Hermes is an agent, not a vending machine. The final implementation is mine — but it's shaped by reasoning I did with it, not alone.

  4. Running on your own infra matters. For a creative/personal project like this, I didn't want my prompts going anywhere proprietary. Hermes running locally gave me that freedom.


🚀 Try It Yourself

The script is self-contained — no dependencies beyond Python 3 and a terminal that supports ANSI codes (Linux/macOS out of the box, Windows Terminal works too).

# Clone or download butterfly_garden.py, then:
python butterfly_garden.py

# Exit with Ctrl+C — the terminal resets cleanly

Enter fullscreen mode Exit fullscreen mode

The code is around 300 lines and heavily commented. If you want to mod it:

  • Add more flowers by appending to the flowers list
  • Change WIDTH/HEIGHT to fit your terminal
  • Swap BUTTERFLY_SPRITES for your own ASCII art frames
  • Tune flap_speed per state for different animation feels

Final Thoughts

I didn't expect a terminal animation to be this satisfying to build. There's something meditative about characters, math, and color codes combining into something that feels alive. Hermes Agent made the architectural reasoning faster and more fun — it's a tool that respects your intelligence while expanding what you can accomplish alone.

If you have questions, want to share your own Hermes Agent builds, or just want to talk terminal art — drop a comment below. I read every one. 👇


Built for the DEV Hermes Agent Challenge · May 2026 · by Aditya Madhok