CodePoet: Transform Your Git History Into Epic Poetry with GitHub Copilot CLI 🎭
Source: Dev.to
What I Built
CodePoet 🎭 – a delightfully creative CLI tool that transforms your code into poetry, epic tales, and legendary narratives using the GitHub Copilot CLI.
Ever looked at your git history and thought, “this could be so much more dramatic”? CodePoet turns boring commit logs into epic fantasy sagas, transforms code files into beautiful haiku, and generates poetic commit messages that your team will actually remember.
It’s not just a fun experiment – it’s a tool that brings joy to retrospectives, creates shareable content for your team, and makes celebrating project milestones genuinely entertaining.
Key Features
- 📜 Epic Sagas – Your git history becomes a legendary tale of heroes, battles, and glorious victories.
- 🌸 Code Haiku – Any code file can become an elegant 5‑7‑5 syllable poem.
- 🎭 Poetic Commits – Generate commit messages as haiku, limericks, or Shakespearean verse.
- ⚔️ Developer Stats – View your coding journey as an RPG character sheet with achievements and levels.
Tech Stack
- TypeScript – robust, type‑safe code.
- Commander.js – CLI parsing.
- Simple‑git – repository analysis.
- Chalk & Ora – beautiful terminal output.
- GitHub Copilot CLI – AI‑powered creative generation.
Demo
Installation
git clone https://github.com/pealmasa/codepoet.git
cd codepoet
npm install
npm run build
npm link
Epic Saga Command
Transform your git history into an epic narrative:
codepoet saga
Example Output
🎭 THE SAGA OF CODEPOET 📜
═══════════════════════════════════════════════════════
In the ancient realm of TypeScript, a brave developer
embarked upon a legendary quest...
Chapter I: The Initialization
The hero forged the sacred package.json, binding the
project's fate to the Node.js kingdom...
Chapter II: The Battle of Dependencies
Armed with Commander, Chalk, and the mystical Simple‑git,
our champion assembled a fellowship of libraries...
Chapter III: The Refactoring Trials
Through treacherous bugs and tortuous logic, the hero
persevered, transforming chaos into elegant beauty...
Code Haiku
Turn any file into poetry:
codepoet haiku src/index.ts
Example Output
Commands await here,
Through typed paths they guide the way,
Poetry takes flight.
Poetic Commits
git add .
codepoet commit --style limerick
Example Output
There once was a bug in the code,
That caused the whole system to load,
Fixed it with grace,
In just one place,
Now smoothly the data has flowed!
Developer Stats
codepoet stats
Example Output
╔════════════════════════════════════╗
║ DEVELOPER CHARACTER SHEET ║
╚════════════════════════════════════╝
Name: Pedro Marques Santos
Class: TypeScript Wizard
Level: 42
Stats:
⚔️ STR (Code Quality): 85/100
🛡️ DEF (Bug Fixes): 92/100
✨ INT (Features): 88/100
🏃 AGI (Commits): 156 commits
Achievements Unlocked:
🏆 First Commit
🔥 Bug Slayer (10+ fixes)
⭐ Feature Forger
📜 Documentation Hero
My Experience with GitHub Copilot CLI
Building CodePoet was a fantastic journey into creative AI applications, and GitHub Copilot CLI was absolutely essential to making it work.
How I Used Copilot CLI
(details omitted for brevity – you can expand this section with your personal insights and examples of prompts you used)
1. Core Creative Engine
The heart of CodePoet is the CopilotService class that wraps GitHub Copilot CLI’s gh copilot suggest command. Instead of using Copilot for code completion, I use it as a creative text‑generation engine:
async ask(prompt: string, options: CopilotOptions = {}): Promise {
const command = `gh copilot suggest "${fullPrompt}"`;
const { stdout } = await execAsync(command);
return this.cleanCopilotOutput(stdout);
}
2. Context‑Aware Poetry Generation
I crafted specific prompts that give Copilot CLI rich context about what to create.
For Epic Sagas – I feed it git history and ask it to:
- Transform commits into heroic deeds
- Turn bug fixes into battles against darkness
- Make features into legendary artifacts
- Convert merges into alliances between kingdoms
For Code Haiku – I provide the actual code and ask for:
- Traditional 5‑7‑5 syllable structure
- Capture the essence of what the code does
- Maintain poetic beauty while being technically accurate
3. Multiple Creative Styles
Style instructions guide Copilot’s creative direction:
getStyleInstructions(style: string): string {
const styles = {
epic: 'Write in dramatic, fantasy‑epic style with grand language',
haiku: 'Create traditional Japanese haiku with exactly 5‑7‑5 syllables',
limerick: 'Write a funny limerick with AABBA rhyme scheme',
shakespearean: 'Write in Shakespearean style with iambic pentameter'
};
return styles[style];
}
Impact on Development
| Aspect | Benefit |
|---|---|
| Speed | No need to integrate a full LLM API (OpenAI, Anthropic, …); Copilot CLI gives instant, context‑aware AI with zero configuration. |
| Quality | Outputs are consistently good because Copilot understands both coding context and natural‑language generation. |
| Iteration | Rapid prototyping of prompt styles with immediate results; tight feedback loop for tuning. |
| Developer Experience | gh copilot suggest is already familiar to Copilot users, so CodePoet feels like a natural workflow extension. |
Why This Matters
CodePoet shows that GitHub Copilot CLI isn’t just for suggesting shell commands—it’s a powerful creative AI tool that can:
- Generate natural‑language content with rich context
- Understand technical concepts and translate them creatively
- Provide consistent, high‑quality outputs with minimal setup
- Integrate seamlessly into developer workflows
This opens up possibilities for many creative CLI tools: commit‑message generators, code‑documentation poets, PR‑description writers, and more!
Future Ideas with Copilot CLI
- Code reviews as movie reviews – “A masterpiece of refactoring! ⭐⭐⭐⭐⭐”
- PR descriptions as epic tales – Turn diffs into adventure stories
- Release notes as song lyrics – “🎵 Version 2.0, here we go! 🎵”
- Architecture docs as fantasy maps – “In the land of Microservices …”
Try It Yourself!
Clone and install
git clone https://github.com/pealmasa/codepoet.git
cd codepoet
npm install
npm run build
npm link
Generate an epic saga in any git repository:
cd your-project
codepoet saga
Share your favorite outputs with #CodePoet on social media!
Repository
🔗 GitHub:
📖 Quick‑Start Guide:
“The best code tells a story. CodePoet tells it epically!” 🎭📜✨




