robotjs
12,787
Stars
1,005
Forks
189
Watchers
7
Open Issues
MIT
许可证
C
语言
2014-08-31
创建时间
2026-10-24
最近更新
项目能做什么
用于控制鼠标、键盘及屏幕捕获的 Node.js 桌面自动化工具。
来源:AI 基于仓库事实生成
· 内容以仓库实际 README 为准
使用说明 查看原始 README 原仓库文档
中文使用说明暂未生成。下面保留原仓库 README 摘录,命令与配置均以原文为准。
原始 README 摘录(英文原文,节选前 3000 字符)
<p align="center"><img src="https://cldup.com/1ATDf2JMtv.png"></p>
> Node.js Desktop Automation. Control the mouse, keyboard, and read the screen.
RobotJS supports Mac, [Windows](https://github.com/octalmage/robotjs/issues/2), and [Linux](https://github.com/octalmage/robotjs/issues/17).
This is a work in progress so the exported functions could change at any time before the first stable release (1.0.0). [Ideas?](https://github.com/octalmage/robotjs/issues/4)
[Check out some of the cool things people are making with RobotJS](https://github.com/octalmage/robotjs/wiki/Projects-using-RobotJS)! Have your own rad RobotJS project? Feel free to add it!
## Contents
- [Installation](#installation)
- [Examples](#examples)
- [API](https://robotjs.dev/docs/syntax)
- [Building](#building)
- [Plans](#plans)
- [Progress](#progress)
- [FAQ](#faq)
- [License](#license)
## Installation
Install RobotJS using npm:
```
npm install robotjs
```
You can get npm [here](https://nodejs.org/en/download/) if you don't have it installed.
Published packages include Node-API prebuilds for Linux, macOS, and Windows on
x64 and arm64. Other targets fall back to a source build.
If you need to build RobotJS, see the [building](#building) section. Instructions for [Electron](https://github.com/octalmage/robotjs/wiki/Electron).
## Examples
##### [Mouse](https://github.com/octalmage/robotjs/wiki/Syntax#mouse)
<p align="center"><img src="https://cldup.com/lugVjjAkEi.gif"></p>
```js
// Move the mouse across the screen as a sine wave.
const robot = require("robotjs");
// Speed up the mouse.
robot.setMouseDelay(2);
const twoPI = Math.PI * 2;
const screenSize = robot.getScreenSize();
const height = (screenSize.height / 2) - 10;
const width = screenSize.width;
for (let x = 0; x < width; x++) {
const y = height * Math.sin((twoPI * x) / width) + height;
robot.moveMouse(x, y);
}
```
##### [Keyboard](https://github.com/octalmage/robotjs/wiki/Syntax#keyboard)
```js
// Type "Hello World" then press enter.
const robot = require("robotjs");
// Type "Hello World".
robot.typeString("Hello World");
// Press enter.
robot.keyTap("enter");
```
##### [Screen](https://github.com/octalmage/robotjs/wiki/Syntax#screen)
```js
// Get pixel color under the mouse.
const robot = require("robotjs");
// Get mouse position.
const mouse = robot.getMousePos();
// Get pixel color in hex format.
const hex = robot.getPixelColor(mouse.x, mouse.y);
console.log(`#${hex} at x:${mouse.x} y:${mouse.y}`);
```
##### Image Search
```js
const robot = require("robotjs");
const screen = robot.screen.capture();
const target = robot.image.load("./target.bmp");
const match = screen.findImage(target, { tolerance: 0.1 });
if (match) {
screen.click(match, target);
}
```
Captured and loaded images also provide `findImages`, `countImage`, `findColor`,
`findColors`, `countColor`, `colorAt`, and `save`. Image searches return the
target's top-left capture coordinates. `click` converts those coordinates to
scree
阅读完整原文
商业机会分析 AI 生成
跨平台桌面自动化录制与无代码执行器(桌面 RPA)
| 产品构想 | 基于 Electron 和 RobotJS 构建一个可视化的键鼠动作录制、图像定位、定时任务执行的轻量级桌面客户端,降低编写原生脚本门槛。 |
| 核心功能 | 可视化的键鼠点击录制、屏幕图像/颜色比对断言、步骤编辑与变量注入、离线定时任务调度、执行日志与错误告警。 |
| 目标用户 | 中小企业行政/运营人员、无代码需求者、重复桌面操作较多的个人用户。 |
| 难度/周期 | 中等 · 1-2 个月 · 成本:开发机器、代码签名证书(macOS/Windows 平台执行权限需签名)。 |
| 收费模式 | 按个人版/专业版永久买断或按年订阅,高级功能(如图像识别增强、多任务排队)收费。 |
| 竞争风险 | 现代操作系统(尤其 macOS 权限体系更新)权限管控趋严;市面已有成熟大型 RPA 软件竞争。 |
| 依据 | 已验证事实 |
基于视觉/自然语言的桌面 AI Agent 执行端
| 产品构想 | 将 RobotJS 封装为本地操作执行引擎(Tool/MCP 协议插件),对接多模态大模型(Vision LLM),让用户通过自然语言命令操控桌面应用。 |
| 核心功能 | 屏幕截屏传输给多模态模型、坐标自动换算与点击(结合 findImage 与视觉推断)、基于 RobotJS 的键鼠执行工具集、安全确认边界机制。 |
| 目标用户 | AI 探索型开发者、自动化极客、需要无 API 软件自动化操作的极客团队。 |
| 难度/周期 | 较高 · 2-3 个月 · 成本:大模型 API 调用成本、跨平台测试环境。 |
| 收费模式 | 开源核心执行器,商业化托管 Agent 配置平台或按执行任务量/云端多模态Token差价订阅收费。 |
| 竞争风险 | 模型理解复杂 GUI 界面存在幻觉与误操作风险,键盘输入高敏感信息时有安全隐患。 |
| 依据 | 尚需验证的假设 |
企业遗留桌面应用测试与自动化集成解决方案
| 产品构想 | 为企业内部缺乏开放 API、无 Web 界面的旧版 C/S 桌面客户端(如 ERP、财务系统、工控配置工具)提供专属定制的脚本自动化与数据提取方案。 |
| 核心功能 | 屏幕 OCR 与图像匹配定位输入框、批量自动化数据过账与录入、异常弹窗检测与拦截处理、自动化执行审计报告。 |
| 目标用户 | 制造业、金融业等依赖老旧 Windows 客户端软件进行日常数据录入的企业客户。 |
| 难度/周期 | 中等 · 按项目交付(1-3 周/单) · 成本:主要为人力实施与现场/远程交付成本。 |
| 收费模式 | 项目制交付外包费 + 长期运维服务费。 |
| 竞争风险 | 软件界面分辨率变化或微调可能导致图像匹配失败,维护成本高。 |
| 依据 | 数据支持的判断 |
AI 基于仓库公开数据分析生成,含推测成分,不构成收益承诺。
报告会保存到 个人中心
竞品与相似项目 GitHub Search 真实检索
| 项目 | 中文简介 | Stars | 语言 |
|---|---|---|---|
| hurdlegroup/robotjs | 中文介绍暂未生成 Node.js Desktop Automation. |
97 | C |
| rubickCenter/rubick-base | 中文介绍暂未生成 desktop automation, screen capture, input listen/simulation, |
92 | Rust |
| frei-x/LOL-Yun-Ding-Zhi-Yi | 中文介绍暂未生成 英雄联盟 云顶之弈 全自动挂机刷经验程序 外挂 脚本 ,下载慢可以到https://gitee.com/stringif |
79 | Python |
| Ragnoakox/resocket-human-clicker | 中文介绍暂未生成 Human-like auto-clicker: log-normal delays, jitter, rests, a |
52 | - |
| shinyoshiaki/oculus-quest-remote-desktop | 中文介绍暂未生成 Remote desktop for Oculus Quest. Using Babylon.js , React an |
41 | TypeScript |
| hola-soy-milk/clappy-mic | 中文介绍暂未生成 An electron app that uses Tensorflow and RobotJS to send cla |
38 | HTML |
以上为通过 GitHub 官方 Search API 检索的相似项目,功能差异与优劣势需进一步人工确认,配置 AI 后可生成对比分析。
项目优势与风险
| 技术成熟度 | 创建于 2014-08-31,近 30 天仍在推送,发布过 39 个 Release |
| 社区活跃 | Star 12,787 / Fork 1,005 / Issue 7(数据支持,可自行核实) |
| 许可证 | MIT |
| 主要风险 | 上游项目方向可能变化;同赛道竞争者较多(见竞品表);热度与需求不完全等价 |
安装与使用
快速开始(以仓库 README 为准)
git clone https://github.com/octalmage/robotjs.git cd robotjs # 请阅读仓库 README 获取确切安装步骤(依赖、配置、启动命令)
术语说明:Docker=应用容器(把程序和依赖打包运行);API Key=调用外部服务的密钥;Git Clone=把仓库代码下载到本地。常见错误:API Key 未配置 / 端口占用 / 数据库连接失败,多数项目在 README 的 Troubleshooting 章节有说明。