{"id":26660569,"url":"https://github.com/clevernamestaken/mousetrap","last_synced_at":"2025-08-24T22:54:39.869Z","repository":{"id":284258155,"uuid":"954346168","full_name":"CleverNamesTaken/Mousetrap","owner":"CleverNamesTaken","description":"Neovim plugin for red team operations to allow active documentation and command logging.","archived":false,"fork":false,"pushed_at":"2025-03-25T02:34:13.000Z","size":60,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-25T03:27:35.579Z","etag":null,"topics":["logging","nvim","redteam-tools","tmux"],"latest_commit_sha":null,"homepage":"","language":"Lua","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/CleverNamesTaken.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-03-25T00:10:06.000Z","updated_at":"2025-03-25T02:34:17.000Z","dependencies_parsed_at":"2025-03-25T03:27:37.447Z","dependency_job_id":null,"html_url":"https://github.com/CleverNamesTaken/Mousetrap","commit_stats":null,"previous_names":["clevernamestaken/mousetrap-","clevernamestaken/mousetrap"],"tags_count":0,"template":false,"template_full_name":"ColinKennedy/nvim-best-practices-plugin-template","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CleverNamesTaken%2FMousetrap","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CleverNamesTaken%2FMousetrap/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CleverNamesTaken%2FMousetrap/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CleverNamesTaken%2FMousetrap/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/CleverNamesTaken","download_url":"https://codeload.github.com/CleverNamesTaken/Mousetrap/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245458711,"owners_count":20618697,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["logging","nvim","redteam-tools","tmux"],"created_at":"2025-03-25T12:18:20.608Z","updated_at":"2025-08-24T22:54:39.841Z","avatar_url":"https://github.com/CleverNamesTaken.png","language":"Lua","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Description\n\nMousetrap is a Neovim plugin that uses tmux and scripted windows to allow users to execute complex terminal operations by keeping your hands on the keyboard and off of the mouse.  The major goal is to reduce cognitive load by working in a nvim instance and actively documenting your actions as you operate.\n\nMousetrap is similar to vim-slime, but more tmux specific with better terminal navigation and logging features.  Credit to Erik Falor's talk [Vim Muggle to Wizard in 10 Easy Steps](https://infocon.org/cons/Security%20BSides/BSides%20Salt%20Lake%20City/BSides%20Salt%20Lake%20City%202015/From%20Vim%20Muggle%20to%20Wizard%20in%2010%20Easy%20Steps%20-%20Erik%20Falor.mp4) for unlocking the Wizardry of vim.\n\n# Why use Mousetrap?\n\nWhen conducting red team assessments, I wanted to improve my efficiency and logging.  I found that I could address both of these goals by primarily operating within vim.  By synergizing tmux, [ultisnips](https://github.com/SirVer/ultisnips) and vim, I could:\n\n1) Stay focused on the objective at hand by remaining in vim and sending my commands to tmux windows.\n2) Stay consistent by using red team playbooks developed and stored as Ultisnips snippets.\n3) Log my activities by parsing the output of my tmux and scripted windows, and saving them off as yaml files.\n4) Quickly reconstruct my activities by logging all commands sent through vim in a csv.\n\n# Installation\n\nHowever you choose to install, tmux and neovim are dependencies.\n\n```\napt install tmux neovim -y\n```\n\n* with [lazy.nvim](https://github.com/folke/lazy.nvim)\n\n```\nreturn {\n  'CleverNamesTaken/Mousetrap',\n}\n```\n\n* Bootstrap install\n\n```\nmkdir -p ~/.config/nvim\nsudo apt install tmux neovim -y\ngit clone https://github.com/CleverNamesTaken/Mousetrap \ncp -r Mousetrap/lua ~/.config/nvim\ncp -r Mousetrap/plugin ~/.config/nvim\ncp -r Mousetrap/doc  ~/.config/nvim\necho 'require(\"mousetrap\")' \u003e\u003e ~/.config/nvim/init.lua\n```\n\n# Tutorial\n\nSee [TUTORIAL.md](TUTORIAL.md)\n\n# Customize your settings\n\nThe default settings are quite reasonable, but the things that you might be interested in changing are as follows:\n\n## Log settings\n\nMousetrap has four settings in `mousetrap/config.lua`:\n- workDir : Where scripted window files will be created. Default setting is `~/work/mousetrap`.\n- logDir : This is where `lastCommand.txt` and directories for each terminal will be created.  Default setting is `~/work/mousetrap/logs/`.\n- logTime : This is how many minutes that Mousetrap will allow you wait before giving up on trying to re-update your command output yaml files or `lastCommand.txt`.  By default, this is 5 minutes.\n- grabLineMax : This is the number of lines that mousetrap will attempt to grab for a manual grab of the output before it blocks you. If you try to grab too much output and put it in your buffer, it is possible your session will lock up.  Instead, mousetrap will prompt you to open up `lastCommand.txt` in a new tab.  By default, this value is 100 lines.\n\n## Keybindings\n\nKeybindings can be modified in `plugins/mousetrap.lua`.  There are a lot here, and default Mousetrap keybindings stomp on `\u003cc-a\u003e` to clear a terminal.  The other non-leader keybinds it uses are as follows (all in normal mode):\n\n- `\u003cc-k\u003e`\n- `\u003cC-s\u003e`\n- `+`\n- `-`\n- `H`\n- `K`\n- `U`\n\n# TODO\n\n- Add documentation on OutputCut\n\nKnown bugs:\n\n- If you drop into a docker container (and presumably other types of shells out there), your pane title might change.  This will break Mousetrap's ability to send commands, so implement some sort of way to revert the pane title back.\n\nLimitations:\n\n- After creating a pane, Mousetrap will not allow you rename it.  This is because the name of the terminal is how Mousetrap knows to find the script for reading output.\n- Terminal names must follow this format \u003cWINDOW\u003e~\u003cPANE\u003e.  Alphanumeric characters and periods can be used in the window and pane titles, but nothing else.\n\n# Similar projects\n\n- [vim slime](https://github.com/jpalardy/vim-slime)\n- [vim-tmux-runner](https://github.com/christoomey/vim-tmux-runner)\n- [nvim-terminal-send](https://github.com/max607/nvim-terminal-send)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fclevernamestaken%2Fmousetrap","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fclevernamestaken%2Fmousetrap","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fclevernamestaken%2Fmousetrap/lists"}