DEV Community

Cover image for I built an Infinite AI Debate Arena using the GitHub Copilot CLI πŸ₯Š
BrewHubPHL
BrewHubPHL

Posted on

I built an Infinite AI Debate Arena using the GitHub Copilot CLI πŸ₯Š

GitHub Copilot CLI Challenge Submission

This is a submission for the GitHub Copilot CLI Challenge

πŸ’‘ The Idea
What happens if you lock two AI personalities in a room and force them to argue about "Is a hotdog a sandwich?" forever?

For the GitHub Copilot CLI Challenge, I didn't want to just build a utility tool. I wanted to build something chaotic. Enter the AI Debate Arena.

It’s a terminal-based "fighting game" where:

Captain Capslock (An angry Boomer) fights Lil' Zoomer (A Gen-Z teen).

They argue in an infinite loop.

Sentiment Analysis determines who is "winning" (getting angrier).

πŸŽ₯ The Demo
[https://youtu.be/-RBdUKZY9zA]

πŸ› οΈ How it Works
The project uses Python to orchestrate the chaos, but the "brains" are entirely powered by the GitHub Copilot CLI.

  1. The "Persona Injection" I used the gh copilot explain command to generate the dialogue. By injecting a specific persona into the prompt, we can force Copilot to break character.

Python

The Secret Sauce

prompt = f"{persona} Your opponent said: '{last_response}'. Reply in one short, funny sentence."
cmd = ["gh", "copilot", "explain", "-p", prompt]

  1. The Loop The script creates a feedback loop:

Fighter A generates a response using Copilot.

TextBlob analyzes the sentiment (Politeness = Weakness, Anger = Power).

Fighter B takes that response and generates a counter-argument.

Rich renders the ASCII faces and health bars in real-time.

🎨 The Tech Stack
GitHub CLI (gh): The AI engine.

Rich: For the beautiful terminal UI and layouts.

TextBlob: For the "Rage Meter" logic.

Python: To glue it all together.

πŸ† The Outcome
Sometimes they argue about politics, sometimes about cereal. The CLI handles the roleplay surprisingly well. My favorite line so far?

"Milk-first people stay taking Ls fr fr, that's giving unhinged villain energy." β€” Lil' Zoomer

πŸ”— The Code
Check out the repository here to run it yourself! [https://github.com/BrewHubPHL/ai-debate.git]

Top comments (1)

Collapse
 
p3ngu1nzz profile image
p3nGu1nZz

very nice, forked, cant wait to hack on this.