Your AI-powered generative game platform and terminal companion, living right inside your CLI.
LikuBuddy is a sophisticated Terminal User Interface (TUI) extension for the Gemini CLI. It transforms your terminal into an AI-Elicited, Database-Backed Generative Game Platform where you can:
- ๐ ๏ธ Build games by describing them in natural language
- ๐ฎ Play games - both built-in classics and AI-generated creations
- ๐ Track progress with persistent SQLite database
- โค๏ธ Care for Liku - your AI companion with real needs
- ๐ Share experiences through the community games library
Built with React, Ink, SQLite, and Gemini AI, it offers a complete game development and playing experience directly in your terminal.
NEW! Create games by simply describing them:
- Tell LikuBuddy what kind of game you want
- Choose detailed mode (with AI questions) or quick mode (instant generation)
- AI generates complete, working game code using the Liku SDK
- Games are automatically installed and ready to play
- All community games stored in SQLite and accessible from the menu
Example: "Make a space shooter where I dodge asteroids" โ Complete game in 30 seconds!
A central dashboard to manage your activities. Check Liku's stats, launch games, adjust settings, or build new games.
โญโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฎ
โ ๐ฎ LikuBuddy Game Hub ๐ฎ โ
โ Your AI Companion โ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โ โโLevel: 11โXP: 106โHunger: 90%โEnergy: 15%โHappiness: โโโ โ
โ ๐ฎ Let's Play โ
โ ๐ Feed Liku (XP -10, Hunger -20) โ
โ ๐ค Rest (Energy +30, Hunger +10) โ
โ โ๏ธ Settings โ
โ > ๐ช Exit โ
โฐโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฏ
Play classic arcade games to earn XP and increase Liku's Happiness. But watch outโplaying costs Energy!
- ๐ Snake: Navigate the grid, eat food, and grow. Features multiple difficulty levels.
- โโญ Tic-Tac-Toe: Challenge Liku to a duel. The AI adapts to your difficulty setting!
- ๐ฆ Dino Run: A side-scrolling physics runner. Jump over cacti and dodge flying bats in a living world.
Liku isn't just a menu; he has needs!
- Hunger: Feed Liku using XP you've earned from games.
- Energy: Liku gets tired after playing. Let him Rest to recover.
- Happiness: Winning games makes Liku happy. Losing might make him sad (but he's a good sport).
- Leveling: Earn XP to level up your profile.
- Browse AI-generated games created by you or others
- Play any community game directly from the menu
- All games follow the Liku SDK contract for consistent quality
- Leaderboards track high scores across all games
- Pro Tokens Economy: Start with 10,000 tokens, track balance
- Live Stats Dashboard: Energy, hunger, happiness update every 2 seconds
- XP & Leveling: Progressive advancement system
- Universal Leaderboards: Compare scores across all games
- SQLite Database: All stats, high scores, games, and settings saved locally (
~/.gemini-liku/snake.db) - Game Registry: Track all installed community games
- Relational Leaderboards: Query high scores across games
- Themes: Choose your vibe:
Default(Cyan/White)Matrix(Green/Black)Cyberpunk(Yellow/Pink)Retro(Amber/Red)
- Node.js 20.x or higher
- npm 10.x or higher
- (Optional) Gemini API key for AI game generation
-
Clone & Build:
git clone https://github.com/TayDa64/LikuBuddy.git cd LikuBuddy npm install npm run build -
Set up Gemini API Key (for game generation):
๐ช Windows (PowerShell)
# Temporary (current session) $env:GEMINI_API_KEY="your-api-key-here" # Permanent (user environment) [System.Environment]::SetEnvironmentVariable("GEMINI_API_KEY", "your-key", "User")
๐ macOS / ๐ง Linux (Bash/Zsh)
# Temporary (current session) export GEMINI_API_KEY="your-api-key-here" # Permanent (add to ~/.bashrc or ~/.zshrc) echo 'export GEMINI_API_KEY="your-key"' >> ~/.bashrc source ~/.bashrc
Get your free API key from: https://ai.google.dev/
-
Install into Gemini CLI:
gemini extensions install . -
Launch: You can launch LikuBuddy in two ways:
Option A: Via Gemini CLI Slash Command
/liku
Option B: Directly from Terminal
npm start # OR if installed globally liku
- Launch LikuBuddy:
/liku - Select "๐ฎ Let's Play"
- Choose Snake, Tic-Tac-Toe, or Dino Run
- Play and earn XP!
- Launch LikuBuddy:
/liku - Select "๐ ๏ธ Build a Game (AI-Powered)"
- Describe your game: "A puzzle where I match colors"
- Choose Quick Mode for instant generation
- Wait 10-30 seconds for AI to generate your game
- Play your new game from "๐ Community Games"!
- Launch LikuBuddy:
/liku - Select "๐ป LikuOS Stats"
- Watch real-time updates of your progress
- Launch LikuBuddy:
/liku - Press
mto toggle mini dashboard (compact 2-line view) - Press
magain to return to full menu - Mini mode shows: Pro Tokens, Level, Energy, Happiness at a glance
Mini mode is perfect for:
- Quick status checks without leaving your workflow
- Monitoring Liku's stats while working on other tasks
- Reducing screen clutter when you don't need the full menu
LikuBuddy supports AI agents (like Gemini, Claude, or GPT) controlling the game programmatically. We provide cross-platform tools that work on Windows, macOS, and Linux.
โ ๏ธ CRITICAL: Run Game in Separate TerminalWhen using AI agents to control LikuBuddy, you MUST run the game in a separate terminal window from your agent commands. The agent scripts use window activation and sleep commands that will freeze your environment if run in the same terminal as the game.
Correct Setup:
- Open Terminal 1: Run
npm start(game runs here)- Open Terminal 2: Run agent commands here (e.g.,
npm run agent key enter)Wrong Setup (will freeze):
- Running
npm startand agent commands in the same terminal- Running agent scripts from within the game's terminal session
The unified agent CLI works on all platforms:
# Send a key to the game
npm run agent key up
npm run agent key enter
npm run agent key f # Feed shortcut
# Read game state as JSON
npm run agent read
# Get AI-suggested next action
npm run agent decide
# Show system info
npm run agent info
# Auto-play mode (experimental)
npm run agent auto 10๐ช Windows (PowerShell)
Use the provided PowerShell scripts:
.\up.ps1/.\down.ps1/.\left.ps1/.\right.ps1- Arrow keys.\enter.ps1- Enter key.\feed.ps1- Feed Liku (shortcut 'f').\rest.ps1- Rest Liku (shortcut 'r')
# Example: Navigate menu and select
.\down.ps1
.\down.ps1
.\enter.ps1Note: These scripts auto-detect the game window. Pass -Id 1234 to specify process ID.
๐ macOS / ๐ง Linux (Bash)
Use the bash script (macOS uses AppleScript, Linux requires xdotool):
# Make executable (first time only)
chmod +x scripts/agent-keys.sh
# Send keys
./scripts/agent-keys.sh up
./scripts/agent-keys.sh enter
./scripts/agent-keys.sh fLinux Setup: Install xdotool first:
# Debian/Ubuntu
sudo apt install xdotool
# Fedora
sudo dnf install xdotool
# Arch
sudo pacman -S xdotool-
Start the game in a terminal:
npm start
-
Read the state file (
likubuddy-state.txt):# Using agent CLI (returns JSON) npm run agent read # Or read file directly cat likubuddy-state.txt
-
State file format:
CURRENT SCREEN: Main Menu STATS: Level: 11, XP: 106, Hunger: 90%, Energy: 15%, Happiness: 80% MESSAGE: Liku is too tired to play! Let him rest first. MENU ITEMS: [ ] ๐ฎ Let's Play [ ] ๐จ Let's Build a Game! [ ] ๐ Community Games [ ] ๐ป LikuOS Stats [ ] ๐ Feed Liku (XP -10, Hunger -20) [ ] ๐ค Rest (Energy +30, Hunger +10) [ ] โ๏ธ Settings [x] ๐ช Exit
- Runtime: Node.js
- UI Framework: Ink (React for CLI)
- Language: TypeScript
- Database: SQLite3 (via
sqlite3native module) - AI Engine: Google Gemini 1.5 Pro (via
@google/generative-ai) - Architecture:
- Component-based UI with React patterns
- Singleton Database Service with relational schema
- Elicitation Agent for game generation
- Dynamic game loader with hot-swapping
- Real-time stats with polling hooks
Contributions are welcome! Here's how to extend LikuBuddy:
- Add Built-in Games: Create games in
src/ui/games/following the Liku SDK contract - Enhance AI Generation: Improve the SDK context in
src/builder/ElicitationAgent.ts - New Database Tools: Add AI query helpers in
src/core/dbTools.ts - UI Improvements: Enhance components in
src/ui/ - Game Validation: Improve code checking in
src/core/GameLoader.ts
See GENERATIVE_GAME_PLATFORM.md for detailed architecture documentation.
- README.md - This file (getting started)
- GENERATIVE_GAME_PLATFORM.md - Complete architecture guide
- GEMINI.md - Extension context for Gemini CLI
Want to create games manually? Follow the Liku SDK contract:
import React from 'react';
import { Box, Text, useInput } from 'ink';
interface GameProps {
onExit: () => void;
difficulty?: 'easy' | 'medium' | 'hard';
}
const MyGame = ({ onExit, difficulty }: GameProps) => {
useInput((input, key) => {
if (key.escape) onExit();
// Your game logic
});
return (
<Box flexDirection="column" borderStyle="round" borderColor="cyan">
<Text bold>My Awesome Game</Text>
</Box>
);
};
export default MyGame;MIT License - Feel free to use, modify, and distribute!
Built with โค๏ธ using GitHub Copilot & Gemini AI LikuBuddy v2.0 - The Generative Game Platform ๐ฎโจ