๐ Kenji Engine
The Kenji Engine is the world's first AI-native game engine. It offers a revolutionary approach to game development, enabling users to build games using natural language, generate assets with AI, and deploy them with just one command.
๐ Quick Start
Prerequisites
- Bun - A JavaScript runtime and package manager.
- Kuuzuki - An AI assistant that enhances the development experience.
Installation
-
Clone the repository:
git clone <repository-url> kenji-ge
cd kenji-ge
-
Install dependencies:
bun install
-
Build all packages:
bun run build
-
Install CLI tools globally with bun link:
Option A: Automated setup (recommended):
./scripts/setup-global.sh
This builds all packages and links all commands automatically.
Option B: Manual setup - main command only:
bun run build:packages
bun link
This gives you the kenji-engine command with the interactive menu.
Option C: Manual setup - individual tools:
bun run build:packages
cd packages/tui-editor && bun link && cd ../..
cd packages/cli && bun link && cd ../..
This gives you the kenji-engine command with the interactive menu.
Interactive Menu
After linking, you can use the interactive menu from anywhere:
kenji-ge
This will show you a beautiful menu with options to:
- ๐ Create New Project - Interactive project creation with templates
- ๐ฏ Open TUI Editor - Launch the terminal-based visual editor
- ๐จ Build Project - Compile your game for production
- ๐ Deploy Project - Deploy to itch.io
- โ Show Help - View all available commands
The menu automatically detects existing game projects in your current directory and provides contextual options.
Available Commands After Linking
Once you've run bun link, you'll have these commands available globally:
Main Command:
kenji-ge - Interactive menu (recommended)
TUI Editor Commands:
kenji-editor - TUI editor with interactive menu
kenji-editor create <name> - Create new project
kenji-editor start - Launch TUI editor
kenji-editor build - Build project
kenji-editor deploy - Deploy to itch.io
Note: The basic CLI also provides kenji-engine commands, but the main interactive version is recommended for the best experience.
Create Your First Game
- Create a new Pong game:
kenji-ge create my-pong-game --template pong
cd my-pong-game
- Install dependencies:
bun install
- Start development:
bun run dev
- Open in browser:
Open
index.html in your browser to see your game!
AI-Assisted Development with Kuuzuki
- Start Kenji's MCP server and connect Kuuzuki:
cd my-pong-game
kenji mcp
kuuzuki
- Use natural language commands:
- "Generate pixel art sprites for paddles and ball"
- "Make the ball move faster when it hits a paddle"
- "Add particle effects when the ball hits something"
- "Create a power-up system"
- "Deploy the game to itch.io"
โจ Features
๐ฎ Core Game Engine
- Entity Component System (ECS) - A flexible architecture for game objects.
- Built-in Components - Transform2D, Velocity2D, Sprite2D, Collider2D.
- Built-in Systems - Movement, Rendering, Collision Detection.
- Canvas2D Renderer - Pixel-perfect 2D rendering.
- Input Management - Keyboard and mouse input handling.
- Audio System - Web Audio API integration.
- Asset Management - Image and canvas asset loading.
๐จ Pixel Art Generation
- Procedural Sprites - Generate game assets on-demand.
- Multiple Styles - Retro, modern, and minimalist styles.
- Game-Specific Generators - Pong, Breakout, and more.
- Zero Asset Requirement - No need for external art assets.
๐ค AI-Native Development
- Built-in MCP Server - Direct integration with Kuuzuki AI assistant.
- Natural Language Coding - "Make the ball faster", "Add particle effects".
- AI Asset Generation - Generate sprites, sounds, and animations with AI.
- Intelligent Code Generation - AI creates game systems, components, and logic.
- Smart Deployment - AI handles itch.io publishing and optimization.
๐ ๏ธ Development Tools
- CLI Tool - Command-line interface for project management.
- Bun Runtime - 10 - 100x faster builds and toolchain.
- TypeScript - Strict typing and modern ES modules.
- Hot Reloading - Fast development iteration.
๐ Deployment
- Butler Integration - Automated itch.io deployment.
- Web Export - HTML5 game packaging.
- Build Pipeline - Optimized production builds.
๐ค What Makes Kenji Different?
First AI-Native Game Engine
Unlike traditional engines (Unity, Godot, Phaser), Kenji Engine is built from the ground up for AI-assisted development:
- Natural Language Programming: "Make the ball faster", "Add particle effects".
- Built-in MCP Server: Direct integration with Kuuzuki AI assistant.
- AI Asset Generation: Generate sprites, sounds, and animations with AI.
- Intelligent Code Generation: AI creates game systems and components.
- Smart Deployment: AI handles optimization and publishing.
Perfect for Modern Developers
- 100% TypeScript: Type-safe game development.
- Bun-Powered: Lightning-fast builds and runtime.
- ECS Architecture: Scalable, maintainable game code.
- Zero Configuration: Works out of the box.
AI-Assisted Workflow
1. Write code manually
2. Create assets in external tools
3. Debug and test manually
4. Deploy manually
1. "Create a Pong game"
2. "Make the paddles glow"
3. "Add sound effects"
4. "Deploy the game to itch.io"
๐ Documentation
Project Structure
kenji-ge/
โโโ packages/
โ โโโ core/ # ECS engine core
โ โ โโโ src/
โ โ โ โโโ ecs/ # Entity, Component, System, World
โ โ โ โโโ rendering/ # Canvas2D renderer
โ โ โ โโโ input/ # Input management
โ โ โ โโโ audio/ # Audio system
โ โ โ โโโ components/ # Built-in components
โ โ โ โโโ systems/ # Built-in systems
โ โ โ โโโ utils/ # Utilities
โ โ โโโ package.json
โ โโโ pixel-art-generator/ # Asset generation
โ โ โโโ src/
โ โ โ โโโ generators/ # Game-specific generators
โ โ โ โโโ PixelArtGenerator.ts
โ โ โโโ package.json
โ โโโ mcp-server/ # AI integration
โ โ โโโ src/
โ โ โ โโโ server.ts # MCP server
โ โ โ โโโ GameProjectManager.ts
โ โ โโโ package.json
โ โโโ butler-deploy/ # Deployment tools
โ โ โโโ src/
โ โโโ cli/ # Command line tool
โ โโโ src/
โโโ package.json # Workspace configuration
โโโ bunfig.toml # Bun configuration
โโโ .mcp.json # MCP server config
Game Templates
Empty Template
Basic game setup with engine initialization.
Pong Template
Classic Pong game with:
- Two paddles
- Ball with physics
- Generated pixel art assets
Breakout Template (Coming Soon)
Breakout game with:
- Paddle and ball
- Destructible bricks
- Power-ups
API Reference
Core Classes
GameEngine
const engine = new GameEngine({
canvas: HTMLCanvasElement,
mode: "2d" | "3d",
targetFPS: number,
debug: boolean,
});
await engine.initialize();
engine.start();
Entity
const entity = new Entity()
.addComponent(new Transform2D(x, y))
.addComponent(new Velocity2D(vx, vy))
.addComponent(new Sprite2D(texture));
engine.world.addEntity(entity);
PixelArtGenerator
const generator = new PixelArtGenerator();
const sprite = await generator.generateSprite({
type: "paddle",
width: 32,
height: 8,
colors: ["#FFFFFF"],
style: "retro",
});
๐ง Technical Details
Development
Building
bun run build
bun run dev
bun run clean
Testing
bun test
MCP Server
bun run mcp
Deployment
Build for Web
kenji-ge build my-game --target web
Deploy to Itch.io
kenji-ge deploy my-game --itch-user username --itch-game game-slug
๐ค Contributing
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
๐ License
This project is licensed under the MIT License - see the LICENSE file for details.
๐บ๏ธ Roadmap
Phase 1 (Current)
- โ
Core ECS engine
- โ
2D rendering with Canvas2D
- โ
Pixel art generation
- โ
MCP server integration
- โ
CLI tool
- โ
Pong template
Phase 2 - Enhanced AI Features
- [ ] Advanced AI code generation (complete game systems)
- [ ] AI-powered debugging and optimization
- [ ] Natural language asset modification
- [ ] AI-generated sound effects and music
- [ ] Breakout and Platformer templates
- [ ] Community AI model integration
Phase 3 - Advanced Engine Features
- [ ] 3D rendering with Three.js + AI assistance
- [ ] Multiplayer networking with AI matchmaking
- [ ] Visual editor with AI suggestions
- [ ] Performance optimization with AI analysis
- [ ] Cross-platform deployment (mobile, desktop)
- [ ] AI-powered game balancing and testing
๐ The Kenji Ecosystem
Kenji is part of the larger Kuuzuki AI development ecosystem:
- Kuuzuki - AI assistant for development
- Kenji - AI-native game engine
- MCP Integration - Seamless AI-assisted development
- Community Templates - AI-generated game templates and assets
Why Choose Kenji?
| Traditional Engines |
Kenji Game Engine |
| Manual coding |
AI-assisted development |
| External asset tools |
Built-in AI generation |
| Complex setup |
Zero configuration |
| Steep learning curve |
Natural language interface |
| Manual deployment |
One-command publishing |
๐ ๏ธ Support & Community
๐ฎ Built with โค๏ธ by the Kuuzuki team
Kenji: Where AI meets game development