├── .gitignore ├── LICENSE ├── README.md ├── commands └── commands.go ├── flags └── flags.go ├── go.mod ├── go.sum ├── hotkeys └── hotkeys.go └── main.go /.gitignore: -------------------------------------------------------------------------------- 1 | # Binaries for programs and plugins 2 | *.exe 3 | *.exe~ 4 | *.dll 5 | *.so 6 | *.dylib 7 | 8 | # Ignore binary files 9 | what-cmd 10 | 11 | # Output of the go coverage tool when used with LiteIDE 12 | *.out 13 | 14 | # Envs and the like 15 | .github 16 | 17 | # Go workspace file 18 | go.work 19 | go.work.sum -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2024 Magnus Lyngra 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # what-cmd 2 | What-cmd is a cross-platform (windows, linux and macOS) command line tool written in Go that gives you an easy way to find the terminal command (and its flags) you're looking for when you've forgotten it or if you're new to the terminal. It is inspired by which-key and lazygit. 3 | 4 | ![what-cmd-demo](https://github.com/user-attachments/assets/4261dfce-455f-4f73-8115-57b4c07a32d2) 5 | 6 | Future releases: In future releases the command list may be expanded further. Improvements to the UX/UI may be considered as well as further functionality. 7 | 8 | To use this tool: 9 | 10 | Install dependencies first (Git and Go programming language). 11 | 12 | Linux: 13 | Depending on your package manager: 14 | 1. **Git:** 15 | 1. sudo pacman -S git -y 16 | 2. sudo dnf install git-all 17 | 3. sudo apt install git-all 18 | 19 | 2. **Git:** 20 | 1. sudo pacman -S go 21 | 2. sudo dnf install go 22 | 3. sudo apt install go 23 | 24 | Windows: 25 | 1. **Git:** 26 | 1. go to https://git-scm.com/download/win and the download should start automatically. Then install it. 27 | 28 | 2. **Git:** 29 | 1. go to https://golang.org/dl/ and download the latest version of go. 30 | 2. Follow this guide to install properly: https://www.geeksforgeeks.org/how-to-install-go-on-windows/ 31 | 32 | macOS 33 | 1. **Git:** 34 | - Using Homebrew (Recommended): 35 | ```sh 36 | brew install git 37 | ``` 38 | - Using Xcode Command Line Tools: 39 | ```sh 40 | xcode-select --install 41 | ``` 42 | 43 | 2. **Go:** 44 | - Using Homebrew (Recommended): 45 | ```sh 46 | brew install go 47 | ``` 48 | - Manual Installation: 49 | - Download the latest version of Go from [https://golang.org/dl/](https://golang.org/dl/) 50 | - Open the downloaded `.pkg` file and follow the instructions to install Go. 51 | 52 | Linux and macOS instructions for installing what-cmd: 53 | 54 | Option A: 55 | 1. Go to the latest release at https://github.com/OpusMag/what-cmd and download the binary. 56 | 2. Eun chmod +x ~/Downloads/what-cmd (or whatever dir you downloaded it to) 57 | 3. Move it to /usr/local/bin/ by running sudo mv what-cmd /usr/local/bin/ 58 | 59 | Option B: 60 | 1. Enter your terminal. 61 | 2. Git clone this repository either by using the URL or SSH (you can find this by clicking the green button in the upper right that says '<>Code'). 62 | 3. Then cd (change directory) into the repository. 63 | 4. Run the following commands to build and run the CLI: 64 | 65 | go mod tidy 66 | go build -o what-cmd main.go 67 | ./what-cmd 68 | 69 | If you want to use it without the ./ prefix you can do the following: 70 | while in the what-cmd directory and after building the binary: 71 | sudo mv what-cmd /usr/local/bin/ 72 | 73 | Confirm it has worked: 74 | what-cmd --help (this also shows the available flags) 75 | 76 | Windows instructions: 77 | 78 | Option A: 79 | 1. Go to the latest release at https://github.com/OpusMag/what-cmd, download the binary what-cmd.exe. 80 | 2. Move the binary to a directory, for example C:\Tools. 81 | 3. Add the directory to PATH by pressing Win + X and selecting System, then click on Advanced system settings. 82 | 4. In the System properties window, click on the Environment variables button. 83 | 5. In the Environment Variables window, find the Path variable in the System variables section and select it and click Edit. 84 | 6. In the Edit Environment Variable window, click New and add the path to the directory where you placed what-cmd.exe (for example c:\Tools), then click OK to close. 85 | 7. Verify it's working by opening a terminal and running 'what-cmd --help'. 86 | 87 | Option B: 88 | 1. 'git clone https://github.com/OpusMag/what-cmd' then cd into the repository. 89 | 2. Run 'go mod tidy' in the terminal to make sure dependencies are installed. 90 | 3. Then run 'go build -o what-cmd.exe main.go'. Then run the tool with '.\what-cmd.exe' 91 | 92 | General use of the tool(both windows and linux): 93 | 94 | 1. Options for the command (run "what-cmd -hotkeys" for example to search hotkeys for the terminal) 95 | 96 | -flags (flags for the commands. NB! Flags will now appear when you search for commands just by running what-cmd without flags) 97 | -hotkeys (linux terminal hotkeys) 98 | 99 | 2. By running ./what-cmd (or what-cmd) you'll now be able to search for commands either by name or description. If you append a flag (e.g. what-cmd -flags) you'll be able to search for the flags that are valid for each command. 100 | 101 | 3. When you've found the command (or flag or hotkey), hit enter and you'll be sent back to your terminal prompt and the command you found along with its description will be printed to your terminal. 102 | -------------------------------------------------------------------------------- /commands/commands.go: -------------------------------------------------------------------------------- 1 | package commands 2 | 3 | // Command represents a command and its description 4 | type Command struct { 5 | Name string 6 | Description string 7 | } 8 | 9 | // List of commands with descriptions 10 | var Words = []Command{ 11 | {"sudo", "Super User Do. Allows a user to run commands as an administrator"}, 12 | {"cat", "Concatenate and display the content of files"}, 13 | {"ls", "List directory contents"}, 14 | {"cd", "Change the current directory"}, 15 | {"pwd", "Print the current working directory"}, 16 | {"touch", "Create an empty file"}, 17 | {"mkdir", "Create a new directory"}, 18 | {"rm", "Remove files or directories"}, 19 | {"cp", "Copy files or directories"}, 20 | {"mv", "Move or rename files or directories"}, 21 | {"clear", "Clear the terminal screen"}, 22 | {"exit", "Exit the shell"}, 23 | {"echo", "Display a line of text"}, 24 | {"man", "Display the manual for a command"}, 25 | {"grep", "Search text using patterns"}, 26 | {"find", "Search for files in a directory hierarchy"}, 27 | {"chmod", "Change file modes or Access Control Lists"}, 28 | {"chown", "Change file owner and group"}, 29 | {"df", "Report file system disk space usage"}, 30 | {"du", "Estimate file space usage"}, 31 | {"head", "Output the first part of files"}, 32 | {"tail", "Output the last part of files"}, 33 | {"tar", "Store, list or extract files in an archive"}, 34 | {"wget", "Retrieve files from the web"}, 35 | {"curl", "Transfer data from or to a server"}, 36 | {"ps", "Report a snapshot of current processes"}, 37 | {"kill", "Send a signal to a process"}, 38 | {"top", "Display Linux tasks"}, 39 | {"htop", "Interactive process viewer"}, 40 | {"ssh", "OpenSSH SSH client (remote login program)"}, 41 | {"scp", "Secure copy (remote file copy program)"}, 42 | {"nano", "Simple text editor"}, 43 | {"vim", "Vi IMproved, a programmer's text editor"}, 44 | {"apt-get", "A package handling utility for Debian-based distributions"}, 45 | {"yum", "Package manager for RPM-based distributions"}, 46 | {"ping", "Send ICMP ECHO_REQUEST to network hosts"}, 47 | {"ifconfig", "Configure a network interface"}, 48 | {"ip", "Show/manipulate routing, devices, policy routing and tunnels"}, 49 | {"netstat", "Print network connections, routing tables, interface statistics, masquerade connections, and multicast memberships"}, 50 | {"ss", "Another utility to investigate sockets"}, 51 | {"mount", "Mount a file system"}, 52 | {"umount", "Unmount file systems"}, 53 | {"uname", "Print system information"}, 54 | {"uptime", "Tell how long the system has been running"}, 55 | {"whoami", "Print the current user id and name"}, 56 | {"hostname", "Show or set the system's host name"}, 57 | {"history", "Show the command history"}, 58 | {"alias", "Create an alias for a command"}, 59 | {"unalias", "Remove an alias"}, 60 | {"env", "Show the environment variables"}, 61 | {"export", "Set an environment variable"}, 62 | {"source", "Execute commands from a file in the current shell"}, 63 | {"su", "Switch user"}, 64 | {"passwd", "Change user password"}, 65 | {"useradd", "Create a new user"}, 66 | {"usermod", "Modify a user account"}, 67 | {"userdel", "Delete a user account"}, 68 | {"groupadd", "Create a new group"}, 69 | {"groupmod", "Modify a group"}, 70 | {"groupdel", "Delete a group"}, 71 | {"crontab", "Schedule periodic background jobs"}, 72 | {"at", "Schedule a command to run once at a later time"}, 73 | {"jobs", "List active jobs"}, 74 | {"bg", "Place a job in the background"}, 75 | {"fg", "Place a job in the foreground"}, 76 | {"killall", "Kill processes by name"}, 77 | {"xargs", "Build and execute command lines from standard input"}, 78 | {"tee", "Read from standard input and write to standard output and files"}, 79 | {"diff", "Compare files line by line"}, 80 | {"patch", "Apply a diff file to an original"}, 81 | {"sed", "Stream editor for filtering and transforming text"}, 82 | {"awk", "Pattern scanning and processing language"}, 83 | {"tr", "Translate or delete characters"}, 84 | {"cut", "Remove sections from each line of files"}, 85 | {"sort", "Sort lines of text files"}, 86 | {"uniq", "Report or omit repeated lines"}, 87 | {"wc", "Print newline, word, and byte counts for each file"}, 88 | {"basename", "Strip directory and suffix from filenames"}, 89 | {"dirname", "Strip last component from file name"}, 90 | {"readlink", "Print value of a symbolic link or canonical file name"}, 91 | {"ln", "Make links between files"}, 92 | {"stat", "Display file or file system status"}, 93 | {"file", "Determine file type"}, 94 | {"strings", "Print the strings of printable characters in files"}, 95 | {"md5sum", "Compute and check MD5 message digest"}, 96 | {"sha256sum", "Compute and check SHA256 message digest"}, 97 | {"gzip", "Compress files"}, 98 | {"gunzip", "Decompress files"}, 99 | {"bzip2", "Compress files with bzip2"}, 100 | {"bunzip2", "Decompress files with bzip2"}, 101 | {"zip", "Package and compress files"}, 102 | {"unzip", "Extract compressed files"}, 103 | {"rar", "Archive manager for .rar files"}, 104 | {"unrar", "Extract .rar files"}, 105 | {"7z", "File archiver with high compression ratio"}, 106 | {"7za", "Standalone version of 7z"}, 107 | {"7zr", "Reduced version of 7z"}, 108 | {"free", "Display memory usage"}, 109 | {"who", "Show who is logged on"}, 110 | {"last", "Show listing of last logged in users"}, 111 | {"dmesg", "Print or control the kernel ring buffer"}, 112 | {"lsblk", "List information about block devices"}, 113 | {"blkid", "Locate/print block device attributes"}, 114 | {"fdisk", "Partition table manipulator for Linux"}, 115 | {"mkfs", "Build a Linux file system"}, 116 | {"fsck", "File system consistency check and repair"}, 117 | {"parted", "A partition manipulation program"}, 118 | {"dd", "Convert and copy a file"}, 119 | {"sync", "Flush file system buffers"}, 120 | {"shutdown", "Halt, power-off or reboot the machine"}, 121 | {"reboot", "Reboot the system"}, 122 | {"docker run", "Run a command in a new container"}, 123 | {"docker start", "Start one or more stopped containers"}, 124 | {"docker stop", "Stop one or more running containers"}, 125 | {"docker restart", "Restart one or more containers"}, 126 | {"docker kill", "Kill one or more running containers"}, 127 | {"docker rm", "Remove one or more containers"}, 128 | {"docker rmi", "Remove one or more images"}, 129 | {"docker images", "List images"}, 130 | {"docker ps", "List containers"}, 131 | {"docker exec", "Run a command in a running container"}, 132 | {"docker build", "Build an image from a Dockerfile"}, 133 | {"docker pull", "Pull an image or a repository from a registry"}, 134 | {"docker push", "Push an image or a repository to a registry"}, 135 | {"docker login", "Log in to a Docker registry"}, 136 | {"docker logout", "Log out from a Docker registry"}, 137 | {"docker tag", "Create a tag TARGET_IMAGE that refers to SOURCE_IMAGE"}, 138 | {"docker inspect", "Return low-level information on Docker objects"}, 139 | {"docker logs", "Fetch the logs of a container"}, 140 | {"docker commit", "Create a new image from a container's changes"}, 141 | {"docker network", "Manage networks"}, 142 | {"docker volume", "Manage volumes"}, 143 | {"docker info", "Display system-wide information"}, 144 | {"docker version", "Show the Docker version information"}, 145 | {"docker swarm", "Manage Swarm"}, 146 | {"docker node", "Manage Swarm nodes"}, 147 | {"docker service", "Manage services"}, 148 | {"docker stack", "Manage Docker stacks"}, 149 | {"docker secret", "Manage Docker secrets"}, 150 | {"docker config", "Manage Docker configs"}, 151 | {"docker plugin", "Manage plugins"}, 152 | {"docker container", "Manage containers"}, 153 | {"docker image", "Manage images"}, 154 | {"docker system", "Manage Docker"}, 155 | {"docker context", "Manage contexts"}, 156 | {"docker builder", "Manage builds"}, 157 | {"docker checkpoint", "Manage checkpoints"}, 158 | {"docker trust", "Manage trust on Docker images"}, 159 | {"docker compose", "Define and run multi-container applications with Docker Compose"}, 160 | {"docker save", "Save one or more images to a tar archive (streamed to STDOUT by default)"}, 161 | {"docker load", "Load an image from a tar archive or STDIN"}, 162 | {"docker history", "Show the history of an image"}, 163 | {"docker prune", "Remove unused data"}, 164 | {"docker attach", "Attach local standard input, output, and error streams to a running container"}, 165 | {"docker diff", "Inspect changes to files or directories on a container’s filesystem"}, 166 | {"docker events", "Get real time events from the server"}, 167 | {"docker export", "Export a container’s filesystem as a tar archive"}, 168 | {"docker import", "Import the contents from a tarball to create a filesystem image"}, 169 | {"docker pause", "Pause all processes within one or more containers"}, 170 | {"docker unpause", "Unpause all processes within one or more containers"}, 171 | {"docker update", "Update configuration of one or more containers"}, 172 | {"docker top", "Display the running processes of a container"}, 173 | {"docker stats", "Display a live stream of container(s) resource usage statistics"}, 174 | {"docker wait", "Block until one or more containers stop, then print their exit codes"}, 175 | {"docker rename", "Rename a container"}, 176 | {"docker cp", "Copy files/folders between a container and the local filesystem"}, 177 | {"docker login", "Log in to a Docker registry"}, 178 | {"docker logout", "Log out from a Docker registry"}, 179 | {"docker search", "Search the Docker Hub for images"}, 180 | {"docker volume create", "Create a volume"}, 181 | {"docker volume inspect", "Display detailed information on one or more volumes"}, 182 | {"docker volume ls", "List volumes"}, 183 | {"docker volume prune", "Remove all unused local volumes"}, 184 | {"docker volume rm", "Remove one or more volumes"}, 185 | {"docker network create", "Create a network"}, 186 | {"docker network inspect", "Display detailed information on one or more networks"}, 187 | {"docker network ls", "List networks"}, 188 | {"docker network prune", "Remove all unused networks"}, 189 | {"docker network rm", "Remove one or more networks"}, 190 | {"docker plugin create", "Create a plugin from a rootfs and configuration"}, 191 | {"docker plugin disable", "Disable a plugin"}, 192 | {"docker plugin enable", "Enable a plugin"}, 193 | {"docker plugin inspect", "Display detailed information on one or more plugins"}, 194 | {"docker plugin install", "Install a plugin"}, 195 | {"docker plugin ls", "List plugins"}, 196 | {"docker plugin push", "Push a plugin to a registry"}, 197 | {"docker plugin rm", "Remove one or more plugins"}, 198 | {"docker plugin set", "Change settings for a plugin"}, 199 | {"docker plugin upgrade", "Upgrade an existing plugin"}, 200 | {"docker secret create", "Create a secret from a file or STDIN as content"}, 201 | {"docker secret inspect", "Display detailed information on one or more secrets"}, 202 | {"docker secret ls", "List secrets"}, 203 | {"docker secret rm", "Remove one or more secrets"}, 204 | {"docker config create", "Create a config from a file or STDIN"}, 205 | {"docker config inspect", "Display detailed information on one or more configs"}, 206 | {"docker config ls", "List configs"}, 207 | {"docker config rm", "Remove one or more configs"}, 208 | {"docker swarm init", "Initialize a swarm"}, 209 | {"docker swarm join", "Join a swarm as a node and/or manager"}, 210 | {"docker swarm leave", "Leave the swarm"}, 211 | {"docker swarm update", "Update the swarm"}, 212 | {"docker node promote", "Promote one or more nodes to manager in the swarm"}, 213 | {"docker node demote", "Demote one or more nodes from manager in the swarm"}, 214 | {"docker node inspect", "Display detailed information on one or more nodes"}, 215 | {"docker node ls", "List nodes in the swarm"}, 216 | {"docker node rm", "Remove one or more nodes from the swarm"}, 217 | {"docker service create", "Create a new service"}, 218 | {"docker service inspect", "Display detailed information on one or more services"}, 219 | {"docker service ls", "List services"}, 220 | {"docker service rm", "Remove one or more services"}, 221 | {"docker service scale", "Scale one or multiple replicated services"}, 222 | {"docker service update", "Update a service"}, 223 | {"docker stack deploy", "Deploy a new stack or update an existing stack"}, 224 | {"docker stack rm", "Remove one or more stacks"}, 225 | {"docker stack services", "List the services in the stack"}, 226 | {"docker stack ps", "List the tasks in the stack"}, 227 | {"docker stack ls", "List stacks"}, 228 | {"docker checkpoint create", "Create a checkpoint from a running container"}, 229 | {"docker checkpoint ls", "List checkpoints for a container"}, 230 | {"docker checkpoint rm", "Remove a checkpoint"}, 231 | {"docker checkpoint restore", "Restore a container from a checkpoint"}, 232 | {"docker trust key generate", "Generate and load a signing key-pair"}, 233 | {"docker trust key load", "Load a private key for signing tags"}, 234 | {"docker trust signer add", "Add a signer to a repository"}, 235 | {"docker trust signer remove", "Remove a signer from a repository"}, 236 | {"docker trust inspect", "Return low-level information about keys and signatures"}, 237 | {"docker trust revoke", "Revoke trust for an image"}, 238 | {"docker trust sign", "Sign an image"}, 239 | {"docker trust view", "View signed tags in a repository"}, 240 | {"systemctl", "Examine and control the systemd system and service manager"}, 241 | {"systemctl start", "Start (activate) one or more units"}, 242 | {"systemctl stop", "Stop (deactivate) one or more units"}, 243 | {"systemctl restart", "Restart one or more units"}, 244 | {"systemctl reload", "Reload one or more units"}, 245 | {"systemctl enable", "Enable one or more unit files"}, 246 | {"systemctl disable", "Disable one or more unit files"}, 247 | {"systemctl status", "Show runtime status of one or more units"}, 248 | {"systemctl is-active", "Check whether units are active"}, 249 | {"systemctl is-enabled", "Check whether unit files are enabled"}, 250 | {"systemctl list-units", "List units currently in memory"}, 251 | {"systemctl list-unit-files", "List unit files installed on the system"}, 252 | {"systemctl daemon-reload", "Reload systemd manager configuration"}, 253 | {"systemctl mask", "Mask one or more units"}, 254 | {"systemctl unmask", "Unmask one or more units"}, 255 | {"systemctl isolate", "Start one unit and stop all others"}, 256 | {"systemctl kill", "Send a signal to processes of a unit"}, 257 | {"systemctl show", "Show properties of one or more units/jobs or the manager"}, 258 | {"systemctl cat", "Show unit file and drop-ins"}, 259 | {"systemctl edit", "Edit a drop-in snippet or a whole unit file"}, 260 | {"systemctl set-property", "Set one or more properties of a unit"}, 261 | {"systemctl help", "Show manual for one or more units"}, 262 | {"journalctl", "Query and display messages from the journal"}, 263 | {"journalctl --boot", "Show messages from the current boot"}, 264 | {"journalctl --list-boots", "Show a list of boots"}, 265 | {"journalctl --unit", "Show messages for a specific unit"}, 266 | {"journalctl --since", "Show messages since a specific time"}, 267 | {"journalctl --until", "Show messages until a specific time"}, 268 | {"journalctl --follow", "Follow new messages"}, 269 | {"journalctl --output", "Change the output format"}, 270 | {"journalctl --priority", "Show messages with a specific priority"}, 271 | {"journalctl --grep", "Filter messages by a regular expression"}, 272 | {"timedatectl", "Control the system time and date"}, 273 | {"timedatectl status", "Show current time settings"}, 274 | {"timedatectl set-time", "Set the system time"}, 275 | {"timedatectl set-timezone", "Set the system timezone"}, 276 | {"timedatectl list-timezones", "List available timezones"}, 277 | {"timedatectl set-ntp", "Enable or disable Network Time Protocol (NTP) synchronization"}, 278 | {"hostnamectl", "Control the system hostname"}, 279 | {"hostnamectl status", "Show current hostname settings"}, 280 | {"hostnamectl set-hostname", "Set the system hostname"}, 281 | {"hostnamectl set-icon-name", "Set the system icon name"}, 282 | {"hostnamectl set-chassis", "Set the system chassis type"}, 283 | {"hostnamectl set-deployment", "Set the system deployment environment"}, 284 | {"hostnamectl set-location", "Set the system location"}, 285 | {"localectl", "Control the system locale and keyboard layout settings"}, 286 | {"localectl status", "Show current locale settings"}, 287 | {"localectl set-locale", "Set the system locale"}, 288 | {"localectl list-locales", "List available locales"}, 289 | {"localectl set-keymap", "Set the system keyboard layout"}, 290 | {"localectl list-keymaps", "List available keyboard layouts"}, 291 | {"loginctl", "Control the systemd login manager"}, 292 | {"loginctl list-sessions", "List current sessions"}, 293 | {"loginctl session-status", "Show status of a session"}, 294 | {"loginctl terminate-session", "Terminate a session"}, 295 | {"loginctl list-users", "List currently logged-in users"}, 296 | {"loginctl user-status", "Show status of a user"}, 297 | {"loginctl enable-linger", "Enable linger for a user"}, 298 | {"loginctl disable-linger", "Disable linger for a user"}, 299 | {"loginctl lock-session", "Lock a session"}, 300 | {"loginctl unlock-session", "Unlock a session"}, 301 | {"loginctl lock-sessions", "Lock all sessions"}, 302 | {"loginctl unlock-sessions", "Unlock all sessions"}, 303 | {"nmcli", "Command-line client for NetworkManager"}, 304 | {"nmcli general", "General network management commands"}, 305 | {"nmcli networking", "Control network connectivity"}, 306 | {"nmcli radio", "Control radio transmitters"}, 307 | {"nmcli connection", "Manage network connections"}, 308 | {"nmcli device", "Manage network devices"}, 309 | {"nmcli agent", "Run nmcli as a NetworkManager secret agent"}, 310 | {"nmcli monitor", "Monitor NetworkManager changes"}, 311 | {"iwconfig", "Configure wireless network interfaces"}, 312 | {"iwconfig essid", "Set the ESSID (network name)"}, 313 | {"iwconfig mode", "Set the operating mode (Ad-Hoc, Managed, Master, Repeater, Secondary, Monitor)"}, 314 | {"iwconfig freq", "Set the operating frequency or channel"}, 315 | {"iwconfig ap", "Force the card to register to the Access Point given by the address"}, 316 | {"iwconfig rate", "Forces the bit-rate to a specific value"}, 317 | {"iwconfig txpower", "Set the transmit power"}, 318 | {"iwconfig retry", "Set the maximum number of retries"}, 319 | {"iwconfig rts", "Set the RTS/CTS threshold"}, 320 | {"iwconfig frag", "Set the fragmentation threshold"}, 321 | {"iwconfig key", "Set the encryption key"}, 322 | {"iwconfig power", "Set the power management mode"}, 323 | {"iwlist", "Get more detailed wireless information"}, 324 | {"iwlist scan", "List available wireless networks"}, 325 | {"iwlist frequency", "List the available frequencies in the device and the number of channels"}, 326 | {"iwlist bitrate", "List the bit-rates supported by the device"}, 327 | {"iwlist encryption", "List the encryption key sizes supported and display all the encryption keys available in the device"}, 328 | {"iwlist power", "List the various Power Management attributes and modes of the device"}, 329 | {"iwlist txpower", "List the various Transmit Powers available on the device"}, 330 | {"iwlist retry", "List the transmit retry limits and retry lifetime"}, 331 | {"traceroute", "Print the route packets take to the network host"}, 332 | {"mtr", "Network diagnostic tool"}, 333 | {"dig", "DNS lookup"}, 334 | {"nslookup", "Query Internet name servers interactively"}, 335 | {"host", "DNS lookup utility"}, 336 | {"rsync", "Remote file and directory synchronization"}, 337 | {"ftp", "File Transfer Protocol client"}, 338 | {"ftp open", "Connect to a remote FTP server"}, 339 | {"ftp close", "Terminate an FTP session"}, 340 | {"ftp put", "Send one file"}, 341 | {"ftp mput", "Send multiple files"}, 342 | {"ftp get", "Receive one file"}, 343 | {"ftp mget", "Receive multiple files"}, 344 | {"ftp delete", "Delete a file on the remote machine"}, 345 | {"ftp mdelete", "Delete multiple files on the remote machine"}, 346 | {"ftp rename", "Rename a file on the remote machine"}, 347 | {"ftp mkdir", "Make a directory on the remote machine"}, 348 | {"ftp rmdir", "Remove a directory on the remote machine"}, 349 | {"ftp ls", "List the contents of a directory on the remote machine"}, 350 | {"ftp lcd", "Change the local working directory"}, 351 | {"ftp cd", "Change the remote working directory"}, 352 | {"ftp ascii", "Set the file transfer type to ASCII"}, 353 | {"ftp binary", "Set the file transfer type to binary"}, 354 | {"ftp passive", "Enter passive transfer mode"}, 355 | {"ftp active", "Enter active transfer mode"}, 356 | {"sftp", "Secure File Transfer Protocol"}, 357 | {"sftp get", "Download files from the server"}, 358 | {"sftp put", "Upload files to the server"}, 359 | {"sftp ls", "List files on the server"}, 360 | {"sftp cd", "Change directory on the server"}, 361 | {"sftp lcd", "Change local directory"}, 362 | {"sftp mkdir", "Create a directory on the server"}, 363 | {"sftp rmdir", "Remove a directory on the server"}, 364 | {"sftp rm", "Delete a file on the server"}, 365 | {"sftp rename", "Rename a file on the server"}, 366 | {"sftp chmod", "Change file permissions on the server"}, 367 | {"sftp chown", "Change file owner on the server"}, 368 | {"sftp chgrp", "Change file group on the server"}, 369 | {"sftp lls", "List local files"}, 370 | {"sftp lmkdir", "Create a local directory"}, 371 | {"sftp lrm", "Delete a local file"}, 372 | {"sftp lrename", "Rename a local file"}, 373 | {"sftp lchmod", "Change local file permissions"}, 374 | {"sftp lchown", "Change local file owner"}, 375 | {"sftp lchgrp", "Change local file group"}, 376 | {"telnet", "User interface to the TELNET protocol"}, 377 | {"telnet open", "Connect to a remote host"}, 378 | {"telnet close", "Close the current connection"}, 379 | {"telnet quit", "Exit telnet"}, 380 | {"telnet send", "Send special characters to the remote host"}, 381 | {"telnet status", "Print status information"}, 382 | {"telnet set", "Set telnet options"}, 383 | {"telnet unset", "Unset telnet options"}, 384 | {"telnet toggle", "Toggle telnet options"}, 385 | {"telnet mode", "Set the transmission mode"}, 386 | {"telnet display", "Display operating parameters"}, 387 | {"telnet environ", "Change environment variables"}, 388 | {"nc", "Netcat, a versatile networking tool"}, 389 | {"nmap", "Network exploration tool and security/port scanner"}, 390 | {"tcpdump", "Command-line packet analyzer"}, 391 | {"wireshark", "Network protocol analyzer"}, 392 | {"iptables", "Administration tool for IPv4 packet filtering and NAT"}, 393 | {"firewalld", "A firewall management tool"}, 394 | {"ufw", "Uncomplicated Firewall, a frontend for iptables"}, 395 | {"ufw enable", "Enable the firewall"}, 396 | {"ufw disable", "Disable the firewall"}, 397 | {"ufw status", "Show the firewall status"}, 398 | {"ufw allow", "Allow a service or port through the firewall"}, 399 | {"ufw deny", "Deny a service or port through the firewall"}, 400 | {"ufw reject", "Reject a service or port through the firewall"}, 401 | {"ufw limit", "Limit the rate of connections"}, 402 | {"ufw delete", "Delete a rule"}, 403 | {"ufw reset", "Reset the firewall to default settings"}, 404 | {"ufw reload", "Reload the firewall"}, 405 | {"ufw logging", "Set the logging level"}, 406 | {"fail2ban", "Ban IPs that show malicious signs"}, 407 | {"logrotate", "Rotates, compresses, and mails system logs"}, 408 | {"cron", "Daemon to execute scheduled commands"}, 409 | {"cron start", "Start the cron daemon"}, 410 | {"cron stop", "Stop the cron daemon"}, 411 | {"cron restart", "Restart the cron daemon"}, 412 | {"cron reload", "Reload the cron daemon configuration"}, 413 | {"cron status", "Show the status of the cron daemon"}, 414 | {"cron list", "List all scheduled cron jobs"}, 415 | {"cron add", "Add a new cron job"}, 416 | {"cron remove", "Remove an existing cron job"}, 417 | {"cron edit", "Edit an existing cron job"}, 418 | {"anacron", "Run commands periodically"}, 419 | {"systemd-analyze", "Analyze system boot-up performance"}, 420 | {"systemd-analyze blame", "Show time taken to initialize each service"}, 421 | {"systemd-analyze critical-chain", "Show the critical chain of services"}, 422 | {"systemd-analyze plot", "Generate an SVG plot of boot sequence"}, 423 | {"systemd-analyze dump", "Show complete state of the systemd manager"}, 424 | {"systemd-analyze verify", "Check unit files for correctness"}, 425 | {"systemd-analyze security", "Analyze security of unit files"}, 426 | {"systemd-analyze time", "Show time taken to boot the system"}, 427 | {"pkill", "Send signal to processes based on name and other attributes"}, 428 | {"pgrep", "Look up or signal processes based on name and other attributes"}, 429 | {"nice", "Run a program with modified scheduling priority"}, 430 | {"renice", "Alter priority of running processes"}, 431 | {"ionice", "Set or get I/O scheduling class and priority"}, 432 | {"watch", "Execute a program periodically, showing output fullscreen"}, 433 | {"screen", "Terminal multiplexer"}, 434 | {"tmux", "Terminal multiplexer"}, 435 | {"nohup", "Run a command immune to hangups, with output to a non-tty"}, 436 | {"disown", "Remove jobs from current shell"}, 437 | {"ethtool", "Display or change Ethernet device settings"}, 438 | {"arp", "Manipulate the system ARP cache"}, 439 | {"whois", "Client for the whois directory service"}, 440 | {"ipcalc", "Calculate IP information for a given IP address"}, 441 | {"netcat", "Utility for reading from and writing to network connections using TCP or UDP"}, 442 | {"arping", "Send ARP REQUEST to a neighbor host"}, 443 | {"iw", "Show/manipulate wireless devices and their configuration"}, 444 | {"bridge", "Show/manipulate bridge addresses and devices"}, 445 | {"tc", "Show/manipulate traffic control settings"}, 446 | {"ipset", "Administration tool for IP sets"}, 447 | {"ip rule", "Routing policy database management"}, 448 | {"ip addr", "Show/manipulate IP addresses"}, 449 | {"ip link", "Show/manipulate network devices"}, 450 | {"ip route", "Show/manipulate routing tables"}, 451 | {"ip neigh", "Show/manipulate neighbor objects"}, 452 | {"ip maddr", "Show/manipulate multicast addresses"}, 453 | {"ip monitor", "Watch for netlink messages"}, 454 | {"ip tunnel", "Show/manipulate tunnel devices"}, 455 | {"ip xfrm", "Show/manipulate IPSec policies"}, 456 | {"ip netns", "Show/manipulate network namespaces"}, 457 | {"ip vrf", "Show/manipulate VRF devices"}, 458 | {"ip link set", "Change device attributes"}, 459 | {"ip link add", "Add a new device"}, 460 | {"ip link delete", "Delete a device"}, 461 | {"ip link show", "Display device attributes"}, 462 | {"ip link set dev", "Change device attributes"}, 463 | {"ip link set up", "Enable a device"}, 464 | {"ip link set down", "Disable a device"}, 465 | {"ip link set mtu", "Change device MTU"}, 466 | {"ip link set address", "Change device MAC address"}, 467 | {"ip link set master", "Set master device"}, 468 | {"ip link set nomaster", "Unset master device"}, 469 | {"ip link set type", "Change device type"}, 470 | {"ip link set netns", "Move device to network namespace"}, 471 | {"ip link set alias", "Set device alias"}, 472 | {"ip link set group", "Set device group"}, 473 | {"ip link set txqueuelen", "Change device transmit queue length"}, 474 | {"ip link set vf", "Change virtual function attributes"}, 475 | {"ip link set xdp", "Attach/detach XDP program"}, 476 | {"git init", "Create an empty Git repository or reinitialize an existing one"}, 477 | {"git clone", "Clone a repository into a new directory"}, 478 | {"git add", "Add file contents to the index"}, 479 | {"git commit", "Record changes to the repository"}, 480 | {"git status", "Show the working tree status"}, 481 | {"git push", "Update remote refs along with associated objects"}, 482 | {"git pull", "Fetch from and integrate with another repository or a local branch"}, 483 | {"git fetch", "Download objects and refs from another repository"}, 484 | {"git merge", "Join two or more development histories together"}, 485 | {"git branch", "List, create, or delete branches"}, 486 | {"git checkout", "Switch branches or restore working tree files"}, 487 | {"git log", "Show commit logs"}, 488 | {"git diff", "Show changes between commits, commit and working tree, etc"}, 489 | {"git reset", "Reset current HEAD to the specified state"}, 490 | {"git rm", "Remove files from the working tree and from the index"}, 491 | {"git mv", "Move or rename a file, a directory, or a symlink"}, 492 | {"git tag", "Create, list, delete or verify a tag object signed with GPG"}, 493 | {"git stash", "Stash the changes in a dirty working directory away"}, 494 | {"git rebase", "Reapply commits on top of another base tip"}, 495 | {"git remote", "Manage set of tracked repositories"}, 496 | {"git show", "Show various types of objects"}, 497 | {"git archive", "Create an archive of files from a named tree"}, 498 | {"git bisect", "Use binary search to find the commit that introduced a bug"}, 499 | {"git blame", "Show what revision and author last modified each line of a file"}, 500 | {"git cherry-pick", "Apply the changes introduced by some existing commits"}, 501 | {"git grep", "Print lines matching a pattern"}, 502 | {"git reflog", "Manage reflog information"}, 503 | {"git submodule", "Initialize, update or inspect submodules"}, 504 | {"git gc", "Cleanup unnecessary files and optimize the local repository"}, 505 | {"git fsck", "Verifies the connectivity and validity of the objects in the database"}, 506 | {"git clean", "Remove untracked files from the working tree"}, 507 | {"git config", "Get and set repository or global options"}, 508 | {"git describe", "Give an object a human-readable name based on an available ref"}, 509 | {"git shortlog", "Summarize git log output"}, 510 | {"git rev-parse", "Pick out and massage parameters"}, 511 | {"git ls-tree", "List the contents of a tree object"}, 512 | {"git update-index", "Register file contents in the working directory to the index"}, 513 | {"git symbolic-ref", "Read, modify and delete symbolic refs"}, 514 | {"git worktree", "Manage multiple working trees"}, 515 | {"git notes", "Add or inspect object notes"}, 516 | {"git rerere", "Reuse recorded resolution of conflicted merges"}, 517 | {"git range-diff", "Compare two commit ranges"}, 518 | {"git replace", "Create, list, delete refs to replace objects"}, 519 | {"git verify-commit", "Check the GPG signature of commits"}, 520 | {"git verify-tag", "Check the GPG signature of tags"}, 521 | {"git whatchanged", "Show logs with difference each commit introduces"}, 522 | {"git instaweb", "Instantly browse your working repository in gitweb"}, 523 | {"git daemon", "A really simple server for Git repositories"}, 524 | {"git bundle", "Move objects and refs by archive"}, 525 | {"git filter-branch", "Rewrite branches"}, 526 | {"git mergetool", "Run merge conflict resolution tools to resolve merge conflicts"}, 527 | {"git citool", "Graphical alternative to git-commit"}, 528 | {"git gui", "A portable graphical interface to Git"}, 529 | {"gitk", "The Git repository browser"}, 530 | {"git instaweb", "Instantly browse your working repository in gitweb"}, 531 | {"git archive", "Create an archive of files from a named tree"}, 532 | {"git apply", "Apply a patch to files and/or to the index"}, 533 | {"git am", "Apply a series of patches from a mailbox"}, 534 | {"git cherry", "Find commits yet to be applied to upstream"}, 535 | {"git format-patch", "Prepare patches for e-mail submission"}, 536 | {"git send-email", "Send a collection of patches as emails"}, 537 | {"git request-pull", "Generate a summary of pending changes"}, 538 | {"git submodule", "Initialize, update or inspect submodules"}, 539 | {"git svn", "Bidirectional operation between a Subversion repository and Git"}, 540 | {"git fast-import", "Backend for fast Git data importers"}, 541 | {"git fast-export", "Git data exporter"}, 542 | {"git daemon", "A really simple server for Git repositories"}, 543 | {"git instaweb", "Instantly browse your working repository in gitweb"}, 544 | {"git instaweb", "Instantly browse your working repository in gitweb"}, 545 | {"lazygit", "A simple terminal UI for git commands"}, 546 | {"fzf", "A command-line fuzzy finder"}, 547 | {"rg", "ripgrep, a line-oriented search tool that recursively searches your current directory for a regex pattern"}, 548 | {"rg pattern [path]", "ripgrep, a line-oriented search tool that recursively searches your current directory for a regex pattern"}, 549 | {"rg --files", "ripgrep, a line-oriented search tool that recursively searches your current directory for a regex pattern"}, 550 | {"rg --type-list", "ripgrep, a line-oriented search tool that recursively searches your current directory for a regex pattern"}, 551 | {"postman", "A collaboration platform for API development"}, 552 | {"http", "HTTPie, a command line HTTP client"}, 553 | {"jq", "A lightweight and flexible command-line JSON processor"}, 554 | {"scp", "Secure copy (remote file copy program)"}, 555 | {"svn", "Subversion version control system"}, 556 | {"svn checkout", "Subversion version control system"}, 557 | {"svn commit", "Subversion version control system"}, 558 | {"svn update", "Subversion version control system"}, 559 | {"svn add", "Subversion version control system"}, 560 | {"svn delete", "Subversion version control system"}, 561 | {"svn status", "Subversion version control system"}, 562 | {"svn log", "Subversion version control system"}, 563 | {"svn diff", "Subversion version control system"}, 564 | {"svn merge", "Subversion version control system"}, 565 | {"svn revert", "Subversion version control system"}, 566 | {"hg", "Mercurial version control system"}, 567 | {"hg init", "Mercurial version control system"}, 568 | {"hg clone", "Mercurial version control system"}, 569 | {"hg add", "Mercurial version control system"}, 570 | {"hg commit", "Mercurial version control system"}, 571 | {"hg update", "Mercurial version control system"}, 572 | {"hg merge", "Mercurial version control system"}, 573 | {"hg push", "Mercurial version control system"}, 574 | {"hg pull", "Mercurial version control system"}, 575 | {"hg log", "Mercurial version control system"}, 576 | {"hg status", "Mercurial version control system"}, 577 | {"hg diff", "Mercurial version control system"}, 578 | {"hg revert", "Mercurial version control system"}, 579 | {"bzr", "Bazaar version control system"}, 580 | {"bzr init", "Bazaar version control system"}, 581 | {"bzr branch", "Bazaar version control system"}, 582 | {"bzr add", "Bazaar version control system"}, 583 | {"bzr commit", "Bazaar version control system"}, 584 | {"bzr update", "Bazaar version control system"}, 585 | {"bzr merge", "Bazaar version control system"}, 586 | {"bzr push", "Bazaar version control system"}, 587 | {"bzr pull", "Bazaar version control system"}, 588 | {"bzr log", "Bazaar version control system"}, 589 | {"bzr status", "Bazaar version control system"}, 590 | {"bzr diff", "Bazaar version control system"}, 591 | {"bzr revert", "Bazaar version control system"}, 592 | {"podman", "Tool for managing OCI containers and pods"}, 593 | {"podman run", "Tool for managing OCI containers and pods"}, 594 | {"podman build", "Tool for managing OCI containers and pods"}, 595 | {"podman pull", "Tool for managing OCI containers and pods"}, 596 | {"podman push", "Tool for managing OCI containers and pods"}, 597 | {"podman images", "Tool for managing OCI containers and pods"}, 598 | {"podman ps", "Tool for managing OCI containers and pods"}, 599 | {"podman stop", "Tool for managing OCI containers and pods"}, 600 | {"podman start", "Tool for managing OCI containers and pods"}, 601 | {"podman rm", "Tool for managing OCI containers and pods"}, 602 | {"podman rmi", "Tool for managing OCI containers and pods"}, 603 | {"rkt", "App Container runtime"}, 604 | {"rkt run", "App Container runtime"}, 605 | {"rkt fetch", "App Container runtime"}, 606 | {"rkt list", "App Container runtime"}, 607 | {"rkt rm", "App Container runtime"}, 608 | {"rkt gc", "App Container runtime"}, 609 | {"rkt stop", "App Container runtime"}, 610 | {"kubernetes", "Container orchestration"}, 611 | {"minikube", "Run Kubernetes locally"}, 612 | {"minikube start", "Run Kubernetes locally"}, 613 | {"minikube stop", "Run Kubernetes locally"}, 614 | {"minikube delete", "Run Kubernetes locally"}, 615 | {"minikube status", "Run Kubernetes locally"}, 616 | {"minikube dashboard", "Run Kubernetes locally"}, 617 | {"minikube addons", "Run Kubernetes locally"}, 618 | {"minikube service", "Run Kubernetes locally"}, 619 | {"helm", "The Kubernetes Package Manager"}, 620 | {"helm repo", "The Kubernetes Package Manager"}, 621 | {"helm search", "The Kubernetes Package Manager"}, 622 | {"helm install", "The Kubernetes Package Manager"}, 623 | {"helm upgrade", "The Kubernetes Package Manager"}, 624 | {"helm uninstall", "The Kubernetes Package Manager"}, 625 | {"helm list", "The Kubernetes Package Manager"}, 626 | {"helm status", "The Kubernetes Package Manager"}, 627 | {"helm rollback", "The Kubernetes Package Manager"}, 628 | {"kubeadm", "Bootstrap a Kubernetes cluster"}, 629 | {"kubeadm init", "Bootstrap a Kubernetes cluster"}, 630 | {"kubeadm join", "Bootstrap a Kubernetes cluster"}, 631 | {"kubeadm reset", "Bootstrap a Kubernetes cluster"}, 632 | {"kubeadm upgrade", "Bootstrap a Kubernetes cluster"}, 633 | {"kubeadm token", "Bootstrap a Kubernetes cluster"}, 634 | {"kubeadm config", "Bootstrap a Kubernetes cluster"}, 635 | {"kops", "Kubernetes Operations"}, 636 | {"kops create", "Kubernetes Operations"}, 637 | {"kops update", "Kubernetes Operations"}, 638 | {"kops delete", "Kubernetes Operations"}, 639 | {"kops get", "Kubernetes Operations"}, 640 | {"kops validate", "Kubernetes Operations"}, 641 | {"kops rolling-update", "Kubernetes Operations"}, 642 | {"kubectx", "Switch between clusters on kubectl"}, 643 | {"kubens", "Switch between Kubernetes namespaces"}, 644 | {"kubectl", "Kubernetes command-line tool"}, 645 | {"kubectl get", "Kubernetes command-line tool"}, 646 | {"kubectl describe", "Kubernetes command-line tool"}, 647 | {"kubectl create", "Kubernetes command-line tool"}, 648 | {"kubectl delete", "Kubernetes command-line tool"}, 649 | {"kubectl apply", "Kubernetes command-line tool"}, 650 | {"kubectl logs", "Kubernetes command-line tool"}, 651 | {"kubectl exec", "Kubernetes command-line tool"}, 652 | {"kubectl scale", "Kubernetes command-line tool"}, 653 | {"kubectl expose", "Kubernetes command-line tool"}, 654 | {"vagrant", "Build and maintain portable virtual software development environments"}, 655 | {"vagrant init", "Build and maintain portable virtual software development environments"}, 656 | {"vagrant up", "Build and maintain portable virtual software development environments"}, 657 | {"vagrant halt", "Build and maintain portable virtual software development environments"}, 658 | {"vagrant destroy", "Build and maintain portable virtual software development environments"}, 659 | {"vagrant ssh", "Build and maintain portable virtual software development environments"}, 660 | {"vagrant status", "Build and maintain portable virtual software development environments"}, 661 | {"vagrant provision", "Build and maintain portable virtual software development environments"}, 662 | {"vagrant reload", "Build and maintain portable virtual software development environments"}, 663 | {"packer", "Create identical machine images for multiple platforms from a single source configuration"}, 664 | {"packer build", "Create identical machine images for multiple platforms from a single source configuration"}, 665 | {"packer validate", "Create identical machine images for multiple platforms from a single source configuration"}, 666 | {"packer inspect", "Create identical machine images for multiple platforms from a single source configuration"}, 667 | {"packer fix", "Create identical machine images for multiple platforms from a single source configuration"}, 668 | {"packer version", "Create identical machine images for multiple platforms from a single source configuration"}, 669 | {"packer fmt", "Create identical machine images for multiple platforms from a single source configuration"}, 670 | {"packer build", "Create identical machine images for multiple platforms from a single source configuration"}, 671 | {"packer validate", "Create identical machine images for multiple platforms from a single source configuration"}, 672 | {"packer inspect", "Create identical machine images for multiple platforms from a single source configuration"}, 673 | {"packer fix", "Create identical machine images for multiple platforms from a single source configuration"}, 674 | {"packer version", "Create identical machine images for multiple platforms from a single source configuration"}, 675 | {"packer fmt", "Create identical machine images for multiple platforms from a single source configuration"}, 676 | {"terraform", "Infrastructure as Code"}, 677 | {"terraform init", "Infrastructure as Code"}, 678 | {"terraform plan", "Infrastructure as Code"}, 679 | {"terraform apply", "Infrastructure as Code"}, 680 | {"terraform destroy", "Infrastructure as Code"}, 681 | {"terraform validate", "Infrastructure as Code"}, 682 | {"terraform fmt", "Infrastructure as Code"}, 683 | {"terraform show", "Infrastructure as Code"}, 684 | {"terraform state", "Infrastructure as Code"}, 685 | {"terraform output", "Infrastructure as Code"}, 686 | {"ansible", "Automate IT infrastructure"}, 687 | {"ansible-playbook", "Automate IT infrastructure"}, 688 | {"ansible-galaxy", "Automate IT infrastructure"}, 689 | {"ansible-vault", "Automate IT infrastructure"}, 690 | {"ansible-doc", "Automate IT infrastructure"}, 691 | {"ansible-config", "Automate IT infrastructure"}, 692 | {"ansible-inventory", "Automate IT infrastructure"}, 693 | {"chef", "Automate how infrastructure is configured, deployed, and managed"}, 694 | {"chef-client", "Run the Chef Infra Client"}, 695 | {"chef-solo", "Run the Chef Infra Client in solo mode"}, 696 | {"knife", "Command-line tool for interacting with the Chef Infra Server"}, 697 | {"chef-server-ctl", "Manage the Chef Infra Server"}, 698 | {"chef-apply", "Apply a single recipe to a system"}, 699 | {"chef-shell", "Interactive Chef Infra Client shell"}, 700 | {"chef-zero", "In-memory Chef Infra Server for testing"}, 701 | {"puppet", "Automate the delivery and operation of the software that powers your business"}, 702 | {"puppet apply", "Apply Puppet manifests to the local system"}, 703 | {"puppet agent", "Manage a Puppet agent"}, 704 | {"puppet cert", "Manage Puppet certificates"}, 705 | {"puppet config", "Manage Puppet configuration settings"}, 706 | {"puppet describe", "Describe Puppet resource types"}, 707 | {"puppet device", "Manage Puppet devices"}, 708 | {"puppet doc", "Display Puppet documentation"}, 709 | {"puppet facts", "Retrieve and display facts about the system"}, 710 | {"puppet filebucket", "Manage Puppet file buckets"}, 711 | {"puppet help", "Display help for Puppet commands"}, 712 | {"puppet lookup", "Lookup data in Hiera"}, 713 | {"puppet module", "Manage Puppet modules"}, 714 | {"puppet parser", "Validate and parse Puppet manifests"}, 715 | {"puppet resource", "Manage resources on the system"}, 716 | {"puppet server", "Manage the Puppet server"}, 717 | {"puppet status", "Display the status of Puppet services"}, 718 | {"puppet task", "Run tasks on remote systems"}, 719 | {"puppet test", "Run tests on Puppet code"}, 720 | {"puppet type", "Manage Puppet resource types"}, 721 | {"Get-Command", "For Windows: Get basic information about cmdlets and other elements of PowerShell"}, 722 | {"wt", "For Windows: Windows Terminal command-line tool"}, 723 | {"wt new-tab", "For Windows: Open a new tab in Windows Terminal"}, 724 | {"wt split-pane", "For Windows: Split the current pane in Windows Terminal"}, 725 | {"wt focus-tab", "For Windows: Focus on a specific tab in Windows Terminal"}, 726 | {"wt move-focus", "For Windows: Move focus between panes in Windows Terminal"}, 727 | {"wt resize-pane", "For Windows: Resize the current pane in Windows Terminal"}, 728 | {"wt close-tab", "For Windows: Close a specific tab in Windows Terminal"}, 729 | {"wt close-pane", "For Windows: Close the current pane in Windows Terminal"}, 730 | {"wt list-profiles", "For Windows: List all profiles in Windows Terminal"}, 731 | {"wt settings", "For Windows: Open the settings file in Windows Terminal"}, 732 | {"Get-Help", "For Windows: Display help about PowerShell cmdlets and concepts"}, 733 | {"Get-Process", "For Windows: Get a list of processes on a local or remote computer"}, 734 | {"Start-Process", "For Windows: Start one or more processes on the local computer"}, 735 | {"Stop-Process", "For Windows: Stop one or more running processes"}, 736 | {"Get-Service", "For Windows: Get the status of services on a local or remote computer"}, 737 | {"Start-Service", "For Windows: Start one or more stopped services"}, 738 | {"Stop-Service", "For Windows: Stop one or more running services"}, 739 | {"Restart-Service", "For Windows: Stop and then start one or more services"}, 740 | {"Set-Service", "For Windows: Change the properties of a service on a local or remote computer"}, 741 | {"Get-EventLog", "For Windows: Get the events in the event log on the local or remote computers"}, 742 | {"Clear-EventLog", "For Windows: Delete all entries from specified event logs on the local or remote computers"}, 743 | {"Get-EventSubscriber", "For Windows: Get the event subscribers in the current session"}, 744 | {"Unregister-Event", "For Windows: Cancel an event subscription"}, 745 | {"Get-Job", "For Windows: Get the Windows PowerShell background jobs that are running in the current session"}, 746 | {"Start-Job", "For Windows: Start a Windows PowerShell background job"}, 747 | {"Stop-Job", "For Windows: Stop a Windows PowerShell background job"}, 748 | {"Remove-Job", "For Windows: Delete a Windows PowerShell background job"}, 749 | {"Get-Variable", "For Windows: Get the PowerShell variables in the current console"}, 750 | {"Set-Variable", "For Windows: Set the value of a PowerShell variable"}, 751 | {"Remove-Variable", "For Windows: Remove a variable and its value"}, 752 | {"Get-Alias", "For Windows: Get the aliases for the current session"}, 753 | {"Set-Alias", "For Windows: Create or change an alias"}, 754 | {"Remove-Alias", "For Windows: Delete an alias from the current session"}, 755 | {"Get-Content", "For Windows: Get the content of the item at the specified location"}, 756 | {"Set-Content", "For Windows: Write or replace the content in an item with new content"}, 757 | {"Add-Content", "For Windows: Append content to the specified items"}, 758 | {"Clear-Content", "For Windows: Remove the content from a file"}, 759 | {"Get-Item", "For Windows: Get the item at the specified location"}, 760 | {"Set-Item", "For Windows: Set the value of an item at the specified location"}, 761 | {"New-Item", "For Windows: Create a new item"}, 762 | {"Remove-Item", "For Windows: Delete an item"}, 763 | {"Copy-Item", "For Windows: Copy an item from one location to another"}, 764 | {"Move-Item", "For Windows: Move an item from one location to another"}, 765 | {"Rename-Item", "For Windows: Rename an item"}, 766 | {"Get-ChildItem", "For Windows: Get the items and child items in one or more specified locations"}, 767 | {"Get-Location", "For Windows: Get the current directory"}, 768 | {"Set-Location", "For Windows: Set the current working location to a specified location"}, 769 | {"Push-Location", "For Windows: Push the current location onto the stack"}, 770 | {"Pop-Location", "For Windows: Pop a location from the stack"}, 771 | {"Get-History", "For Windows: Get a list of the commands entered during the current session"}, 772 | {"Invoke-History", "For Windows: Run commands from the session history"}, 773 | {"Clear-History", "For Windows: Delete entries from the command history"}, 774 | {"Get-PSDrive", "For Windows: Get the drives in the current session"}, 775 | {"New-PSDrive", "For Windows: Create a new drive"}, 776 | {"Remove-PSDrive", "For Windows: Remove a drive from the current session"}, 777 | {"Get-PSProvider", "For Windows: Get the PowerShell providers in the current session"}, 778 | {"Get-PSBreakpoint", "For Windows: Get the breakpoints set in the current session"}, 779 | {"Set-PSBreakpoint", "For Windows: Set a breakpoint on a line, command, or variable"}, 780 | {"Remove-PSBreakpoint", "For Windows: Delete breakpoints from the current session"}, 781 | {"Enable-PSBreakpoint", "For Windows: Enable the breakpoints in the current session"}, 782 | {"Disable-PSBreakpoint", "For Windows: Disable the breakpoints in the current session"}, 783 | {"Get-PSCallStack", "For Windows: Get the current call stack"}, 784 | {"Get-PSHostProcessInfo", "For Windows: Get information about processes that are hosting PowerShell"}, 785 | {"Enter-PSHostProcess", "For Windows: Connect to and interact with a local process that is hosting PowerShell"}, 786 | {"Exit-PSHostProcess", "For Windows: Exit an interactive session with a local process that is hosting PowerShell"}, 787 | {"Get-Runspace", "For Windows: Get the runspaces in the current session"}, 788 | {"Debug-Runspace", "For Windows: Debug a runspace in the current session"}, 789 | {"Get-Module", "For Windows: Get the modules that have been imported or that can be imported into the current session"}, 790 | {"Import-Module", "For Windows: Add one or more modules to the current session"}, 791 | {"Remove-Module", "For Windows: Remove modules from the current session"}, 792 | {"New-Module", "For Windows: Create a new dynamic module"}, 793 | {"Get-Command", "For Windows: Get basic information about cmdlets and other elements of PowerShell"}, 794 | {"Get-Help", "For Windows: Display help about PowerShell cmdlets and concepts"}, 795 | {"Get-Process", "For Windows: Get a list of processes on a local or remote computer"}, 796 | {"Start-Process", "For Windows: Start one or more processes on the local computer"}, 797 | {"Stop-Process", "For Windows: Stop one or more running processes"}, 798 | {"Get-Service", "For Windows: Get the status of services on a local or remote computer"}, 799 | {"Start-Service", "For Windows: Start one or more stopped services"}, 800 | {"Stop-Service", "For Windows: Stop one or more running services"}, 801 | {"Restart-Service", "For Windows: Stop and then start one or more services"}, 802 | {"Set-Service", "For Windows: Change the properties of a service on a local or remote computer"}, 803 | {"Get-EventLog", "For Windows: Get the events in the event log on the local or remote computers"}, 804 | {"Clear-EventLog", "For Windows: Delete all entries from specified event logs on the local or remote computers"}, 805 | {"Get-EventSubscriber", "For Windows: Get the event subscribers in the current session"}, 806 | {"Unregister-Event", "For Windows: Cancel an event subscription"}, 807 | {"Get-Job", "For Windows: Get the Windows PowerShell background jobs that are running in the current session"}, 808 | {"Start-Job", "For Windows: Start a Windows PowerShell background job"}, 809 | {"Stop-Job", "For Windows: Stop a Windows PowerShell background job"}, 810 | {"Remove-Job", "For Windows: Delete a Windows PowerShell background job"}, 811 | {"Get-Variable", "For Windows: Get the PowerShell variables in the current console"}, 812 | {"Set-Variable", "For Windows: Set the value of a PowerShell variable"}, 813 | {"Remove-Variable", "For Windows: Remove a variable and its value"}, 814 | {"Get-Alias", "For Windows: Get the aliases for the current session"}, 815 | {"Set-Alias", "For Windows: Create or change an alias"}, 816 | {"Remove-Alias", "For Windows: Delete an alias from the current session"}, 817 | {"Get-Content", "For Windows: Get the content of the item at the specified location"}, 818 | {"Set-Content", "For Windows: Write or replace the content in an item with new content"}, 819 | {"Add-Content", "For Windows: Append content to the specified items"}, 820 | {"Clear-Content", "For Windows: Remove the content from a file"}, 821 | {"Get-Item", "For Windows: Get the item at the specified location"}, 822 | {"Set-Item", "For Windows: Set the value of an item at the specified location"}, 823 | {"New-Item", "For Windows: Create a new item"}, 824 | {"Remove-Item", "For Windows: Delete an item"}, 825 | {"Copy-Item", "For Windows: Copy an item from one location to another"}, 826 | {"Move-Item", "For Windows: Move an item from one location to another"}, 827 | {"Rename-Item", "For Windows: Rename an item"}, 828 | {"Get-ChildItem", "For Windows: Get the items and child items in one or more specified locations"}, 829 | {"Get-Location", "For Windows: Get the current directory"}, 830 | {"Set-Location", "For Windows: Set the current working location to a specified location"}, 831 | {"Push-Location", "For Windows: Push the current location onto the stack"}, 832 | {"Pop-Location", "For Windows: Pop a location from the stack"}, 833 | {"Get-History", "For Windows: Get a list of the commands entered during the current session"}, 834 | {"Invoke-History", "For Windows: Run commands from the session history"}, 835 | {"Clear-History", "For Windows: Delete entries from the command history"}, 836 | {"Get-PSDrive", "For Windows: Get the drives in the current session"}, 837 | {"New-PSDrive", "For Windows: Create a new drive"}, 838 | {"Remove-PSDrive", "For Windows: Remove a drive from the current session"}, 839 | {"Get-PSProvider", "For Windows: Get the PowerShell providers in the current session"}, 840 | {"Get-PSBreakpoint", "For Windows: Get the breakpoints set in the current session"}, 841 | {"Set-PSBreakpoint", "For Windows: Set a breakpoint on a line, command, or variable"}, 842 | {"Remove-PSBreakpoint", "For Windows: Delete breakpoints from the current session"}, 843 | {"Enable-PSBreakpoint", "For Windows: Enable the breakpoints in the current session"}, 844 | {"Disable-PSBreakpoint", "For Windows: Disable the breakpoints in the current session"}, 845 | {"Get-PSCallStack", "For Windows: Get the current call stack"}, 846 | {"Get-PSHostProcessInfo", "For Windows: Get information about processes that are hosting PowerShell"}, 847 | {"Enter-PSHostProcess", "For Windows: Connect to and interact with a local process that is hosting PowerShell"}, 848 | {"Exit-PSHostProcess", "For Windows: Exit an interactive session with a local process that is hosting PowerShell"}, 849 | {"Get-Runspace", "For Windows: Get the runspaces in the current session"}, 850 | {"Debug-Runspace", "For Windows: Debug a runspace in the current session"}, 851 | {"Get-Module", "For Windows: Get the modules that have been imported or that can be imported into the current session"}, 852 | {"Import-Module", "For Windows: Add one or more modules to the current session"}, 853 | {"Remove-Module", "For Windows: Remove modules from the current session"}, 854 | {"New-Module", "For Windows: Create a new dynamic module"}, 855 | {"brew install", "For macOS: Install a package using Homebrew"}, 856 | {"brew uninstall", "For macOS: Uninstall a package using Homebrew"}, 857 | {"brew update", "For macOS: Update Homebrew and all installed formulae"}, 858 | {"brew upgrade", "For macOS: Upgrade all outdated packages"}, 859 | {"brew list", "For macOS: List all installed packages"}, 860 | {"brew search", "For macOS: Search for a package in Homebrew"}, 861 | {"brew info", "For macOS: Display information about a package"}, 862 | {"brew doctor", "For macOS: Check your Homebrew installation for potential problems"}, 863 | {"brew cleanup", "For macOS: Remove old versions of installed formulae"}, 864 | {"brew services start", "For macOS: Start a service using Homebrew"}, 865 | {"brew services stop", "For macOS: Stop a service using Homebrew"}, 866 | {"brew services restart", "For macOS: Restart a service using Homebrew"}, 867 | {"brew services list", "For macOS: List all services managed by Homebrew"}, 868 | {"defaults read", "For macOS: Read macOS user defaults"}, 869 | {"defaults write", "For macOS: Write macOS user defaults"}, 870 | {"defaults delete", "For macOS: Delete macOS user defaults"}, 871 | {"open", "For macOS: Open a file or URL with the default application"}, 872 | {"diskutil eraseDisk", "For macOS: Erase and format a disk"}, 873 | {"diskutil mount", "For macOS: Mount a disk"}, 874 | {"diskutil unmount", "For macOS: Unmount a disk"}, 875 | {"diskutil eject", "For macOS: Eject a disk"}, 876 | {"spctl", "For macOS: Manage Gatekeeper settings"}, 877 | {"csrutil status", "For macOS: Check the status of System Integrity Protection (SIP)"}, 878 | {"csrutil enable", "For macOS: Enable System Integrity Protection (SIP)"}, 879 | {"csrutil disable", "For macOS: Disable System Integrity Protection (SIP)"}, 880 | {"tmutil listbackups", "For macOS: List all Time Machine backups"}, 881 | {"tmutil startbackup", "For macOS: Start a Time Machine backup"}, 882 | {"tmutil stopbackup", "For macOS: Stop a Time Machine backup"}, 883 | {"tmutil deletelocalsnapshots", "For macOS: Delete local Time Machine snapshots"}, 884 | {"tmutil compare", "For macOS: Compare two Time Machine backups"}, 885 | {"tmutil restore", "For macOS: Restore files from a Time Machine backup"}, 886 | {"networksetup", "For macOS: Manage network settings"}, 887 | {"softwareupdate", "For macOS: Manage software updates"}, 888 | {"say", "For macOS: Convert text to speech"}, 889 | {"screencapture", "For macOS: Capture a screenshot"}, 890 | {"pmset", "For macOS: Manage power management settings"}, 891 | {"system_profiler", "For macOS: Display detailed system information"}, 892 | {"sw_vers", "For macOS: Display macOS version information"}, 893 | {". (dot)", "For macOS: Execute commands from a file in the current shell"}, 894 | } -------------------------------------------------------------------------------- /go.mod: -------------------------------------------------------------------------------- 1 | module what-cmd 2 | 3 | // switch this to 1.18 to work with Ubuntu's outdated package (or update Go) 4 | go 1.23 5 | 6 | require ( 7 | github.com/gdamore/encoding v1.0.0 // indirect 8 | github.com/gdamore/tcell/v2 v2.7.4 // indirect 9 | github.com/lucasb-eyer/go-colorful v1.2.0 // indirect 10 | github.com/mattn/go-runewidth v0.0.15 // indirect 11 | github.com/rivo/uniseg v0.4.3 // indirect 12 | golang.org/x/sys v0.17.0 // indirect 13 | golang.org/x/term v0.17.0 // indirect 14 | golang.org/x/text v0.14.0 // indirect 15 | ) 16 | -------------------------------------------------------------------------------- /go.sum: -------------------------------------------------------------------------------- 1 | github.com/gdamore/encoding v1.0.0 h1:+7OoQ1Bc6eTm5niUzBa0Ctsh6JbMW6Ra+YNuAtDBdko= 2 | github.com/gdamore/encoding v1.0.0/go.mod h1:alR0ol34c49FCSBLjhosxzcPHQbf2trDkoo5dl+VrEg= 3 | github.com/gdamore/tcell/v2 v2.7.4 h1:sg6/UnTM9jGpZU+oFYAsDahfchWAFW8Xx2yFinNSAYU= 4 | github.com/gdamore/tcell/v2 v2.7.4/go.mod h1:dSXtXTSK0VsW1biw65DZLZ2NKr7j0qP/0J7ONmsraWg= 5 | github.com/lucasb-eyer/go-colorful v1.2.0 h1:1nnpGOrhyZZuNyfu1QjKiUICQ74+3FNCN69Aj6K7nkY= 6 | github.com/lucasb-eyer/go-colorful v1.2.0/go.mod h1:R4dSotOR9KMtayYi1e77YzuveK+i7ruzyGqttikkLy0= 7 | github.com/mattn/go-runewidth v0.0.15 h1:UNAjwbU9l54TA3KzvqLGxwWjHmMgBUVhBiTjelZgg3U= 8 | github.com/mattn/go-runewidth v0.0.15/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= 9 | github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= 10 | github.com/rivo/uniseg v0.4.3 h1:utMvzDsuh3suAEnhH0RdHmoPbU648o6CvXxTx4SBMOw= 11 | github.com/rivo/uniseg v0.4.3/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88= 12 | github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= 13 | golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= 14 | golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= 15 | golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= 16 | golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= 17 | golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= 18 | golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= 19 | golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= 20 | golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= 21 | golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= 22 | golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= 23 | golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= 24 | golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= 25 | golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 26 | golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= 27 | golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= 28 | golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= 29 | golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= 30 | golang.org/x/sys v0.17.0 h1:25cE3gD+tdBA7lp7QfhuV+rJiE9YXTcS3VG1SqssI/Y= 31 | golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= 32 | golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= 33 | golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= 34 | golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= 35 | golang.org/x/term v0.17.0 h1:mkTF7LCd6WGJNL3K1Ad7kwxNfYAW6a8a8QqtMblp/4U= 36 | golang.org/x/term v0.17.0/go.mod h1:lLRBjIVuehSbZlaOtGMbcMncT+aqLLLmKrsjNrUguwk= 37 | golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= 38 | golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= 39 | golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= 40 | golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= 41 | golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= 42 | golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= 43 | golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= 44 | golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= 45 | golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= 46 | golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= 47 | golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= 48 | -------------------------------------------------------------------------------- /hotkeys/hotkeys.go: -------------------------------------------------------------------------------- 1 | package hotkeys 2 | 3 | // Hotkey represents a hotkey and its description 4 | type Hotkey struct { 5 | Name string 6 | Description string 7 | } 8 | 9 | // List of hotkeys with descriptions 10 | var Words = []Hotkey{ 11 | // Default Linux Hotkeys 12 | {"Linux: Ctrl + Alt + T", "Open a terminal"}, 13 | {"Linux: Ctrl + Alt + L", "Lock the screen"}, 14 | {"Linux: Ctrl + Alt + D", "Show desktop"}, 15 | {"Linux: Alt + Tab", "Switch between open applications"}, 16 | {"Linux: Alt + F2", "Run command"}, 17 | {"Linux: Print Screen", "Take a screenshot"}, 18 | {"Linux: Ctrl + Shift + Esc", "Open system monitor"}, 19 | {"Linux: Ctrl + Alt + Arrow keys", "Switch workspace"}, 20 | {"Linux: Super + L", "Lock the screen"}, 21 | {"Linux: Super + D", "Show desktop"}, 22 | {"Linux: Ctrl + Alt + Backspace", "Restart X server"}, 23 | {"Linux: Ctrl + Alt + F1-F6", "Switch to virtual console"}, 24 | {"Linux: Ctrl + Alt + F7", "Switch back to graphical session"}, 25 | {"Linux: Alt + F4", "Close the current window"}, 26 | {"Linux: Super + Tab", "Switch between open windows in the current workspace"}, 27 | 28 | // Default terminal hotkeys 29 | {"Terminal: Ctrl + A", "Move the cursor to the beginning of the line"}, 30 | {"Terminal: Ctrl + E", "Move the cursor to the end of the line"}, 31 | {"Terminal: Ctrl + U", "Clear the line before the cursor"}, 32 | {"Terminal: Ctrl + K", "Clear the line after the cursor"}, 33 | {"Terminal: Ctrl + W", "Delete the word before the cursor"}, 34 | {"Terminal: Ctrl + Y", "Paste the last thing to be cut (yank)"}, 35 | {"Terminal: Alt + B", "Move the cursor backward one word"}, 36 | {"Terminal: Alt + F", "Move the cursor forward one word"}, 37 | {"Terminal: Ctrl + L", "Clear the screen (similar to the `clear` command)"}, 38 | {"Terminal: Ctrl + R", "Search the command history"}, 39 | {"Terminal: Ctrl + P", "Previous command in history"}, 40 | {"Terminal: Ctrl + N", "Next command in history"}, 41 | {"Terminal: !!", "Repeat the last command"}, 42 | {"Terminal: !n", "Execute the nth command in history"}, 43 | {"Terminal: !string", "Execute the most recent command that starts with `string`"}, 44 | {"Terminal: Ctrl + C", "Kill the current process"}, 45 | {"Terminal: Ctrl + Z", "Suspend the current process"}, 46 | {"Terminal: fg", "Resume the suspended process in the foreground"}, 47 | {"Terminal: bg", "Resume the suspended process in the background"}, 48 | {"Terminal: Ctrl + D", "Delete the character under the cursor or exit the terminal if the line is empty"}, 49 | {"Terminal: Ctrl + H", "Delete the character before the cursor (backspace)"}, 50 | {"Terminal: Ctrl + T", "Swap the last two characters before the cursor"}, 51 | {"Terminal: Alt + T", "Swap the last two words before the cursor"}, 52 | {"Terminal: Alt + U", "Capitalize the word after the cursor"}, 53 | {"Terminal: Alt + L", "Lowercase the word after the cursor"}, 54 | {"Terminal: Alt + C", "Capitalize the word after the cursor"}, 55 | {"Terminal: Tab", "Auto-complete files and directory names"}, 56 | {"Terminal: Ctrl + _", "Undo the last action"}, 57 | {"Terminal: Ctrl + X + E", "Open the current command in the default text editor"}, 58 | 59 | // Kitty Terminal Hotkeys 60 | {"Kitty: Ctrl + Shift + Enter", "Open a new window"}, 61 | {"Kitty: Ctrl + Shift + T", "Open a new tab"}, 62 | {"Kitty: Ctrl + Shift + W", "Close the current tab"}, 63 | {"Kitty: Ctrl + Shift + Left/Right", "Switch between tabs"}, 64 | {"Kitty: Ctrl + Shift + Up/Down", "Scroll up/down"}, 65 | {"Kitty: Ctrl + Shift + F", "Search in terminal"}, 66 | {"Kitty: Ctrl + Shift + C", "Copy selected text"}, 67 | {"Kitty: Ctrl + Shift + V", "Paste clipboard content"}, 68 | {"Kitty: Ctrl + Shift + R", "Reload configuration"}, 69 | {"Kitty: Ctrl + Shift + Q", "Quit Kitty"}, 70 | {"Kitty: Ctrl + Shift + N", "Move to the next layout"}, 71 | {"Kitty: Ctrl + Shift + P", "Move to the previous layout"}, 72 | {"Kitty: Ctrl + Shift + L", "Reflow text in the current window"}, 73 | {"Kitty: Ctrl + Shift + S", "Save the current window's scrollback buffer to a file"}, 74 | 75 | // Tmux Terminal Hotkeys 76 | {"Tmux: Ctrl + B, %", "Split window vertically"}, 77 | {"Tmux: Ctrl + B, \"", "Split window horizontally"}, 78 | {"Tmux: Ctrl + B, Arrow keys", "Navigate between panes"}, 79 | {"Tmux: Ctrl + B, C", "Create a new window"}, 80 | {"Tmux: Ctrl + B, N", "Next window"}, 81 | {"Tmux: Ctrl + B, P", "Previous window"}, 82 | {"Tmux: Ctrl + B, W", "List all windows"}, 83 | {"Tmux: Ctrl + B, D", "Detach session"}, 84 | {"Tmux: Ctrl + B, R", "Reload configuration"}, 85 | {"Tmux: Ctrl + B, X", "Kill the current pane"}, 86 | {"Tmux: Ctrl + B, Z", "Toggle pane zoom"}, 87 | {"Tmux: Ctrl + B, ,", "Rename the current window"}, 88 | {"Tmux: Ctrl + B, .", "Move the current window"}, 89 | {"Tmux: Ctrl + B, &", "Kill the current window"}, 90 | {"Tmux: Ctrl + B, [", "Enter copy mode"}, 91 | {"Tmux: Ctrl + B, ]", "Paste from buffer"}, 92 | 93 | // Vim Hotkeys 94 | {"Vim: i", "Enter insert mode"}, 95 | {"Vim: Esc", "Exit insert mode"}, 96 | {"Vim: :w", "Save the file"}, 97 | {"Vim: :q", "Quit Vim"}, 98 | {"Vim: :wq", "Save and quit Vim"}, 99 | {"Vim: :q!", "Quit without saving"}, 100 | {"Vim: dd", "Delete the current line"}, 101 | {"Vim: yy", "Yank (copy) the current line"}, 102 | {"Vim: p", "Paste the yanked or deleted text"}, 103 | {"Vim: u", "Undo the last action"}, 104 | {"Vim: Ctrl + r", "Redo the undone action"}, 105 | {"Vim: gg", "Go to the beginning of the file"}, 106 | {"Vim: G", "Go to the end of the file"}, 107 | {"Vim: /pattern", "Search for a pattern"}, 108 | {"Vim: n", "Repeat the last search in the same direction"}, 109 | {"Vim: N", "Repeat the last search in the opposite direction"}, 110 | {"Vim: :%s/old/new/g", "Replace all occurrences of 'old' with 'new' in the file"}, 111 | {"Vim: :e filename", "Open a file"}, 112 | {"Vim: :bnext or :bn", "Go to the next buffer"}, 113 | {"Vim: :bprev or :bp", "Go to the previous buffer"}, 114 | {"Vim: :bd", "Delete a buffer"}, 115 | {"Vim: :sp filename", "Open a file in a new split"}, 116 | {"Vim: :vsp filename", "Open a file in a new vertical split"}, 117 | {"Vim: Ctrl + ws", "Split the window horizontally"}, 118 | {"Vim: Ctrl + wv", "Split the window vertically"}, 119 | {"Vim: Ctrl + ww", "Switch between windows"}, 120 | {"Vim: Ctrl + wq", "Quit a window"}, 121 | {"Vim: Ctrl + wx", "Exchange current window with the next one"}, 122 | {"Vim: :resize +N", "Increase window height by N lines"}, 123 | {"Vim: :resize -N", "Decrease window height by N lines"}, 124 | {"Vim: :vertical resize +N", "Increase window width by N columns"}, 125 | {"Vim: :vertical resize -N", "Decrease window width by N columns"}, 126 | {"Vim: :tabnew filename", "Open a file in a new tab"}, 127 | {"Vim: gt", "Go to the next tab"}, 128 | {"Vim: gT", "Go to the previous tab"}, 129 | {"Vim: :tabclose or :tabc", "Close the current tab"}, 130 | {"Vim: :tabonly", "Close all other tabs"}, 131 | {"Vim: :tabmove N", "Move the current tab to the Nth position"}, 132 | {"Vim: :tabedit filename", "Edit a file in a new tab"}, 133 | {"Vim: :tabfind filename", "Open a file in a new tab if it exists"}, 134 | {"Vim: :tabnew", "Open a new tab"}, 135 | {"Vim: :tabnext or :tabn", "Go to the next tab"}, 136 | {"Vim: :tabprevious or :tabp", "Go to the previous tab"}, 137 | {"Vim: :tabfirst", "Go to the first tab"}, 138 | {"Vim: :tablast", "Go to the last tab"}, 139 | {"Vim: :tabdo command", "Run a command in all tabs"}, 140 | {"Vim: :tab split", "Split the current window and open it in a new tab"}, 141 | {"Vim: :tabclose N", "Close the Nth tab"}, 142 | {"Vim: :tabmove +N", "Move the current tab N positions to the right"}, 143 | {"Vim: :tabmove -N", "Move the current tab N positions to the left"}, 144 | {"Vim: :tabnew +N", "Open a new tab and move it to the Nth position"}, 145 | {"Vim: :tabedit +N", "Edit a file in a new tab and move it to the Nth position"}, 146 | {"Vim: :tabfind +N", "Open a file in a new tab if it exists and move it to the Nth position"}, 147 | {"Vim: :tabnew -N", "Open a new tab and move it to the Nth position from the end"}, 148 | {"Vim: :tabedit -N", "Edit a file in a new tab and move it to the Nth position from the end"}, 149 | {"Vim: :tabfind -N", "Open a file in a new tab if it exists and move it to the Nth position from the end"}, 150 | {"Vim: :tab split +N", "Split the current window and open it in a new tab at the Nth position"}, 151 | {"Vim: :tab split -N", "Split the current window and open it in a new tab at the Nth position from the end"}, 152 | {"Vim: :tabclose +N", "Close the Nth tab from the current tab"}, 153 | {"Vim: :tabclose -N", "Close the Nth tab from the last tab"}, 154 | {"Vim: :tabonly!", "Close all other tabs except the current one"}, 155 | {"Vim: :tabonly +N", "Close all other tabs except the Nth tab"}, 156 | {"Vim: :tabonly -N", "Close all other tabs except the Nth tab from the last tab"}, 157 | {"Vim: :tabmove +N", "Move the current tab to the Nth position"}, 158 | {"Vim: :tabmove -N", "Move the current tab to the Nth position from the last tab"}, 159 | 160 | // Nano Hotkeys 161 | {"Nano: Ctrl + O", "Write (save) the file"}, 162 | {"Nano: Ctrl + X", "Exit Nano"}, 163 | {"Nano: Ctrl + K", "Cut the current line"}, 164 | {"Nano: Ctrl + U", "Uncut (paste) the last cut text"}, 165 | {"Nano: Ctrl + J", "Justify the current paragraph"}, 166 | {"Nano: Ctrl + W", "Search for a string"}, 167 | {"Nano: Ctrl + C", "Show the current cursor position"}, 168 | {"Nano: Ctrl + G", "Display the help text"}, 169 | {"Nano: Ctrl + \\", "Replace a string"}, 170 | {"Nano: Ctrl + T", "Invoke the spell checker"}, 171 | {"Nano: Ctrl + _", "Go to a specific line number"}, 172 | {"Nano: Alt + A", "Set a mark (start highlighting text)"}, 173 | {"Nano: Alt + 6", "Copy the current line"}, 174 | 175 | // Visual Studio Code Hotkeys 176 | {"VSCode: Ctrl + P", "Quick open a file"}, 177 | {"VSCode: Ctrl + Shift + P", "Open the command palette"}, 178 | {"VSCode: Ctrl + ,", "Open settings"}, 179 | {"VSCode: Ctrl + B", "Toggle the sidebar"}, 180 | {"VSCode: Ctrl + `", "Toggle the integrated terminal"}, 181 | {"VSCode: Ctrl + K Ctrl + S", "Open keyboard shortcuts"}, 182 | {"VSCode: Ctrl + Shift + N", "New window"}, 183 | {"VSCode: Ctrl + W", "Close the current editor"}, 184 | {"VSCode: Ctrl + Shift + T", "Reopen the last closed editor"}, 185 | {"VSCode: Ctrl + Tab", "Switch between open editors"}, 186 | {"VSCode: Ctrl + /", "Toggle line comment"}, 187 | {"VSCode: Ctrl + Shift + A", "Toggle block comment"}, 188 | {"VSCode: Alt + Up/Down", "Move line up/down"}, 189 | {"VSCode: Shift + Alt + Up/Down", "Copy line up/down"}, 190 | {"VSCode: Ctrl + Shift + K", "Delete line"}, 191 | {"VSCode: Ctrl + Enter", "Insert line below"}, 192 | {"VSCode: Ctrl + Shift + Enter", "Insert line above"}, 193 | {"VSCode: Ctrl + D", "Add selection to next find match"}, 194 | {"VSCode: Ctrl + L", "Select current line"}, 195 | {"VSCode: Ctrl + Shift + L", "Select all occurrences of current selection"}, 196 | {"VSCode: F2", "Rename symbol"}, 197 | {"VSCode: Ctrl + Shift + O", "Go to symbol"}, 198 | {"VSCode: Ctrl + G", "Go to line"}, 199 | {"VSCode: F12", "Go to definition"}, 200 | {"VSCode: Alt + F12", "Peek definition"}, 201 | {"VSCode: Ctrl + K Ctrl + 0", "Fold all regions"}, 202 | {"VSCode: Ctrl + K Ctrl + J", "Unfold all regions"}, 203 | {"VSCode: Ctrl + Shift + M", "Show problems"}, 204 | {"VSCode: F8", "Go to next error or warning"}, 205 | {"VSCode: Shift + F8", "Go to previous error or warning"}, 206 | {"VSCode: Ctrl + Shift + B", "Run build task"}, 207 | {"VSCode: Ctrl + Shift + U", "Show output panel"}, 208 | {"VSCode: Ctrl + Shift + Y", "Show debug console"}, 209 | {"VSCode: F5", "Start debugging"}, 210 | {"VSCode: Shift + F5", "Stop debugging"}, 211 | {"VSCode: F9", "Toggle breakpoint"}, 212 | {"VSCode: F10", "Step over"}, 213 | {"VSCode: F11", "Step into"}, 214 | {"VSCode: Shift + F11", "Step out"}, 215 | 216 | // i3 Window Manager Hotkeys 217 | {"i3: Mod + Enter", "Open a terminal"}, 218 | {"i3: Mod + D", "Open dmenu"}, 219 | {"i3: Mod + J/K/L/; or Arrow keys", "Navigate between windows"}, 220 | {"i3: Mod + H/V", "Split horizontally/vertically"}, 221 | {"i3: Mod + F", "Toggle fullscreen"}, 222 | {"i3: Mod + Shift + Q", "Kill focused window"}, 223 | {"i3: Mod + Shift + R", "Reload i3 configuration"}, 224 | {"i3: Mod + Shift + E", "Exit i3"}, 225 | {"i3: Mod + 1-9", "Switch to workspace 1-9"}, 226 | {"i3: Mod + Shift + 1-9", "Move focused window to workspace 1-9"}, 227 | {"i3: Mod + S", "Toggle stacking layout"}, 228 | {"i3: Mod + W", "Toggle tabbed layout"}, 229 | {"i3: Mod + E", "Toggle split layout"}, 230 | {"i3: Mod + Shift + Space", "Toggle floating mode"}, 231 | {"i3: Mod + Space", "Focus the parent container"}, 232 | {"i3: Mod + Shift + C", "Reload i3 configuration"}, 233 | 234 | // Awesome Window Manager Hotkeys 235 | {"Awesome: Mod4 + Enter", "Open a terminal"}, 236 | {"Awesome: Mod4 + R", "Run prompt"}, 237 | {"Awesome: Mod4 + J/K", "Focus next/previous window"}, 238 | {"Awesome: Mod4 + H/L", "Resize window"}, 239 | {"Awesome: Mod4 + F", "Toggle fullscreen"}, 240 | {"Awesome: Mod4 + Shift + C", "Close focused window"}, 241 | {"Awesome: Mod4 + Control + R", "Reload Awesome"}, 242 | {"Awesome: Mod4 + Control + Q", "Quit Awesome"}, 243 | {"Awesome: Mod4 + 1-9", "Switch to tag 1-9"}, 244 | {"Awesome: Mod4 + Shift + 1-9", "Move focused window to tag 1-9"}, 245 | {"Awesome: Mod4 + W", "Show main menu"}, 246 | {"Awesome: Mod4 + M", "Maximize window"}, 247 | {"Awesome: Mod4 + N", "Minimize window"}, 248 | {"Awesome: Mod4 + P", "Show program launcher"}, 249 | {"Awesome: Mod4 + S", "Take a screenshot"}, 250 | {"Awesome: Mod4 + Tab", "Switch between clients"}, 251 | 252 | // Windows Terminal Hotkeys 253 | {"Windows Terminal: Ctrl + Shift + 1", "Open a new tab with the default profile"}, 254 | {"Windows Terminal: Ctrl + Shift + 2", "Open a new tab with the second profile"}, 255 | {"Windows Terminal: Ctrl + Shift + W", "Close the current tab"}, 256 | {"Windows Terminal: Ctrl + Shift + D", "Duplicate the current tab"}, 257 | {"Windows Terminal: Ctrl + Shift + T", "Open a new tab"}, 258 | {"Windows Terminal: Ctrl + Shift + P", "Open the command palette"}, 259 | {"Windows Terminal: Ctrl + Shift + F", "Find text in the terminal"}, 260 | {"Windows Terminal: Ctrl + Shift + Plus", "Increase font size"}, 261 | {"Windows Terminal: Ctrl + Shift + Minus", "Decrease font size"}, 262 | {"Windows Terminal: Alt + Shift + D", "Split the current pane horizontally"}, 263 | {"Windows Terminal: Alt + Shift + Plus", "Split the current pane vertically"}, 264 | {"Windows Terminal: Alt + Arrow Keys", "Move focus between panes"}, 265 | {"Windows Terminal: Ctrl + Shift + Space", "Open the context menu"}, 266 | {"Windows Terminal: Ctrl + Shift + C", "Copy selected text"}, 267 | {"Windows Terminal: Ctrl + Shift + V", "Paste from clipboard"}, 268 | 269 | // PowerShell Hotkeys 270 | {"PowerShell: Ctrl + C", "Interrupt the current command"}, 271 | {"PowerShell: Ctrl + D", "Exit the shell"}, 272 | {"PowerShell: Ctrl + L", "Clear the screen"}, 273 | {"PowerShell: Ctrl + R", "Search command history"}, 274 | {"PowerShell: Ctrl + A", "Select all text"}, 275 | {"PowerShell: Ctrl + E", "Move to the end of the line"}, 276 | {"PowerShell: Ctrl + U", "Delete from cursor to the beginning of the line"}, 277 | {"PowerShell: Ctrl + K", "Delete from cursor to the end of the line"}, 278 | {"PowerShell: Ctrl + W", "Delete the word before the cursor"}, 279 | {"PowerShell: Alt + F", "Move cursor forward one word"}, 280 | {"PowerShell: Alt + B", "Move cursor backward one word"}, 281 | {"PowerShell: Alt + D", "Delete the word after the cursor"}, 282 | {"PowerShell: Shift + Insert", "Paste from clipboard"}, 283 | {"PowerShell: Shift + Up Arrow", "Scroll up through command history"}, 284 | {"PowerShell: Shift + Down Arrow", "Scroll down through command history"}, 285 | 286 | // Postman Hotkeys 287 | {"Postman: Ctrl + N", "New tab"}, 288 | {"Postman: Ctrl + T", "New request tab"}, 289 | {"Postman: Ctrl + W", "Close tab"}, 290 | {"Postman: Ctrl + Shift + N", "New window"}, 291 | {"Postman: Ctrl + Shift + W", "Close window"}, 292 | {"Postman: Ctrl + Enter", "Send request"}, 293 | {"Postman: Ctrl + S", "Save request"}, 294 | {"Postman: Ctrl + F", "Find"}, 295 | {"Postman: Ctrl + Shift + F", "Find and replace"}, 296 | {"Postman: Ctrl + Shift + C", "Toggle comment"}, 297 | {"Postman: Ctrl + Shift + M", "Toggle sidebar"}, 298 | 299 | // macOS Hotkeys 300 | {"macOS: Command + C", "Copy"}, 301 | {"macOS: Command + V", "Paste"}, 302 | {"macOS: Command + X", "Cut"}, 303 | {"macOS: Command + Z", "Undo"}, 304 | {"macOS: Command + Shift + Z", "Redo"}, 305 | {"macOS: Command + A", "Select all"}, 306 | {"macOS: Command + F", "Find"}, 307 | {"macOS: Command + H", "Hide application"}, 308 | {"macOS: Command + Q", "Quit application"}, 309 | {"macOS: Command + Space", "Spotlight search"}, 310 | {"macOS: Command + Tab", "Switch applications"}, 311 | {"macOS: Command + Option + Esc", "Force quit applications"}, 312 | 313 | // macOS Terminal Hotkeys 314 | {"macOS Terminal: Command + T", "New tab"}, 315 | {"macOS Terminal: Command + N", "New window"}, 316 | {"macOS Terminal: Command + W", "Close tab"}, 317 | {"macOS Terminal: Command + Shift + W", "Close window"}, 318 | {"macOS Terminal: Command + K", "Clear screen"}, 319 | {"macOS Terminal: Command + Arrow Up", "Scroll up"}, 320 | {"macOS Terminal: Command + Arrow Down", "Scroll down"}, 321 | {"macOS Terminal: Command + Arrow Left", "Move cursor to beginning of line"}, 322 | {"macOS Terminal: Command + Arrow Right", "Move cursor to end of line"}, 323 | {"macOS Terminal: Option + Arrow Left", "Move cursor one word left"}, 324 | {"macOS Terminal: Option + Arrow Right", "Move cursor one word right"}, 325 | {"macOS Terminal: Control + C", "Interrupt current command"}, 326 | {"macOS Terminal: Control + D", "Exit the shell"}, 327 | {"macOS Terminal: Control + L", "Clear the screen"}, 328 | {"macOS Terminal: Control + R", "Search command history"}, 329 | {"macOS Terminal: Control + A", "Move to the beginning of the line"}, 330 | {"macOS Terminal: Control + E", "Move to the end of the line"}, 331 | {"macOS Terminal: Control + U", "Delete from cursor to the beginning of the line"}, 332 | {"macOS Terminal: Control + K", "Delete from cursor to the end of the line"}, 333 | {"macOS Terminal: Control + W", "Delete the word before the cursor"}, 334 | {"macOS Terminal: Control + Y", "Paste the last cut text"}, 335 | {"macOS Terminal: Control + T", "Transpose characters"}, 336 | 337 | // zsh Hotkeys 338 | {"zsh: Control + A", "Move to the beginning of the line"}, 339 | {"zsh: Control + E", "Move to the end of the line"}, 340 | {"zsh: Control + U", "Delete from cursor to the beginning of the line"}, 341 | {"zsh: Control + K", "Delete from cursor to the end of the line"}, 342 | {"zsh: Control + W", "Delete the word before the cursor"}, 343 | {"zsh: Control + Y", "Paste the last cut text"}, 344 | {"zsh: Control + T", "Transpose characters"}, 345 | {"zsh: Control + L", "Clear the screen"}, 346 | {"zsh: Control + R", "Search command history"}, 347 | {"zsh: Control + C", "Interrupt current command"}, 348 | {"zsh: Control + D", "Exit the shell"}, 349 | {"zsh: Alt + F", "Move cursor forward one word"}, 350 | {"zsh: Alt + B", "Move cursor backward one word"}, 351 | {"zsh: Alt + D", "Delete the word after the cursor"}, 352 | {"zsh: Alt + Backspace", "Delete the word before the cursor"}, 353 | {"zsh: Control + X Control + E", "Open the current command in the default editor"}, 354 | {"zsh: Control + P", "Previous command in history"}, 355 | {"zsh: Control + N", "Next command in history"}, 356 | {"zsh: Control + S", "Search forward in command history"}, 357 | {"zsh: Control + Q", "Resume output after Control + S"}, 358 | {"zsh: Control + Z", "Suspend the current foreground job"}, 359 | {"zsh: Control + _", "Undo the last editing command"}, 360 | } -------------------------------------------------------------------------------- /main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "flag" 5 | "fmt" 6 | "os" 7 | "strings" 8 | "github.com/gdamore/tcell/v2" 9 | "what-cmd/commands" 10 | "what-cmd/flags" 11 | "what-cmd/hotkeys" 12 | ) 13 | 14 | type KeyValuePair struct { 15 | Name string 16 | Description string 17 | } 18 | 19 | // converting the flag map into a slice to allow uniform processing and ranking. 20 | func convertMapToKeyValuePairs(m map[string]flags.Flag) []KeyValuePair { 21 | var keyValuePairs []KeyValuePair 22 | for k, v := range m { 23 | keyValuePairs = append(keyValuePairs, KeyValuePair{Name: k, Description: v.Description}) 24 | } 25 | return keyValuePairs 26 | } 27 | 28 | // transforming command definitions to a uniform structure so our matching logic handles all items similarly. 29 | func convertCommandsToKeyValuePairs(cmds []commands.Command) []KeyValuePair { 30 | var keyValuePairs []KeyValuePair 31 | for _, c := range cmds { 32 | keyValuePairs = append(keyValuePairs, KeyValuePair{Name: c.Name, Description: c.Description}) 33 | } 34 | return keyValuePairs 35 | } 36 | 37 | // mapping hotkey definitions to a key-value pair form to integrate them into our matching algorithm. 38 | func convertHotkeysToKeyValuePairs(cmds []hotkeys.Hotkey) []KeyValuePair { 39 | var keyValuePairs []KeyValuePair 40 | for _, c := range cmds { 41 | keyValuePairs = append(keyValuePairs, KeyValuePair{Name: c.Name, Description: c.Description}) 42 | } 43 | return keyValuePairs 44 | } 45 | 46 | // using a weighted scoring approach to determine the most relevant command based on user input, 47 | // ensuring that exact matches and near similarities are prioritized over less relevant items. 48 | func findClosestMatch(input string, words []KeyValuePair) KeyValuePair { 49 | var bestMatch KeyValuePair 50 | highestScore := -1 51 | 52 | for _, word := range words { 53 | score := 0 54 | 55 | // Prioritize an exact match in the name to align precisely with what the user intends. 56 | if strings.EqualFold(word.Name, input) { 57 | score += 100 58 | } else { 59 | // Searching descriptions can capture additional context the name alone might miss. 60 | if strings.Contains(strings.ToLower(word.Description), strings.ToLower(input)) { 61 | score += 10 62 | } 63 | 64 | // Partial matches in the name still count but receive a lower weight. 65 | if strings.Contains(strings.ToLower(word.Name), strings.ToLower(input)) { 66 | score += 5 67 | } 68 | 69 | // Using the edit distance helps us favor commands with minimal differences. 70 | nameDistance := distanceAtoB(strings.ToLower(word.Name), strings.ToLower(input)) 71 | descDistance := distanceAtoB(strings.ToLower(word.Description), strings.ToLower(input)) 72 | score += max(0, 10-nameDistance) 73 | score += max(0, 5-descDistance) 74 | } 75 | 76 | if score > highestScore { 77 | highestScore = score 78 | bestMatch = word 79 | } 80 | } 81 | 82 | return bestMatch 83 | } 84 | 85 | // implementing Levenshtein distance to measure similarity, 86 | // because quantifying edit differences aids in recognizing near misses. 87 | func distanceAtoB(str1, str2 string) int { 88 | len1, len2 := len(str1), len(str2) 89 | distanceMatrix := make([][]int, len1+1) 90 | for row := range distanceMatrix { 91 | distanceMatrix[row] = make([]int, len2+1) 92 | } 93 | // filling the matrix to capture incremental edit costs, ensuring a fair comparison between strings. 94 | for row := 0; row <= len1; row++ { 95 | for col := 0; col <= len2; col++ { 96 | if row == 0 { 97 | distanceMatrix[row][col] = col 98 | } else if col == 0 { 99 | distanceMatrix[row][col] = row 100 | } else if str1[row-1] == str2[col-1] { 101 | distanceMatrix[row][col] = distanceMatrix[row-1][col-1] 102 | } else { 103 | distanceMatrix[row][col] = 1 + findMin( 104 | distanceMatrix[row-1][col], 105 | distanceMatrix[row][col-1], 106 | distanceMatrix[row-1][col-1], 107 | ) 108 | } 109 | } 110 | } 111 | 112 | return distanceMatrix[len1][len2] 113 | } 114 | 115 | // choosing the minimum among three possible edit paths to favor the least disruptive change. 116 | func findMin(a, b, c int) int { 117 | if a < b && a < c { 118 | return a 119 | } else if b < c { 120 | return b 121 | } 122 | return c 123 | } 124 | 125 | // selecting the larger of two values to ensure our scoring in the matching algorithm captures the dominant factor. 126 | func max(a, b int) int { 127 | if a > b { 128 | return a 129 | } 130 | return b 131 | } 132 | 133 | // drawing borders to separate interface sections because clear boundaries help users navigate the UI. 134 | func drawBorder(screen tcell.Screen, x1, y1, x2, y2 int, style tcell.Style) { 135 | for x := x1; x <= x2; x++ { 136 | screen.SetContent(x, y1, tcell.RuneHLine, nil, style) 137 | screen.SetContent(x, y2, tcell.RuneHLine, nil, style) 138 | } 139 | for y := y1; y <= y2; y++ { 140 | screen.SetContent(x1, y, tcell.RuneVLine, nil, style) 141 | screen.SetContent(x2, y, tcell.RuneVLine, nil, style) 142 | } 143 | screen.SetContent(x1, y1, tcell.RuneULCorner, nil, style) 144 | screen.SetContent(x2, y1, tcell.RuneURCorner, nil, style) 145 | screen.SetContent(x1, y2, tcell.RuneLLCorner, nil, style) 146 | screen.SetContent(x2, y2, tcell.RuneLRCorner, nil, style) 147 | } 148 | 149 | func getFlagsForCommand(commandName string) []flags.Flag { 150 | if commandFlag, exists := flags.Words[commandName]; exists { 151 | return []flags.Flag{commandFlag} 152 | } 153 | return nil 154 | } 155 | 156 | func wrapText(text string, maxWidth int) []string { 157 | var lines []string 158 | words := strings.Fields(text) 159 | if len(words) == 0 { 160 | return lines 161 | } 162 | 163 | currentLine := words[0] 164 | for _, word := range words[1:] { 165 | if len(currentLine)+len(word)+1 > maxWidth { 166 | lines = append(lines, currentLine) 167 | currentLine = word 168 | } else { 169 | currentLine += " " + word 170 | } 171 | } 172 | lines = append(lines, currentLine) 173 | return lines 174 | } 175 | 176 | func handleScrollInput(event *tcell.EventKey, scrollPosition *int, selectedIndex *int, filteredWords []KeyValuePair, cmdWindowHeight int) { 177 | switch event.Key() { 178 | case tcell.KeyUp: 179 | if *selectedIndex > 0 { 180 | *selectedIndex-- 181 | if *selectedIndex < *scrollPosition { 182 | *scrollPosition-- 183 | } 184 | } 185 | case tcell.KeyDown: 186 | if *selectedIndex < len(filteredWords)-1 { 187 | *selectedIndex++ 188 | if *selectedIndex >= *scrollPosition+cmdWindowHeight-2 { 189 | *scrollPosition++ 190 | } 191 | } 192 | } 193 | } 194 | 195 | func main() { 196 | flag.CommandLine.Usage = func() { 197 | fmt.Fprintf(flag.CommandLine.Output(), "Usage of %s:\n", os.Args[0]) 198 | flag.PrintDefaults() 199 | } 200 | 201 | useFlags := flag.Bool("flags", false, "search in flags instead of commands") 202 | useHotkeys := flag.Bool("hotkeys", false, "search in hotkeys instead of commands") 203 | flag.Parse() 204 | 205 | var words []KeyValuePair 206 | if *useFlags { 207 | words = convertMapToKeyValuePairs(flags.Words) 208 | } else if *useHotkeys { 209 | words = convertHotkeysToKeyValuePairs(hotkeys.Words) 210 | } else { 211 | words = convertCommandsToKeyValuePairs(commands.Words) 212 | } 213 | 214 | // initializing the screen using tcell to gain platform-independent control of terminal rendering. 215 | screen, err := tcell.NewScreen() 216 | if err != nil { 217 | fmt.Println("Failed to initialize tcell:", err) 218 | os.Exit(1) 219 | } 220 | if err := screen.Init(); err != nil { 221 | fmt.Println("Failed to initialize screen:", err) 222 | os.Exit(1) 223 | } 224 | defer screen.Fini() 225 | 226 | var userInput []rune 227 | 228 | selectedIndex := 0 229 | 230 | inputChanged := false 231 | 232 | scrollPosition := 0 233 | 234 | // The main loop continuously refreshes the UI to represent the current state, 235 | // supporting a dynamic interface that reacts in real time. 236 | for { 237 | screen.Clear() 238 | 239 | width, height := screen.Size() 240 | 241 | cmdWindowHeight := height - 10 242 | cmdWindowWidth := width * 2 / 10 243 | descWindowWidth := width - cmdWindowWidth - 2 244 | 245 | whiteStyle := tcell.StyleDefault.Foreground(tcell.ColorWhite) 246 | tealStyle := tcell.StyleDefault.Foreground(tcell.ColorTeal) 247 | highlightStyle := tcell.StyleDefault.Foreground(tcell.ColorLightSkyBlue).Bold(true) 248 | promptStyle := tcell.StyleDefault.Foreground(tcell.ColorRed).Bold(true) 249 | 250 | drawBorder(screen, 0, 0, cmdWindowWidth, cmdWindowHeight, tealStyle) 251 | drawBorder(screen, cmdWindowWidth+1, 0, width-1, cmdWindowHeight, tealStyle) 252 | 253 | commandWord := "Commands" 254 | for i, r := range commandWord { 255 | screen.SetContent(1+i, 0, r, nil, whiteStyle) 256 | } 257 | 258 | descriptionWord := "Descriptions" 259 | for i, r := range descriptionWord { 260 | screen.SetContent(cmdWindowWidth+2+i, 0, r, nil, whiteStyle) 261 | } 262 | 263 | promptBoxHeight := 8 264 | promptBoxWidth := cmdWindowWidth 265 | promptBoxXStart := 0 266 | promptBoxYStart := cmdWindowHeight + 1 267 | promptBoxXEnd := promptBoxXStart + promptBoxWidth 268 | promptBoxYEnd := promptBoxYStart + promptBoxHeight 269 | 270 | drawBorder(screen, promptBoxXStart, promptBoxYStart, promptBoxXEnd, promptBoxYEnd, tealStyle) 271 | 272 | searchWord := "Search" 273 | for i, r := range searchWord { 274 | screen.SetContent(promptBoxXStart+1+i, promptBoxYStart, r, nil, whiteStyle) 275 | } 276 | 277 | prompt := "Enter a command to search for (type 'exit' to quit): " 278 | wrappedPrompt := wrapText(prompt, promptBoxWidth-2) 279 | for i, line := range wrappedPrompt { 280 | for j, r := range line { 281 | screen.SetContent(promptBoxXStart+1+j, promptBoxYStart+1+i, r, nil, tcell.StyleDefault) 282 | } 283 | } 284 | 285 | userInputYStart := promptBoxYEnd - 1 286 | for i, r := range userInput { 287 | screen.SetContent(promptBoxXStart+1+i, userInputYStart, r, nil, promptStyle) 288 | } 289 | 290 | inputStr := string(userInput) 291 | closest := findClosestMatch(inputStr, words) 292 | 293 | asciiArt := ` 294 | __ ___ _ _______ _____ __ __ _____ 295 | \ \ / / | | | /\|__ __| / ____| \/ | __ \ 296 | \ \ /\ / /| |__| | / \ | |______| | | \ / | | | | 297 | \ \/ \/ / | __ | / /\ \ | |______| | | |\/| | | | | 298 | \ /\ / | | | |/ ____ \| | | |____| | | | |__| | 299 | \/ \/ |_| |_/_/ \_\_| \_____|_| |_|_____/ ` 300 | 301 | asciiArtLines := strings.Split(asciiArt, "\n") 302 | asciiArtHeight := len(asciiArtLines) 303 | asciiArtWidth := 0 304 | for _, line := range asciiArtLines { 305 | if len(line) > asciiArtWidth { 306 | asciiArtWidth = len(line) 307 | } 308 | } 309 | 310 | asciiHeight := 8 311 | asciiBoxYEnd := cmdWindowHeight 312 | asciiBoxYStart := asciiBoxYEnd - asciiHeight 313 | asciiArtX := cmdWindowWidth + descWindowWidth - asciiArtWidth + 1 314 | asciiArtY := asciiBoxYStart - asciiArtHeight + 8 315 | 316 | for y, line := range asciiArtLines { 317 | for x, r := range line { 318 | screen.SetContent(asciiArtX+x, asciiArtY+y, r, nil, tealStyle) 319 | } 320 | } 321 | 322 | var filteredWords []KeyValuePair 323 | for _, word := range words { 324 | if strings.Contains(strings.ToLower(word.Name), strings.ToLower(inputStr)) || strings.Contains(strings.ToLower(word.Description), strings.ToLower(inputStr)) { 325 | filteredWords = append(filteredWords, word) 326 | } 327 | } 328 | 329 | closest = findClosestMatch(inputStr, filteredWords) 330 | 331 | if len(filteredWords) > 0 && closest.Name != "" { 332 | for i, word := range filteredWords { 333 | if word.Name == closest.Name && word.Description == closest.Description { 334 | filteredWords[0], filteredWords[i] = filteredWords[i], filteredWords[0] 335 | break 336 | } 337 | } 338 | } 339 | 340 | if inputChanged { 341 | selectedIndex = 0 342 | scrollPosition = 0 343 | inputChanged = false 344 | } 345 | 346 | 347 | for i := scrollPosition; i < len(filteredWords) && i < scrollPosition+cmdWindowHeight-1; i++ { 348 | word := filteredWords[i] 349 | style := tcell.StyleDefault 350 | if i == selectedIndex { 351 | style = highlightStyle 352 | } 353 | 354 | wrappedName := wrapText(word.Name, cmdWindowWidth-2) 355 | wrappedDescription := wrapText(word.Description, descWindowWidth-2) 356 | 357 | currentLine := i - scrollPosition + 1 358 | for _, line := range wrappedName { 359 | if currentLine < cmdWindowHeight-1 { 360 | for j, r := range line { 361 | screen.SetContent(j+1, currentLine, r, nil, style) 362 | } 363 | currentLine++ 364 | } 365 | } 366 | 367 | currentLine = i - scrollPosition + 1 368 | for _, line := range wrappedDescription { 369 | if currentLine < cmdWindowHeight-1 { 370 | for j, r := range line { 371 | screen.SetContent(cmdWindowWidth+2+j, currentLine, r, nil, style) 372 | } 373 | currentLine++ 374 | } 375 | } 376 | } 377 | 378 | // If the number of filtered search results is less than 10000, draw a box and display flags 379 | if len(filteredWords) < 10000 { 380 | flagsBoxWidth := descWindowWidth 381 | flagsBoxHeight := 8 382 | flagsBoxXStart := cmdWindowWidth + 1 383 | flagsBoxXEnd := width - 1 384 | flagsBoxYStart := cmdWindowHeight + 1 385 | flagsBoxYEnd := flagsBoxYStart + flagsBoxHeight 386 | 387 | drawBorder(screen, flagsBoxXStart, flagsBoxYStart, flagsBoxXEnd, flagsBoxYEnd, tealStyle) 388 | 389 | word := "Flags" 390 | for i, r := range word { 391 | screen.SetContent(flagsBoxXStart+1+i, flagsBoxYStart, r, nil, whiteStyle) 392 | } 393 | 394 | if selectedIndex < len(filteredWords) { 395 | selectedCommand := filteredWords[selectedIndex] 396 | flags := getFlagsForCommand(selectedCommand.Name) 397 | for i, flag := range flags { 398 | if i < flagsBoxYEnd-flagsBoxYStart-1 { 399 | y := flagsBoxYStart + 1 + i 400 | screen.SetContent(flagsBoxXStart+1, y, rune(flag.Name[0]), nil, highlightStyle) 401 | for j, r := range flag.Name[1:] { 402 | screen.SetContent(flagsBoxXStart+2+j, y, r, nil, highlightStyle) 403 | } 404 | 405 | wrappedDescription := wrapText(flag.Description, flagsBoxWidth-2-len(flag.Name)-1) 406 | for k, line := range wrappedDescription { 407 | if y+k < flagsBoxYEnd { 408 | for j, r := range line { 409 | screen.SetContent(flagsBoxXStart+2+len(flag.Name)+1+j, y+k, r, nil, highlightStyle) 410 | } 411 | } 412 | } 413 | } 414 | } 415 | } 416 | } 417 | 418 | // Flushing the changes to the screen so they are displayed correctly 419 | screen.Show() 420 | 421 | event := screen.PollEvent() 422 | switch ev := event.(type) { 423 | case *tcell.EventKey: 424 | switch ev.Key() { 425 | case tcell.KeyEscape, tcell.KeyCtrlC: 426 | return 427 | case tcell.KeyUp, tcell.KeyDown: 428 | handleScrollInput(ev, &scrollPosition, &selectedIndex, filteredWords, cmdWindowHeight) 429 | case tcell.KeyEnter: 430 | selectedCommand := filteredWords[selectedIndex] 431 | screen.Fini() 432 | fmt.Printf("%s: %s\n", selectedCommand.Name, selectedCommand.Description) 433 | flags := getFlagsForCommand(selectedCommand.Name) 434 | for _, flag := range flags { 435 | fmt.Printf(" %s: %s\n", flag.Name, flag.Description) 436 | } 437 | return 438 | case tcell.KeyBackspace, tcell.KeyBackspace2: 439 | if len(userInput) > 0 { 440 | userInput = userInput[:len(userInput)-1] 441 | inputChanged = true 442 | } 443 | default: 444 | if ev.Rune() != 0 { 445 | userInput = append(userInput, ev.Rune()) 446 | inputChanged = true 447 | } 448 | } 449 | case *tcell.EventResize: 450 | screen.Sync() 451 | case *tcell.EventError: 452 | fmt.Println("Error:", ev.Error()) 453 | return 454 | } 455 | } 456 | } --------------------------------------------------------------------------------