[](https://crates.io/crates/fuga)
[](https://github.com/liebe-magi/fuga/blob/main/LICENSE)
[](https://github.com/liebe-magi/fuga/actions/workflows/build.yml)<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
[](#contributors-)
<!-- ALL-CONTRIBUTORS-BADGE:END -->
# ๐ฆ FUGA ๐ฆ

A CLI tool to operate files or directories in 2 steps.
[ๆฅๆฌ่ชใฎREADMEใฏใใกใ](README_jp.md)
## ๐ฆ DESCRIPTION
- `fuga` is a CLI tool that performs file operations in two steps.
- Developed as an alternative to commands like `mv`, `cp`, and `ln`.
- Mark one or more files or directories using `fuga mark`, and then perform copy/move/link operations together after navigating to another directory.
- Save frequently used mark sets as presets and reload them later from the CLI or dashboard.
- Launching `fuga` without arguments opens an interactive dashboard TUI so you can browse, mark, and run copy/move/link actions without leaving the terminal.
## ๐ฆ INSTALLATION
### Pre-built Binaries
- Pre-built binaries for the following architectures are available on [releases](https://github.com/liebe-magi/fuga/releases).
- aarch64-apple-darwin (Mac - Apple Chip)
- x86_64-apple-darwin (Mac - Intel Chip)
- x86_64-unknown-linux-gnu (Linux - Intel Chip)
- Place the binary for your architecture in a directory included in your system's PATH.
### Build with Cargo
- You can install `fuga` by building it using the `cargo` command.
```
cargo install fuga
```
### Verify Installation
- If the installation is successful, the version information can be displayed using the following command:
```
$ fuga -V
fuga v1.1.0
```
## ๐ฆ USAGE
> Running `fuga` without a subcommand launches the dashboard TUI. Use the subcommands below when you prefer scripted CLI flows.
```
A CLI tool to operate files or directories in 2 steps.
Usage: fuga <COMMAND>
Commands:
mark Manage the marked targets
copy Copy the marked targets
move Move the marked targets
link Make symbolic links to the marked targets
completion Generate the completion script
preset Manage mark presets
version Show the version of the tool
help Print this message or the help of the given subcommand(s)
Options:
-h, --help Print help
-V, --version Print version
```
### Interactive Dashboard (TUI)
- Launch the dashboard by running `fuga` with no arguments.
- Browse the current directory, toggle hidden files with `.` or `Ctrl+h`, and filter entries with `/` plus fuzzy queries.
- Move the cursor with arrow keys or `j`/`k`, open directories with `Enter`/`l`, and return to the parent with `h` or `Backspace`.
- Press `m` or space to toggle marks, `Ctrl+r`/`R` to clear the mark list, and `?` to view the in-app help overlay.
- Open the preset loader with `P`, save the current marks with `S`, and delete presets from the popup with `D` or `x`.
- Exit with `c`, `v`, or `s` to copy, move, or link the marked targets into the directory you were browsing, or `q` to leave without changes.
### Managing Marked Targets
- Mark the files or directories you want to operate on with `fuga mark <PATH...>`.
```
$ fuga mark target_file.txt docs
โ
: ๐ /home/user/path/to/target_file.txt marked.
โ
: ๐ /home/user/path/to/docs marked.
โน๏ธ : Mark list now tracks 2 target(s).
```
- To add more paths without duplicating existing entries, use `fuga mark --add <PATH...>`.
```
$ fuga mark --add images/*.png
โ
: ๐ /home/user/path/to/images/banner.png added.
โ
: ๐ /home/user/path/to/images/logo.png added.
โน๏ธ : Mark list now tracks 4 target(s).
```
- To list the currently marked targets, use `fuga mark --list`.
```
$ fuga mark --list
โน๏ธ : Marked targets:
๐ /home/user/path/to/target_file.txt
๐ /home/user/path/to/docs
๐ /home/user/path/to/images/banner.png
๐ /home/user/path/to/images/logo.png
```
- To clear all marked targets, use `fuga mark --reset`.
```
$ fuga mark --reset
โ
: Marked targets cleared.
โน๏ธ : Mark list now tracks 0 target(s).
```
### Managing Presets
- Save the current mark list as a preset with `fuga preset save <NAME>`.
```
$ fuga preset save photos
โ
: Preset 'photos' saved with 3 target(s).
```
- Load the targets from a preset back into the mark list with `fuga preset load <NAME>`.
```
$ fuga preset load photos
โ
: Preset 'photos' loaded. Mark list now tracks 3 target(s).
```
- Review stored presets with `fuga preset list`, inspect their contents via `fuga preset show <NAME>`, and remove obsolete entries with `fuga preset delete <NAME>`.
### File Operations
Three file operations are possible: `Copy`, `Move`, and `Symbolic Link creation`.
#### Copy
- Navigate to the destination directory and use `fuga copy` to copy all marked files or directories.
```
$ cd test_dir_copy
$ fuga copy
โน๏ธ : Copying ๐ /home/user/path/to/target_file.txt -> /current/dir/target_file.txt
โ
: ๐ /current/dir/target_file.txt copied.
โน๏ธ : Copying ๐ /home/user/path/to/docs -> /current/dir/docs
โ
: ๐ /current/dir/docs copied.
```
- You can also specify the destination directory, or a file name when exactly one target is marked.
```
$ fuga copy test_dir_copy
โน๏ธ : Copying ๐ /home/user/path/to/target_file.txt -> test_dir_copy/target_file.txt
โ
: ๐ test_dir_copy/target_file.txt copied.
$ fuga copy copy.txt
โน๏ธ : Copying ๐ /home/user/path/to/target_file.txt -> copy.txt
โ
: ๐ copy.txt copied.
```
#### Move
- Navigate to the destination directory and use `fuga move` to move the marked file or directory.
```
$ cd test_dir_move
$ fuga move
โน๏ธ : Moving ๐ /home/user/path/to/target_file.txt -> /current/dir/target_file.txt
โ
: ๐ /current/dir/target_file.txt moved.
โน๏ธ : Moving ๐ /home/user/path/to/docs -> /current/dir/docs
โ
: ๐ /current/dir/docs moved.
โน๏ธ : Mark list cleared after move.
```
- Similar to copying, you can specify the destination directory or file name.
```
$ fuga move test_dir_move
โน๏ธ : Moving ๐ /home/user/path/to/target_file.txt -> test_dir_move/target_file.txt
โ
: ๐ test_dir_move/target_file.txt moved.
$ fuga move move.txt
โน๏ธ : Moving ๐ /home/user/path/to/target_file.txt -> move.txt
โ
: ๐ move.txt moved.
```
#### Symbolic Link
- Navigate to the directory where you want to create a symbolic link and use `fuga link` to create a symbolic link to the marked file or directory.
```
$ cd test_dir_link
$ fuga link
โน๏ธ : Linking ๐ /home/user/path/to/target_file.txt -> /current/dir/target_file.txt
โ
: ๐ /current/dir/target_file.txt linked.
```
- You can also specify the destination directory or file name for the symbolic link.
```
$ fuga link test_dir_link
โน๏ธ : Linking ๐ /home/user/path/to/target_file.txt -> test_dir_link/target_file.txt
โ
: ๐ test_dir_link/target_file.txt linked.
$ fuga link link.txt
โน๏ธ : Linking ๐ /home/user/path/to/target_file.txt -> link.txt
โ
: ๐ link.txt linked.
```
### Generating Completion Scripts
- Use `fuga completion <shell>` to output a script for command completion. It supports the following five shells:
- bash
- elvish
- fish
- powershell
- zsh
```
# For fish
$ fuga completion fish > ~/.config/fish/completions/fuga.fish
```
## Contributors โจ
Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):
<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->
<!-- prettier-ignore-start -->
<!-- markdownlint-disable -->
<table>
<tbody>
<tr>
<td align="center" valign="top" width="14.28%"><a href="https://hackfront.dev"><img src="https://avatars.githubusercontent.com/u/38152917?v=4?s=100" width="100px;" alt="ใใผใน"/><br /><sub><b>ใใผใน</b></sub></a><br /><a href="#projectManagement-liebe-magi" title="Project Management">๐</a> <a href="https://github.com/liebe-magi/fuga/pulls?q=is%3Apr+reviewed-by%3Aliebe-magi" title="Reviewed Pull Requests">๐</a> <a href="https://github.com/liebe-magi/fuga/commits?author=liebe-magi" title="Code">๐ป</a> <a href="https://github.com/liebe-magi/fuga/commits?author=liebe-magi" title="Documentation">๐</a></td>
</tr>
</tbody>
</table>
<!-- markdownlint-restore -->
<!-- prettier-ignore-end -->
<!-- ALL-CONTRIBUTORS-LIST:END -->
This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!