New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

ego-cli

Package Overview
Dependencies
Maintainers
1
Versions
87
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ego-cli

Command Line Interface, which is designed to handle things, like Dev(Ops) tasks, much faster.

  • 0.43.0
  • unpublished
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

npm

ego-cli

Command Line Interface, which is designed to handle things, like Dev(Op) tasks, much faster.

Install

You can install it globally:

npm install -g ego-cli

Or for your project, from where your package.json file is stored:

npm install --save-dev ego-cli

Execute

For example run the integrated Yeoman generator by executing:

ego new

To list all available commands, simply run

ego

Available commands

A (non complete) of some interesting commands:

build         # Shorthand for 'npm run build'.
docker-stop   # Stops all running Docker containers.
docker-up     # Shorthand for 'docker-compose up'.
git-checkout  # Checks out (to) a branch.
git-export    # Clones a repository to the working directory and removes the '.git' subfolder.
git-pull      # Pulls from all remotes to the current branch.
git-push      # Pushes the current branch to all remotes.
git-sync      # Syncs the current branch with all remotes.
new           # Starts the e.GO generator for Yeoman.
node-install  # Removes the 'node_modules' subfolder and executes 'npm install'.
run           # Runs one or more Node.js based script file(s).

Custom commands

To implement a command, lets say my-command, create a my-command.sh (my-command.cmd on Windows) file inside the .ego subfolder of your home directory, give it enough rights to be executed and fill it with the code, you would like to execute.

To execute the new command, simply run

ego my-command ARG1 ARG2

All additional arguments, after my-command, will be passed to the shell / batch script.

Scripts

With the help of run command, you can implement Node.js based scripts.

Create a .js file, like test.js, and use the following skeleton:

exports.execute = async (context) => {
    // context.args     =>  List of command line arguments, s. https://www.npmjs.com/package/minimist
    // context.cwd      =>  The full path of the current working directory
    // context.package  =>  The 'package.json' file of the e.GO CLI
    // context.queue    =>  A queue, that only executes 1 action at the same time, s. https://www.npmjs.com/package/p-queue
    // context.require  =>  Allows to include a NPM module of the e.GO CLI
    // context.values   =>  A key/value pair storage, that is available while the execution
    // context.verbose  =>  Indicates, if script should output additional information or not

    // docker utils
    const docker = context.require('./docker');
    // git utils
    const git = context.require('./git');
    // common app utils
    const util = context.require('./util');

    util.writeLine('Hello, from ' + __filename);
};

You can run the script, by executing

ego run test.js

from the folder, that contains the file.

You are also able to store it globally, inside the .ego subfolder, inside your user's home directory (${HOME}/.ego/test.js).

Contribute

The contribution guide explains, how to implement a new command, work with the code and open a pull request.

Keywords

FAQs

Package last updated on 02 Jun 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc