lcs
A CLI based simple, fast and sleek command library tool, to store complex commands with descriptions and shortcuts.
It can also ask for user defined variables.
© 2025 by Alexander Dorn - MIT license
Usage: lcs [option] search_term_always_last
============================================================
Searches for a command in the description and offers the findings for execution
The DB contains an explanation and the command with optional variables ~/.lcs-db.csv is a ; separated CSV
Here an example of an entry - which is generated automatically when you use the --add option :
Echo test;echo "Hello World"
Options
--help, -h Show this help
--version Show version info
--verbose, -v Show verbose logging
--fast, -f Fast select option number (e.g. -f 2)
--print Print command only
--copy Copy command to clipboar (no execution)
--add Add a new command. Usage: lcs --add "Desc" "Cmd" or interactive mode
--edit Search, remove and re-add/edit
--remove Search and remove a command
--db Path to custom database, default: ~/.lcs-db.csv
Using Variables
You can define variables in commands to be filled at runtime.
Syntax: {"Label":"DefaultValue"}
Example: ssh -i {"KeyFile":"~/.ssh/id_rsa"} user@host
Examples
Add a command : lcs --add "Echo test" 'echo "Hello World"'
Execute/recall : lcs hello
Copy cmd to clipboard: lcs --copy hello
Remove command: lcs --remove hello
Print/View cmd: lcs --print hello
Installation in Mac or Linux (e.g. Ubuntu)
Testing
For testing no installation is needed, just make the bash version executable with
chmod +x lcs.sh
./lcs.sh --help
If you like the concept, compile the fast and compact GO version with full functionality.
To compile for Linux
#install GO compiler (Ubuntu/apt)
sudo apt install golang
#compile and test run in directory
go build -o lcs lcs.go
./lcs --help
#to install locally in sys
sudo cp lcs /usr/local/bin/
To compile for Mac
#install GO compiler
brew install go
#compile and test run in directory
go build -o lcs lcs.go
./lcs --help
#to install locally in sys
sudo cp lcs /usr/local/bin/
lcs --help