#file-search #file-utility #command #command-line-tool #github #directory #go

bin+lib thwack

Command line version of Go To File utility, similar to the one on GitHub

52 releases

new 0.8.23 Apr 13, 2024
0.8.21 Feb 26, 2024
0.8.18 Dec 18, 2023
0.8.17 Nov 28, 2023
0.3.0 Jul 12, 2021

#374 in Command line utilities

Download history 3/week @ 2023-12-18 8/week @ 2024-01-15 1/week @ 2024-02-05 9/week @ 2024-02-19 189/week @ 2024-02-26 6/week @ 2024-03-04 1/week @ 2024-03-11 4/week @ 2024-03-18 166/week @ 2024-04-01

172 downloads per month

MIT/Apache

86KB
2.5K SLoC

thwack

GitHub Actions workflow status Crates.io

thwack is a Command-line utility similar to "Go to file" on GitHub. You can search for a file in a directory and invoke an arbitrary command on it.

thwack on iTerm2

Why is this useful?

In many cases, we know the name of a file when we want to open it, but we may not be sure where it's located. In this case, we can search it with our file explorer. However, if we're in a terminal console, it's cumbersome to switch to another application. There might be few command-line tools to support this functionality, but they require us to combine some commands with pipes to get things done.

thwack is the solution! You can find and open a file quickly with it 🚀

Installation

If you have a Rust environment set up, you can use the cargo install command:

cargo install thwack

Note we consider providing easier ways to install thwack. This should be used without the knowledge of Rust.

Getting Started

Just run this command and type the name of the file you'd like to find. By hitting the Enter key on the file you wanted in the list of the results, you can execute an arbitrary command on it.

thwack

Run thwack --help for more options.

Shortcuts

Action Shortcuts
Move selection up Ctrl+p or ⬆️
Move selection down Ctrl+n or ⬇️
Execute command with selection Enter
Copy relative path of selection Ctrl+d
Copy absolute path of selection Ctrl+y
Exit Esc or Ctrl+c

Contributing

Thank you for considering contributing!

This project is so immature that you may wonder how to contribute. Currently, all actions are welcome! Open issues if you want to comment or ask something. Open pull requests directly if you have any ideas. There are many chances to improve this project, so don't hesitate to do something here 😄

Take a look at the CONTRIBUTING.md, too.

License

Copyright © 2021, Yutaka Kamei.

thwack is available under the terms of either the Apache License 2.0 or the MIT License, at your option.

See LICENSE-APACHE, LICENSE-MIT for details.

Dependencies

~12–20MB
~303K SLoC