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
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
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
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
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
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
(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
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.
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.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.
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
The code is around 300 lines and heavily commented. If you want to mod it:
- Add more flowers by appending to the
flowerslist - Change
WIDTH/HEIGHTto fit your terminal - Swap
BUTTERFLY_SPRITESfor your own ASCII art frames - Tune
flap_speedper 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

Top comments (1)
Link to download the file -- > Link