Cross-Platform
Write once, run on Windows, macOS, and Linux. Same API, same behavior.
Control mouse, keyboard, and screen programmatically with Node.js. Works with any application on Windows, macOS, and Linux—no source code access required.
import {
mouse, Button, keyboard, Key, straightTo, centerOf, getActiveWindow
} from "@nut-tree/nut-js";
import {useElementInspector} from "@nut-tree/element-inspector";
import { elements } from "@nut-tree/element-inspector/win";
import { readFileSync } from "fs";
useElementInspector();
// Read data from CSV file
const records = readFileSync("invoices.csv", "utf-8")
.split("\n").slice(1);
const window = await getActiveWindow();
for (const record of records) {
const [customer, amount, date] = record.split(",");
// Click "New Invoice" button
const newBtn = await window.find(
elements.button({ title: "New Invoice" })
);
await mouse.move(straightTo(centerOf(newBtn.region)));
await mouse.click(Button.LEFT);
// Fill form fields by their labels
const customerField = await window.find(
elements.textInput({ label: "Customer" })
);
await mouse.move(straightTo(centerOf(customerField.region)));
await mouse.click(Button.LEFT);
await keyboard.type(customer);
// Save with keyboard shortcut
await keyboard.pressKey(Key.LeftControl, Key.S);
}Built for developers who need reliable, maintainable desktop automation.
Write once, run on Windows, macOS, and Linux. Same API, same behavior.
Find elements by image, text, color, or UI structure. Multiple search strategies for any scenario.
Pixel-perfect mouse movements with configurable speed and easing functions.
Prebuilt binaries for all platforms. No compilers, no build tools, just npm install.
From simple repetitive tasks to complex multi-application workflows, nut.js handles it all with a clean, intuitive API.
Automate repetitive data entry tasks across multiple applications. Import from Excel, enter into legacy systems, validate results.
Automatically generate reports by navigating through applications, extracting data, and compiling results.
Automate system configuration, software installation, and maintenance tasks across your infrastructure.
Bridge the gap between modern systems and legacy applications that lack APIs.
import {
mouse, Button, keyboard, Key, screen, straightTo, centerOf,
imageResource, sleep
} from "@nut-tree/nut-js";
async function automateDataEntry(records: string[]) {
for (const record of records) {
// Click the "New Entry" button
const newEntry = await screen.waitFor(
imageResource("new-entry.png")
);
await mouse.move(straightTo(centerOf(newEntry)));
await mouse.click(Button.LEFT);
// Enter the data
await keyboard.type(record);
await keyboard.pressKey(Key.Tab);
// Save and continue
await keyboard.pressKey(Key.Enter);
await sleep(500);
}
}Get started in minutes. No complex setup, no build tools—just install and start automating.