Code Monkey home page Code Monkey logo

qa's Introduction

QuickAccess

QuickAccess (QA) is a tiny app written in Go. It serves one purpose: to create a quick access menu in your terminal. Menu items are basically shortcuts to shell command.

Type qa in your terminal to bring up the menu:

demo

You can use this app to:

  • quickly connect to remote servers by SSH
  • simplify various daily tasks

Build

To build this app for your current platform, type:

go get && go build

To build it for every supported platform (linux/x64 and windows/x64), type:

make

Installing

Installing from source

go get -u github.com/kapitanov/qa

Downloading pre-built binaries

  • For Linux/x64:

    curl -L https://github.com/kapitanov/qa/releases/download/v0.2.0/qa-v0.2.0-linux-x64.zip -o qa.zip
    unzip qa.zip -d /usr/local/bin/
    chmod +x /usr/local/bin/qa
    rm qa.zip
  • For Windows/x64:

    $QA_URL = "https://github.com/kapitanov/qa/releases/download/v0.2.0/qa-v0.2.0-windows-x64.zip";
    (New-Object System.Net.WebClient).DownloadFile($QA_URL, "qa.zip");
    $QA_DIR = join-path $env:LOCALAPPDATA "QA-App";
    Expand-Archive qa.zip -d $QA_DIR -f;
    Rm qa.zip;
    $envPath = Get-ItemProperty -Path 'Registry::HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\Environment' -Name PATH;
    $envPath = "$envPath;$QA_DIR";
    Set-ItemProperty -Path 'Registry::HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\Environment' -Name PATH -Value $envPath;
    $env:PATH = "$env:PATH;$QA_DIR";

    Note: you might need to restart your computer for PATH changes to take effect. If you have chocolatey installed, you can run refreshenv script. It'll apply PATH changes without restarting.

After that, you should be able to execute a qa command in your terminal.

Configuring

You need to create a JSON file .qa in your home directory with the following content:

{
    "commands" :[
        {
            "name":"Command display name",
            "cmd" :"command_to_execute"
        },
        {
            "name":"Command display name",
            "cmd" :"command_to_execute",
            "args" : ["list","of","arguments"]
        }
    ]
}

Root element commands is required and it has to be an array. Its items map are menu items. Their properties are:

  • name - a menu item title (required element)
  • cmd - a command to run (required element)
  • args - a list of command's arguments (optional)

You can use environment variables in cmd and args, including:

  • ~ and $HOME for current user's home directory
  • $(pwd) for current directory
  • $ENV_VAR_NAME for enviroment variable ENV_VAR_NAME

qa's People

Contributors

kapitanov avatar

Stargazers

 avatar sheldonhull avatar Shergin Rodion avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.