Envoy - Command Logger Envoy is a lightweight, background utility that logs your terminal commands. It's designed to be a simple and unobtrusive way to keep a history of your shell usage, which can be useful for debugging, tracking work, or just remembering what you did. Features Starts and stops on demand : Only logs commands when you explicitly turn it on. : Only logs commands when you explicitly turn it on. Saves to a custom file : You can specify the log file name. : You can specify the log file name. Cross-platform : Works on both Linux and macOS using bash or zsh. : Works on both Linux and macOS using bash or zsh. Minimal overhead: Runs in the background and has no noticeable impact on shell performance. Installation Prerequisites Go : You must have Go (version 1.20 or newer) installed. : You must have Go (version 1.20 or newer) installed. A Shell: This utility is designed for bash or zsh. Step-by-Step Guide Clone the Repository git clone https://github.com/heyyviv/envoy.git cd envoy Initialize Go Module go mod init envoy Build the Executable go build -o ./envoy main.go Configure Your Shell Now, you need to add the shell hook to your profile so that Envoy runs with every command. This involves copying a code block into your shell's configuration file (.zshrc or .bashrc) and updating the path to the Envoy executable. For Zsh (macOS and Linux): Add the following function to your ~/.zshrc file: function preexec_go() { if [[ -n " $1 " && " $1 " != " preexec_go " ]] ; then # CHANGE THIS PATH to the location of your 'envoy' executable ~ /Desktop/projects/envoy/envoy " $1 " > /dev/null 2>&1 & disown fi } preexec_functions+=(preexec_go) For Bash (Linux): Add the following function to your ~/.bashrc file: function preexec_go() { local command_line= $( history 1 | sed ' s/^ *[0-9]* *// ' ) if [[ -n " $command_line " && " $command_line " != " preexec_go " ]] ; then # CHANGE THIS PATH to the location of your 'envoy' executable ( ~ /Desktop/projects/envoy/envoy " $command_...
First seen: 2025-08-29 08:32
Last seen: 2025-08-29 11:32