
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) list of some interesting commands:
backup # Backups the current directory.
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.
job # Executes one or more scripts periodically.
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).
serve # Starts a HTTP server that shares files via a web interface.
ssl-new # Creates a new self-signed SSL certificate.
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) => {
const docker = context.require('./docker');
const git = context.require('./git');
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.
Copyright
That software makes use of free version of MD Bootstrap.