Skip to content

Small command line tool based on robotjs used to automate simple tasks (click something, type something, wait). Mainly for when you want to do something at a certain time, but you aren't near your PC.

joaquimnet/contempt

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Contempt

Small command line tool based on robotjs used to automate simple tasks (click something, type something, wait). Mainly for when you want to do something at a certain time, but you aren't near your PC.

Rolling eyes emoji

Usage

$ contempt [...commands]
# or
$ npx contempt [...commands]

Commands

click

Clicks where the cursor is located.

$ contempt click

rightclick

Right clicks where the cursor is located.

$ contempt rightclick

type

Types the given text. Use "__" as spaces.

type:[text]

$ contempt type:hello__world

key

Presses the given key.

key:[key],[modifier]

[modifier] accepts alt, command (win), control, and shift

$ contempt key:f5
$ contempt key:t,control

wait

Waits for the given amount of seconds.

wait:[seconds]

$ contempt wait:5 click

move

Moves the cursor to the given coordinates.

move:[x],[y]

$ contempt move:100,100

mousepos

Prints the current mouse position, utility to help you build your commands.

$ contempt wait:3 mousepos

Examples

Clicks twice, 5 seconds apart.

$ contempt wait:5 click wait:5 click

Types "Hello World" and presses enter.

$ contempt wait:2 type:Hello__World! key:enter

Open Google and make a search

$ contempt wait:3 key:t,control wait:1 type:google.com key:enter wait:4 type:contempt wait:1 key:enter

Using a Input File

You can also use a file to store your commands, just pass the -i flag and the path to the file.

$ contempt -i ./commands.txt

Example Input File

# This is a comment
WAIT 1
KEY command
TYPE npp
KEY enter
WAIT 1
KEY n control
TYPE I used to be an adventurer like you, but then I took an arrow in the knee.

About

Small command line tool based on robotjs used to automate simple tasks (click something, type something, wait). Mainly for when you want to do something at a certain time, but you aren't near your PC.

Topics

Resources

Stars

Watchers

Forks