Giter Site home page Giter Site logo

cobu's Introduction

COBU - Command Builder

A customizable command line utility that lets you build command line utilities - from the command line!

Installation

> npm install -g cobu

Examples

Output general help text to console

> cobu

Open the web sites you need for work with a single command

=== Configuration ===

# By using the --add option, we can add the web sites one at a time. If '--add' is not used, the actions
# that are declared will replace any existing actions on the same application or flag.
> cobu config workweb --add 'https://outlook.office.com/mail'
> cobu config workweb --add 'https://outlook.office.com/calendar'
> cobu config workweb --add 'https://myapplications.microsoft.com'
> cobu config workweb --add 'https://github.com/userid?tab=repositories'
> cobu config workweb --add 'https://dev.azure.com/MyOrg/MyProject'

=== Usage ===
> cobu workweb #Opens the above web pages in your default browser

Open up Wikipedia in any configured language

Let's use cobu to open up Wikipedia in your default browser, and configure a few languages to use

=== Configuration ===

# NOTE! For usage on Linux, enclose any arguments that contain variable references (e.g. '${query}')
# in single quotes to avoid the shell trying to replace them with variable values upon input
#
# Create the application named 'wikipedia' and assign it an action to open a URL, just by
# referencing the URL. Note that the language has a default value 'en'.
> cobu config wikipedia 'https://${language:en}.wikipedia.org/w/index.php?search=${query}'

# Configure French and Swedish as other possible target languages
> cobu config wikipedia fr '$language=fr'
> cobu config wikipedia sv '$language=sv'

# Instruct the application to pickup the ${query} variable from the next available argument
> cobu config wikipedia '${query}'

=== Usage ===
> cobu wikipedia 'Nikola Tesla'     # Opens Wikipedia in English, since it's the default
> cobu wikipedia sv 'Nikola Tesla'  # Opens up the Swedish Wikipedia page on Nikola Tesla

Open your favorite projects in VS Code

Let's use cobu to open any application that can be found in the path, in this case Visual Studio Code...

=== Configuration ===

# Create an application named 'vscode' and assign an action to open app 'code' with a folder argument
# You indicate that you want to open an app by assigning an action in format: '> appname ${argumentVariable}'
> cobu config vscode '> code ${folder}'

# And then add some projects
> cobu config vscode hello-world '$folder=C:\Users\me\Documents\projects\hello-world'
> cobu config vscode todo-list '$folder=C:\Users\me\Documents\projects\todo-list'

=== Usage ===
> cobu vscode hello-world    # Opens a new VS Code instance with your Hello World project loaded
> cobu vscode todo-list      # You'll figure out what this does...

cobu's People

Contributors

bolddp avatar

Stargazers

Marcus Törnroth avatar  avatar

Watchers

 avatar

cobu's Issues

import / export commands

A possibility to share created applications by issuing export and import commands

> cobu export myBigApp
cobu import <base64encoded>

The sender copies the entire output and sends it to the recipient.

The sender can then copy/paste the contents on the command line and get access to the same app.

Circular variable references needs to be detected

Reproduction steps

cobu config test https://www.${domain}.se
cobu config test vars $domain=${var1} $var1=${domain}
cobu test vars

Output

Maximum call stack size exceeded

Expected output

Error message Circular variable references detected: $domain -> $var1 -> $domain

Error when configuring a variable assignment to an app that already has action

Reproduction steps:

cobu config test https://www.google.se
cobu config test --add $var=value

Output

TypeError: Cannot read properties of undefined (reading 'name')
    at configureNode (C:\Users\bigha\AppData\Roaming\nvm\v16.17.1\node_modules\cobu\dist\configure.js:42:114)
    at Object.configureApplication [as orElse] (C:\Users\bigha\AppData\Roaming\nvm\v16.17.1\node_modules\cobu\dist\configure.js:10:11)
    at executeNode (C:\Users\bigha\AppData\Roaming\nvm\v16.17.1\node_modules\cobu\dist\executionTree.js:96:64)
    at async executeNode (C:\Users\bigha\AppData\Roaming\nvm\v16.17.1\node_modules\cobu\dist\executionTree.js:91:17)
    at async executeNode (C:\Users\bigha\AppData\Roaming\nvm\v16.17.1\node_modules\cobu\dist\executionTree.js:91:17)
    at async executeTree (C:\Users\bigha\AppData\Roaming\nvm\v16.17.1\node_modules\cobu\dist\executionTree.js:81:5)
    at async main (C:\Users\bigha\AppData\Roaming\nvm\v16.17.1\node_modules\cobu\dist\index.js:18:9)

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.