# README
Command
github.com/leep-frog/command
is a Go package for writing custom bash commands in Go! Some of the most valuable benefits of this package include:
See the following docs folders for more info:
-
docs/basics
folder: Core concepts and types for this package. -
docs/features
folder: Exhaustive list of features.
Installation
TODO: Update this section to use user's go module instead of this repo directly.
-
Download this repository locally:
export $LEEP_INSTALLATION_PATH=/some/path pushd $LEEP_INSTALLATION_PATH > /dev/null git clone https://github.com/leep-frog/command.git popd > /dev/null
-
Add the following to your bash profile:
source $LEEP_INSTALLATION_PATH/command/sourcerer/cmd/load_sourcerer.sh
-
Reload your shell and you're done!
Writing Your First Command
There are a couple of ways to get started. Some people love reading through a good doc, while others prefer to get their hands on examples right away. The following two sub-sections should hopefully satiate both of those approaches.
Building Blocks Docs
Example
The steps from the Installation section will create a new bash
CLI called sourcerer
. You can use this command to generate entirely new bash
CLIs written completely in Go!
To get an idea of how to write your own commands, start with an example:
-
Download the example_main.go file locally and read through the file to become familiar with CLI setup (the file is thoroughly commented).
-
cd
into the local directory containing theexample_main.go
file. -
Run
sourcerer . my_custom_clis
(and add this line to your bash profile to automatically load this command from now on).
You are now able to use the mfc
command in your bash shell! Try out the following runs and see what happens:
-
mfc
-
mfc $USER
-
mfc <tab><tab>
-
mfc B<tab><tab>
-
mfc Br<tab>
-
mfc there 10
-
mfc World -f 10
To explore a more thorough explanation of all this package can do,
check out the docs/features
folder