docs / watch
cwm watch
Install or remove a shell hook that records each command with its folder.
$ cwm watch <start|stop|status> [-ex a,b] How it works
watch startadds a block to your profile. The block callscwm watch logafter every command. There is no background process.- Commands that look like they hold secrets (password, token, secret, api key, Authorization, bearer, private key) are never stored.
- Commands that start with a space are never stored.
-extakes a comma separated list of command names to skip, for examplecwm,clear. Runwatch start -ex ...again to update the list.- Read the log back with
cwm get -a. Remove duplicates withcwm tidy watch. cwm watch logis internal. The shell hook uses it.
Subcommands
- watch start
- Install the hook in your shell profile.
- watch stop
- Remove the hook.
- watch status
- Show whether the hook is active and the exclusion list.
Flags
- -ex, --exclude <list>
- Command names to skip, comma separated.
Examples
Start recording, skipping cwm and clear
$ cwm watch start -ex cwm,clear Watch session started successfully!
Profile updated: C:\Users\you\.bashrc
Excluded Commands: cwm,clear
Not recorded: commands that look like they contain secrets, and commands that start with a space
Activate it now with: source ~/.bashrcCheck status
$ cwm watch status Watch status: ACTIVE
Shell Type: bash
Profile File: C:\Users\you\.bashrc
Excluded Commands: cwm,clearStop recording
$ cwm watch stop CWM watch hook removed from profile successfully.
Apply it now with: source ~/.bashrc