Skip to content

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 start adds a block to your profile. The block calls cwm watch log after 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.
  • -ex takes a comma separated list of command names to skip, for example cwm,clear. Run watch start -ex ... again to update the list.
  • Read the log back with cwm get -a. Remove duplicates with cwm tidy watch.
  • cwm watch log is 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
$ 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 ~/.bashrc

Check status

cwm watch
$ cwm watch status
Watch status: ACTIVE
Shell Type:        bash
Profile File:      C:\Users\you\.bashrc
Excluded Commands: cwm,clear

Stop recording

cwm watch
$ cwm watch stop
CWM watch hook removed from profile successfully.
  Apply it now with: source ~/.bashrc