Utility tool to make you a computer ninja.

Overview

Cmd Window

Never spend 6 minutes doing something by hand when you can spend 6 hours failing to automate it - Zhuowej Zhang

What is this about?

This tool will make you a computer ninja. Its main goal is to integrate few well known tools like AutoHotkey, Selenium and Kotlin libraries into one interface which you quickly orchestrate with Kotlin scripts.

It aims to minimise the time for development feedback of your scripts mainly by hot-reloading changes in a running environment rather than restarting the application all the time.

It can automate everything you do on your PC. You can:

  • launch any program
  • open any predefined folder
  • automate mouse and keyboard input (and much more) with AutoHotkey integration
  • automate browser with Selenium

You have to be a bit of a ninja already since you have to know something about Kotlin to use it. Not much but still... For now there is also a possibility to use Clojure as a scripting language if this is your jam.

How does this work?

You press Ctrl+Space and small input window appears on your screen. Type in the command, press enter and your code will magically do stuff.

Where do commands come from? They come from you! You write them in kotlin scripts. You can make them as simple as just running simple Autohotkey command like api.ahk("Run notepad")" or as complicated as a whole program. Choice is yours.

Configuration

After you build and install (instructions below). It's just a matter of creating a configuration file and your Bootstrap.kts file.

The configuration file should be located in: C:\Users\YOUR_USER_NAME\AppData\Roaming\cmd-window\config.properties. And its contents should be very simple:

scriptsDir=C:/path/to/your/scripts

The scriptsDir should point to a place that contains Bootstrap.kts - this script will be executed after starting cmd-window.

Within the script there is an api variable that contains the reference to [ScriptApi](https://github.com/marad/cmd-window/blob/main/src/main/kotlin/gh/marad/cmdwindow/ScriptApi.kt) class that serves as a bridge between the scripts and the hosts. It's API will probably change in the future, but it is what it is for now.

How do I use it?

Just edit the Bootstrap.kts you've set up in the previous section. Then invoke the r command to reload the script.

Simple 'hello world' command look like this:

api.registerCommand("hello", "this shows hello") {
    api.guiMessage("Hello world!", "Hello!")
}

You could also open some folders with AutoHotkey:

api.registerCommand("down", "Open downloads folder") {
    api.ahk("run C:\\Users\\%A_Username%\\Downloads")
}

api.registerCommand("rec", "Open recycle bin") {
    api.ahk("run ::{645FF040-5081-101B-9F08-00AA002F954E}")
}

or even make a simple command to insert your email since it's too much writing, right?

api.registerCommand("@", "insert email address") {
    api.ahk("Send [email protected]")
}

Built-in commands

Right now there are just a few:

  • r reloads the Bootstrap.kts file
  • ? shows a window that lists all available commands
  • exit will exit cmd-window app (how unexpected)

Building and installing

In build.gradle.kts there is a task installDist. You'll probably want to edit the destination path where you want cmd-window to be installed on your disk. You can place it wherever you want.

Additional resources

  • This will help you judge if something is worth automating at all ;)

I'd like to help!

Great! If you spot some bugs or have an idea or even need some help setting this stuff up just post an issue. You can also submit a pull request.

I appreciate any help here because this would mean that this is also useful to you!

Comments
  • Update compose-jb and drop deprecated APIs

    Update compose-jb and drop deprecated APIs

    Right now cmd-window uses old and deprecated API of compose-jb. Tutorials and examples for the new API can be found at https://github.com/JetBrains/compose-jb

    enhancement 
    opened by marad 1
  • Publish the code to GitHub

    Publish the code to GitHub

    I'm using the tool for some time. I'd like to publish it to github, for others to use.

    • [x] Move non-universal builtin commands out to scripts
    • [x] Remove hosts specific code and any local paths
    opened by marad 1
  • Add descriptive README

    Add descriptive README

    Need to have info on

    • what is the purpose and what is included
    • how does that even work
    • how to build, and install the tool
    • how to create the first script
    documentation 
    opened by marad 0
  • Make the script API uniform and easier to use

    Make the script API uniform and easier to use

    I think it could be better to just provide simple functions like ahk or registerCommand instead of having to use the api object.

    It could also be beneficial if all the functions had the same argument order. Right now some of them has "message" as the first one and others have "title" as the first one.

    enhancement 
    opened by marad 0
  • Add a way to persist data between script reloads

    Add a way to persist data between script reloads

    Right now reloading scripts will simply throw away everything created within the scripts. Sometimes it might be useful to save some data so that it will be available also after scripts are reloaded.

    This can be especially useful when developing a script using selenium. Storing the driver could save a lot of time.

    enhancement 
    opened by marad 0
Owner
Marcin Radoszewski
Marcin Radoszewski
Polytech computer graphics couerse code scam script

Js-code-parser Polytech computer graphics couerse code scam script Копируйте строку скрипта с дебаггера с странички лабы. Вставляйте в файлик test.txt

Daniil Bakin 2 Dec 18, 2022
PhotoSync - app to backup photos to your own computer

PeopleInSpace Minimal Kotlin Multiplatform project with SwiftUI, Jetpack Compose

Kyle McBurnett 0 Jan 2, 2022
A command line utility to help you investigate the sensitive data associated with Macie findings.

Macie Finding Data Reveal This project contains a command line utility to help you investigate the sensitive data associated with Macie findings.

AWS Samples 8 Nov 16, 2022
A logger with a small, extensible API which provides utility on top of Android's normal Log class.

This is a logger with a small, extensible API which provides utility on top of Android's normal Log class. I copy this class into all the little apps

Jake Wharton 9.8k Dec 30, 2022
A small utility to record Android device screen to a GIF

RoboGif A small utility to record Android device screen to an optimized GIF so you can paste it to GitHub or a similar service. Requirements Python 2.

Jernej Virag 526 Dec 9, 2022
Utility for detecting and notifying when your Android app goes background / becomes foreground

Foredroid Utility for detecting and notifying when your Android app goes background / becomes foreground. API-level 14+. Usage: Initialise Foreground

Steve Liles 151 Nov 29, 2022
Small utility to create/restore encrypted backups

Quick Backup Choose some files and quickly create a complete encrypted and compressed file. Usage Clone the repository Run gradlew installShadowDist T

Leonardo Colman 5 Sep 18, 2021
Small utility used to add Homewizard Energy Socket tiles to Android Quick Settings

TileWizard [Alpha! Unstable!] Settings Result Functionality: Add up to 5 Wi-Fi Energy Sockets to Android Quick Settings. What do you need: Android dev

Niels Masdorp 2 Oct 19, 2021
Small command-line utility to safely merge multiple WhatsApp backups (msgstore.db) into one.

whatsapp-database-merger A small command-line utility that can be used to merge multiple WhatsApp databases (msgstore.db) into one. A few notes: input

Mattia Iavarone 31 Dec 27, 2022
FractalUtils - A collection of utility functions and classes, with an emphasis on game related utilities

A collection of utility functions and classes written in Kotlin. There is some emphasis on utilities useful for games (Geometry, Random, Time, Updating, etc).

null 2 Nov 11, 2022
Utility library that utilizes KSP to generate Room type converter classes.

Roomie Roomie is an annotation processing library that utilizes KSP to geaRoomie is an annotation processing library that utilizes KSP to generate TypeConverter classes for Room. TypeConverter classes most often involve same boiler-plate code and Roomie makes it really easy to quickly create them with a single annotation.nerate TypeConverter classes for Room. TypeConverter classes most often invol

Chukwuka Eze 12 Aug 26, 2022
CHAOS - Like a utility knife for discord

CHAOS - Like a utility knife for discord. Currently under development. If you feel inclined, please support me by contributing to this project. Or alt

caffeine.moe 20 Nov 13, 2022
Obsi-bot: the next generation discord utility bot 🔥

obsi-bot obsi-bot is the next generation discord utility bot. It is developed in Kotlin using kordex and kord Help me translating Feel free to help me

mooziii 2 Nov 7, 2022
An easy-to-use, cross-platform measurement tool that pulls data out of CD pipelines and analysis the four key metrics for you.

Maintained by SEA team, ThoughtWorks Inc. Read this in other languages: English, 简体中文 Table of Contents About the Project Usage How to Compute Contrib

Thoughtworks 277 Jan 7, 2023
A beautiful set of predefined colors and a set of color methods to make your Android development life easier.

Colours is a port of the Colours Library for iOS made by my good friend Ben Gordon. You can find that project here. Installation Maven Central Colours

Matthew York 634 Dec 28, 2022
CloudStorageUtil - An Android library to make sync on Google Cloud Storage easier

gCloud Storage Utils An Android library to make sync on Google Cloud Storage eas

Evolve Asia 0 Jul 13, 2022
Useful helpers that make it easier to implement maven-plugin mojos with kotlin

A library that makes writing powerful maven plugins even easier by providing kotlin extensions and convenience functions for common use cases.

TOOListicon 1 Nov 4, 2022
A tool to validate text inside TextInputLayout

Download dependencies { implementation 'com.github.anderscheow:validator:2.2.1' } Usage Available rules LengthRule MaxRule MinRule NotEmptyRule NotN

Anders Cheow 129 Nov 25, 2022
recompose is a tool for converting Android layouts in XML to Kotlin code using Jetpack Compose.

recompose is a tool for converting Android layouts in XML to Kotlin code using Jetpack Compose.

Sebastian Kaspari 565 Jan 2, 2023