Skip to content

Repository files navigation

WhyCavalry


Describe animation in plain language. WhyCavalry generates the Cavalry JavaScript and fires it live in your open scene via AppleScript. Zero copy-paste. Zero context switching.


Philosophy

Zero copy-paste — The standard workflow: write in ChatGPT → copy → switch to Cavalry → paste in Scripts → run. WhyCavalry eliminates every step after the first sentence. The file bridge writes to ~/.whycavalry/, AppleScript triggers Cavalry's Scripts menu, the animation runs — while you are still looking at the chat.

Cavalry native — Claude knows the full Cavalry.js API: shapes, modifiers, expressions, connectors, timing functions. Not a wrapper around generic code generation. It generates Cavalry-idiomatic scripts that work on first run.

Conversation memory — The sidebar stores all sessions. "Make it 30% faster" works because Claude has the previous script in context. Iterative motion design without re-describing from scratch.

Zero API cost — Claude Code CLI runs on a Claude Pro subscription. No API key. No per-request billing. Use it all day for every animation.


How it works

Chat UI → Claude Code CLI → bridge file → Cavalry (Scripts menu)
↑
current scene context
LayerDescription
UIElectron chat app, dark, conversation sidebar
AIClaude Code CLI — knows full Cavalry.js API
BridgeFile bridge ~/.whycavalry/ + osascript trigger
CavalryExecutes the generated script via Scripts menu

WhyCavalry UI


What you can describe

DescribeWhat runs
"Circles exploding from center, pastel colors, infinite loop"Particle emitter with radial velocity + color array + loop
"Text 'Hello' entering with spring physics from the left"Text layer, spring easing on X, overshoot and settle
"Smooth morph between circle and square, 2 seconds"Shape morph modifier, ease in/out, seamless loop
"Background shifting from teal to black, sinusoidal"Color animation with sine expression on background layer
"Duplicate the main layer and rotate it 45° every frame"Layer duplication + rotation expression
"Make it 30% faster and add a white flash on impact"Claude reads previous script, modifies timing, adds flash overlay

Why this is different

WhyCavalryAI + copy-pasteManual Cavalry scripting
Copy-paste requiredNeverEvery timeN/A
Context switchingNoneConstantN/A
Iteration speedUnder 3s30–60sMinutes
Cavalry API coverageFullGenericFull
Conversation memoryYesNoN/A

Stack

  • App: Electron + Node.js
  • UI: HTML/CSS/JS native renderer
  • AI: Claude Code CLI (claude --print)
  • Bridge: File system + AppleScript → Cavalry Scripts menu
  • Prerequisite: Cavalry installed + Claude Code authenticated

Setup

git clone https://github.com/OfficialWhyEd/WhyCavalry
cd WhyCavalry
npm install
npm start
# or
open /Applications/WhyCavalry.app

Cavalry must be open with an active scene.


Structure

WhyCavalry/
├── electron-main.js # Electron main process
├── preload.js # Secure bridge renderer ↔ main
├── renderer/ # Chat UI
├── app.js # AI pipeline + file bridge
└── cavalry-scripts/ # Predefined Cavalry scripts

Star History

Star History Chart


Spread the word


Contributing

Pull requests welcome.

  • Windows port — replace AppleScript with a cross-platform trigger
  • Cavalry script library — predefined high-quality animations
  • Better context injection — feed current scene state to Claude

Built by @whyed · macOS · Cavalry + Claude · website · MIT License

About

Describe motion in plain text → Claude generates Cavalry.js → AppleScript fires it live in your open scene. Zero copy-paste. AI-native motion design via file-bridge + osascript. Electron + Node.js.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages