Run

Run is a command line shortcut tool

License

License

GroupId

GroupId

com.kennycason
ArtifactId

ArtifactId

run
Last Version

Last Version

1.0
Release Date

Release Date

Type

Type

jar
Description

Description

Run
Run is a command line shortcut tool
Project URL

Project URL

https://github.com/kennycason/run
Source Code Management

Source Code Management

https://github.com/kennycason/run

Download run

How to add to project

<!-- https://jarcasting.com/artifacts/com.kennycason/run/ -->
<dependency>
    <groupId>com.kennycason</groupId>
    <artifactId>run</artifactId>
    <version>1.0</version>
</dependency>
// https://jarcasting.com/artifacts/com.kennycason/run/
implementation 'com.kennycason:run:1.0'
// https://jarcasting.com/artifacts/com.kennycason/run/
implementation ("com.kennycason:run:1.0")
'com.kennycason:run:jar:1.0'
<dependency org="com.kennycason" name="run" rev="1.0">
  <artifact name="run" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.kennycason', module='run', version='1.0')
)
libraryDependencies += "com.kennycason" % "run" % "1.0"
[com.kennycason/run "1.0"]

Dependencies

test (2)

Group / Artifact Type Version
junit : junit jar 4.12
org.jetbrains.kotlin : kotlin-test-junit jar 1.0.2

Project Modules

There are no modules declared in this project.

Call

Aliases made simple. A command line tool to organize commonly used commands/tasks. Written in Kotlin.

brew install https://raw.githubusercontent.com/kennycason/call/master/script/brew/call.rb

Usage

Add Command

Add a command to your local library.

Example:

# add single commands
call add l "ls -l"
call add api-status "curl -I https://api.datarank.com 2>/dev/null | head -n 1 | cut -d$' ' -f2"
call add storm-up "ansible-playbook deploy-storm.yml -i inventory/production -vvvv --private-key=keys/id_deployer -u deployer"
call add cluster-size "curl -s whale01.ttagg.com:9200/topic-*/_search | jq .hits.total"

# import library from url
call add https://raw.githubusercontent.com/kennycason/call/master/src/main/resources/com/kennycason/call/library/.call.library.sample.json

# import library from file
call add ~/.call.library.backup.json

Add a command with parameter placeholders via the @{} syntax

# add command with parameter placeholder 
call add l "ls -l @{1}"

# run command
call l /tmp/

Remove Command

Remove a command from your local library.

Example:

call remove api-status
call remove maelstrom-up

Run Command

Run one command with none or more arguments To run multiple commands simply append each command. e.g.

call command [arg1 args2 ...]

Example with sample output:

> call api-status
200
> call cluster-size
1340411047

Example of passing in a single parameter

> call add api-status "curl -I @{1} 2>/dev/null | head -n 1 | cut -d$' ' -f2"
> call api-status http://api.datarank.com
200

Help

Prints a usage message. Help welcomed :)

call help

List

Prints a list of all commands and their definitions

call list

Install

Brew Install

brew install https://raw.githubusercontent.com/kennycason/call/master/script/brew/call.rb

Install (via Bash Script)

A helper script has been added to install Run. Java is required to run. The install is a single a jar from Maven Central.

bash <(curl -s https://raw.githubusercontent.com/kennycason/call/master/script/install.sh)

Maven Install (To include in other code)

<dependency>
    <groupId>com.kennycason</groupId>
    <artifactId>call</artifactId>
    <version>1.0</version>
</dependency>

After installation the command name is call

Coming Soon

  • Sorting by frequency used
  • Recording stats: usage count, responses, etc
  • Better handling of library add/remove features. e.g. force-overwrite, etc

Library File Format [~/.call.library.json]

Currently there is only a bare-bone format defined.

{
    "version": 1.0,
    "commands": [
        {
            "command": "l",
            "definition": "ls -l",
        }
    ]
}

Notes

Currently Run depends on Bash to execute all commands. Commands are stored in the local json file: ~/.call.library.json

Command Fun

Infinite Loop via Run!

> call add call "call call"
command [call] added.
        call call
>call call

Versions

Version
1.0