Skip to content

Tego BotDesktop Automation for Node.js

High-performance automation library powered by Rust

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 โ€‹

bash
pnpm add @tego/botjs

# Or: npm/yarn/bun add @tego/botjs

Basic Example โ€‹

typescript
import { 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

Keyboard Input โ€‹

  • 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:

bash
npx 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 โ€‹

  1. Tego Bot - Rust core with N-API bindings

    • Cross-platform input simulation
    • Screen capture
    • High-performance native operations
  2. @tego/botjs - TypeScript wrapper

    • Type-safe API
    • Additional helper functions
    • Comprehensive documentation
  3. @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


๐Ÿ“„ License โ€‹

MIT License - see LICENSE for details

Released under the MIT License.