termo (or Terminal Macros) is a command-line tool designed to help users record and run macros directly from the terminal. This tool allows you to capture a sequence of commands, store them under a specific name, and then replay those commands as needed. It's particularly useful for automating repetitive tasks.
- Record Macros: Capture a series of commands under a specific name.
- Run Macros: Replay the commands in a recorded macro with a single command.
- Simple CLI Interface: Easily start, abort, finish, and run macros with straightforward commands.
- Python 3.12+
click
package (handled automatically during installation)
To install termo using pip
:
-
Clone the repository:
git clone https://github.com/ajaypremshankar/homebrew-termo.git cd homebrew-termo
-
Install with
pip
:pip install .
Or you can install it directly from Homebrew:
brew install ajaypremshankar/homebrew-termo/termo
Once installed, the macro
command will be available in your terminal. Here’s how to use it:
To start recording a macro, use:
tm new <name>
Replace <name>
with the name you’d like to give to this macro.
Example:
tm new my_macro
If you want to stop recording without saving, use:
tm cancel
This will discard all commands recorded since the last record start
.
To stop recording and save the commands to the macro, use:
tm save
The commands recorded between record start
and record finish
will be saved.
To replay the commands stored in a macro, use:
tm exec <name>
Replace <name>
with the name of the macro you want to run.
Example:
tm exec my_macro
-
Start recording a macro named
backup
:tm new backup
-
Run the commands you want to record, for example:
cp ~/Documents/important-file.txt ~/Backups/ echo "Backup completed"
-
Finish recording the macro:
tm save
-
Now, whenever you want to execute the
backup
macro, simply run:tm exec backup
tm --help
To uninstall termo, you can use pip
:
pip uninstall termo
Or if installed via Homebrew:
brew uninstall termo
This project is licensed under the MIT License. See the LICENSE file for more details.