Never use notepads or history for searching for your past commands. With BME you can bookmark your commands, search in your bookmarked commands and execute them with edit possibility before execution.
Project description
BME
(Bookmark my Executions/Commands)
Never use notepads or history for searching for your past commands. With BME you can bookmark your commands, search in your bookmarked commands and execute them with edit possibility before execution.
Supported
OS
No specific requirements here, whatever runs Python
Requirements
Python
- 3.7+
Installing
MacOS
On most MacOS machines there is pip3
instead of pip
use pip3 for install
Install and update using pip:
pip install bme
or
pip3 install bme
All your commands are saved in '~/.bme/bookmarks.json'
Usage:
For adding bookmark:
(Quotas can be used)
bme add <your command>
For Removing bookmark:
(Quotas can be used)
bme rm <your command>
For List bookmarks:
(Quotas can be used)
bme list <searched>
- searched is optional, only if you want to list specific commands
- Regex, match case and full word flags are supported
For Executing bookmark:
Basic search bme run <searched>
Regex search bme run <searched> -r <my-regex*>
Formatting support:
You can format command from bookmark with python formatting as such
- Use {} to be placeholder for your tuple arguments
- Use {name} to be placeholder with key name for your dictionary arguments
Mixing tuple and dict arguments is not supported!
Example:
Tuple:
bme add echo "Hello {} !"
bme run ec Jiri
Dictionary arguments:
bme add echo "Hello {name} from {location}"
bme run ec name=Jiri location=Prague
or
bme run ec name=\"Jiri\" location=\"Prague\"
Optional flags:
"-e" or "--edit"
for editing command before execution
"-r <your-regex>" or "--regex <your-regex>"
for full word search only
"-f" or "--full-word"
for full word search only
"-m" or "--match-case"
for search with matching case
(Quotas can be used)
bme run <your command>
Sequences
Sequences are like scripts, except you don't have to search for location and manage them with different .bashrc
or different OS specific files.
Also thanks to this, you don't have to add them to PATH.
BME will take care of storing your sequences in your ~/.bme
folder and will help you to search in them.
These sequences work from everywhere and execution is always in your current working directory.
Commands:
Create Sequence
bme seq create {name}
Example:
bme seq create my_sequence
Remove Sequence
bme seq rm {name}
Example
bme seq rm my_sequence
Edit Sequence
bme seq edit
This will display location of json with sequences
Add Command to Sequence
This will add command to sequence with use of variadic arguments
bme seq add {sequence_name} {command...}
Example:
bme seq add my_sequence ssh jiri@192.168.1.0
Pop Command from Sequence
This will pop command from sequence with use of variadic arguments
bme seq pop {sequence_name} {command...}
Example:
bme seq pop my_sequence ssh jiri@192.168.1.0
Sequence Run
Runs supplied sequence, and will do search for you if not found
bme sequence run {sequence_name}
Sequence does support formatting of dynamic arguments same way as bookmarks these arguments will be passed to every command for formatting
Example:
bme sequence run my_sequence John
or
bme sequence run my_sequence name=John
Sequence Watch (!BETA!)
Launches sequence on file modify
bme sequence watch {sequence_name} {file_path}
List Sequence
This will list commands and sequences, if argument is used search in text is applied to results
Optional flags:
"-r <your-regex>" or "--regex <your-regex>"` for full word search only
"-f" or "--full-word" for full word search only
"-m" or "--match-case" for search with matching case
Example Data:
In sequence DB there is:
'ssh jiri@192.168.1.0' command
'ssh jiri@192.168.1.55' command
'scp jiri@192.168.1.55' command
Command bme sequence list
will list all the sequences and their commands
Specific listing format:
bme sequence list <optional commands that match this to list>
Example:
bme sequence list ssh
Output:
'ssh jiri@192.168.1.0' command
'ssh jiri@192.168.1.55' command
Did I made your life less painful ?
Support my coffee addiction ;)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file bme-1.4.4.tar.gz
.
File metadata
- Download URL: bme-1.4.4.tar.gz
- Upload date:
- Size: 15.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.9.19
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2a1066b6aed75652f1cd2b16dd2f5c67516a8ade33050a854e7b82368c72c01a |
|
MD5 | 955e40079fe967be56363dd339afc87f |
|
BLAKE2b-256 | addf19909045f36040006d46671f4a4a81da476fd57bbce263535ecaff873be2 |
File details
Details for the file bme-1.4.4-py3-none-any.whl
.
File metadata
- Download URL: bme-1.4.4-py3-none-any.whl
- Upload date:
- Size: 16.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.9.19
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 89ee552e1634951d4072443cd2a4cdf290531e2e25dfe569ef8a542e4589501c |
|
MD5 | 70f9d5c0e9f9121d928f5bf6dfb3b6b6 |
|
BLAKE2b-256 | 70c9efc8df3c78616f0da8c390c69a14874c376d8bc5e601d5b9cb90a0c30377 |