Skip to content

docs / clear

cwm clear

Delete saved commands, wipe history, or restore from the trash.

$ cwm clear [name] [flags]

How it works

  • Deleted saved commands go to a trash buffer that keeps the newest 100.
  • Pick items by number: 1, 3, 5, a range 2-4, or all.
  • Script files are moved to ~/.cwm/scripts/.trash and moved back by clear -r. Files outside the scripts folder are never touched.
  • When a copy bank is set, the delete is applied there too, so the next sync does not bring the command back.

Flags

-r, --restore [name]
Restore from trash. Without a name, list the trash and pick.
-n, --list
List trashed commands.
--trash
Empty the trash for good.
-t, --tag <tag>
Clear commands with exactly this tag.
-f, --fuzzy
Fuzzy match the query.
-s, --saved
Clear all saved commands.
-d, --history
Clear all history logs in the database.
-a, --active <path>
Clear history recorded for one folder.
-c, --config
Reset stored settings.
-y, --yes
Skip confirmation prompts.

Examples

Delete one command

cwm clear
$ cwm clear gs
Saved Commands
ID     Variable         Command                              Tags             Description
-----------------------------------------------------------------------------------------------
1      gs               git status -sb                       git
 
Enter number(s) to delete (e.g. 1, 3, 5), 'all' to delete all, or Enter to cancel: 1
Successfully deleted 1 command(s) and moved to trash: gs

Look at the trash

cwm clear
$ cwm clear -n
Trashed Commands (Last 100)
ID     Variable         Command                              Tags             Description
-----------------------------------------------------------------------------------------------
1      gs               git status -sb                       git

Bring it back

cwm clear
$ cwm clear -r gs
Restored command: gs