Cross-platform desktop automation library for Deno

AutoPilot is a simple cross-platform desktop automation library for Deno.

NOTE: Works with Deno v1.3.0 or up.

Features

  • Keyboard
*   [x]  Type a string using `.type`
*   [x]  Tap a key using `.tap`
*   [x]  Toggle key using `.toggleKey`
  • Mouse
*   [x]  Simulate mouse movement using `.moveMouse`
*   [x]  Click using `.click`
*   [x]  Simulate a scroll using `.scroll`
*   [x]  Get mouse position using `.mousePosition`
*   [x]  Get mouse position pixel color `.pixelColor`
  • Screen

    • [x] Capture screen using .screenshot
    • [x] Get screen size using .screenSize
    • [x] Check if point out of bounds using .pointVisible
    • [x] Get number of pixels in a point using .screenScale
    • [ ] Screen recording
  • Notifications

*   [x]  Native popup using `.alert`
*   [x]  Notifications using `.notify`
  • Monitors
*   [x]  Get the number of monitors using `.getMonitors`
  • Window management (only for linux)
*   [x]  Get window title using `.getWindow`
*   [x]  Transform windows size using `.transformByIndex`

Documentation

Detailed documentation of the API is available at:

https://autopilot.divy.work

Requirements

Linux
sudo apt-get update
sudo apt-get install libdbus-1-dev x11-xserver-utils wmctrl libxtst-dev cmake libc-dev libx11-dev libxcb1-dev

Usage

Running your Deno script with AutoPilot requires some flags

deno run --unstable -A file.ts

NOTE: Prebuilt binaries are automatically downloaded the first time you import Autopilot in your project and are cached.

import AutoPilot from 'https://deno.land/x/autopilot/mod.ts';

// create a new AutoPilot instance.
var pilot = new AutoPilot();

// type a string
pilot.type("Yay! This works");

// alert something
pilot.alert("This is a alert");

// get screen size
pilot.screenSize();

// move mouse
pilot.moveMouse(200, 400);

// take a full-screen screenshot
pilot.screenshot("screenshot.png");

Env variables

  • CACHE: Set if you want to update the release from Github.
  • DEV: Set if you want t use the development debug builds.

Development

  • Requires rust and cargo.
  • Requires velociraptor (script runner for Deno) - Makes life easier

Clone this repo and run cargo build to produce a development build.

Commands
  • Run tests: vr test
  • Run and produce benchmarks: vr bench
  • Format code fmt: vr fmt
  • Create development build: vr build

Contributing

Contributing code and ideas to AutoPilot is really easy! Create an issue or PR. :)

Download Details:

Author: divy-work

Demo: https://autopilot.mod.land/

Source Code: https://github.com/divy-work/autopilot-deno

#deno #nodejs #javascript #node

Cross-platform desktop automation library for Deno
3.40 GEEK