Command line tool for sharing commands and scripts.
Table of Contents:
- Install
- Hello world
- Create new shell command
- Push command to repository
- Share your command
- List commands
pip install git+git://github.com/eyalev/lk.git
$ lk hello-world
| Command not found locally.
|
| Cloning remote repo: https://github.com/lk-commands/default
| to local path: YOUR_LOCAL_APP_DATA_PATH
|
| Command found in cloned repo at: YOUR_CLONED_REPO_PATH
|
| Adding 'hello-world' to list of local commands.
|
| Command output:
Hello World
$ lk hello-world
Hello World
$ lk create-shell-command hello-me
| Enter shell command:
echo 'Hello me'
| Command successfully added
$ lk hello-me
Hello me
$ lk push hello-me
| Configuring commands repository
| Create one if needed. Example: https://github.com/your-user-name/lk-commands
| Enter repository URL:
https://github.com/your-user-name/lk-commands
| Pusing command 'hello-me' to repo: https://github.com/your-user-name/lk-commands
|
| Command pushed successfuly.
Other users can run your lk-command like this:
$ lk hello-me --repo=https://github.com/your-user-name/lk-commands
# Fetching remote repo: https://github.com/your-user-name/lk-commands
# Found command 'hello-me' in local repo: https://github.com/your-user-name/lk-commands
# Adding 'hello-me' to list of local commands.
# Command contents:
--------------------------------------
echo 'Hello me'
--------------------------------------
# Running command:
Hello me
$ lk hello-me
Hello me
$ lk list
hello-world # https://github.com/lk-commands/default
hello-me # https://github.com/your-user-name/lk-commands
...
...
...
The add-command
command will create a new command python file.
There, you can add python code for execution.
Example:
$ lk add-command command1
| Adding command: command1
| Command location: PATH_TO_COMMAND
Now you can edit the file.
Open it with your favorite editor and add custom code.
Example:
print('command1 output')