Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/wobsoriano/bunbot
Desktop automation for Bun
https://github.com/wobsoriano/bunbot
automation bun bunjs cgo ffi go gui robot
Last synced: 3 months ago
JSON representation
Desktop automation for Bun
- Host: GitHub
- URL: https://github.com/wobsoriano/bunbot
- Owner: wobsoriano
- License: mit
- Created: 2022-07-17T01:48:56.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-09-23T04:06:03.000Z (over 1 year ago)
- Last Synced: 2024-10-31T09:41:50.117Z (3 months ago)
- Topics: automation, bun, bunjs, cgo, ffi, go, gui, robot
- Language: Go
- Homepage:
- Size: 127 KB
- Stars: 71
- Watchers: 2
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-bun - bunbot - Native cross-platform GUI automation for the Bun runtime. Supports Mac and Windows for now. (Tools / Adapters)
README
# bunbot
[]([https://deno.land](https://www.craiyon.com/))
Desktop automation for the Bun runtime. Currently works on Mac.
[![npm (tag)](https://img.shields.io/npm/v/bunbot?style=flat&colorA=000000&colorB=000000)](https://www.npmjs.com/package/bunbot) ![NPM](https://img.shields.io/npm/l/bunbot?style=flat&colorA=000000&colorB=000000)
## Requirements
Bunbot uses [RobotGo](https://github.com/go-vgo/robotgo) via `bun:ffi`. Please see RobotGo's requirements [here](https://github.com/go-vgo/robotgo#requirements).
## Usage
```bash
bun add bunbot
```### Mouse
```ts
import Bunbot from 'bunbot'const bb = new Bunbot()
// Click
bb.click()
// Get mouse position coordinates
const mousePosition = bb.getMousePosition()
// Move mouse
bb.moveMouse(200, 400)
// Move mouse smoothly
bb.moveMouseSmooth(200, 400)
// Scroll mouse
bb.scrollMouse(100, 200)
```### Keyboard
```ts
import Bunbot from 'bunbot'const bb = new Bunbot()
// Type a string
bb.type('Hello world!')
// Tap a key
bb.tap('i', 'alt', 'command')
```### Screen
```ts
import Bunbot from 'bunbot'const bb = new Bunbot()
// Get screen size
const screenSize = bb.getScreenSize()
// Get scale size
const scaleSize = bb.getScaleSize()
```## License
MIT