Tego Bot
High-performance desktop automation library for Node.js, powered by Rust
โจ Features
- ๐ Extreme performance โ Rust core optimized for maximum speed & efficiency
- ๐ Memory safe โ Rust's type system guarantees memory safety
- ๐ฏ API compatible โ Similar API design to robotjs for easy migration
- ๐ Cross-platform โ Supports Windows, macOS, and Linux
- ๐ฆ Zero dependencies โ No additional Node.js dependencies required
- ๐งช Well tested โ Comprehensive test coverage
๐ Quick Start
Installation
bashpnpm add @tego/botjs
# Or: npm/yarn/bun add @tego/botjs
Basic Example
typescriptimport { moveMouse, mouseClick, keyTap, typeString, captureScreen } from '@tego/botjs';
// Move mouse and click
moveMouse(100, 200);
mouseClick('left');
// Type text
typeString('Hello from Tego Bot!');
keyTap('enter');
// Capture screen
const screenshot = await captureScreen();
// screenshot.image contains PNG buffer
๐ Documentation
๐ฏ Capabilities
Mouse Control
- Instant and smooth cursor movement
- Click operations (left, right, middle, double-click)
- Drag and drop
- Scroll wheel control
- Get cursor position
- Key tapping with modifiers (Ctrl, Shift, Alt, Command)
- Text typing with customizable speed
- Unicode character input
- Key press/release control
Screen Capture
- Full screen screenshots
- Region capture
- Pixel color detection
- PNG output format
Clipboard Operations
- Get/set text content
- Get/set images (PNG format)
- Clear clipboard
Window Management
- Get active window information
- Find windows by title
- Find windows by process name
- Window position and size information
๐ค AI-Powered Script Generator
The @tego/bot-agent package provides an AI-powered CLI tool for generating automation scripts:
bashnpx bot-agent generate
Features:
- Generate scripts from natural language descriptions
- Edit existing scripts through conversational AI
- Execute and manage saved scripts
- Store scripts with conversation history
๐๏ธ Architecture
The project uses a monorepo workspace structure:
Packages
Tego Bot - Rust core with N-API bindings
- Cross-platform input simulation
- Screen capture
- High-performance native operations
@tego/botjs - TypeScript wrapper
- Type-safe API
- Additional helper functions
- Comprehensive documentation
@tego/bot-agent - AI-powered CLI
- Script generation
- Interactive editing
- Script management
๐ฆ Installation Requirements
macOS
- macOS 10.13+
- Screen recording permission required (System Preferences > Security & Privacy > Screen Recording)
Linux
May require system dependencies:
bash# Ubuntu/Debian
sudo apt-get install libxcb1-dev libxrandr-dev libdbus-1-dev
# Fedora
sudo dnf install libxcb-devel libXrandr-devel dbus-devel
Windows
- Windows 10+
- No additional configuration needed
๐ Links
๐ License
MIT License - see LICENSE for details