#target-file #file #target-directory #file-io #cli-file #step

app fuga

A CLI tool to operate files or directories in 2 steps

7 releases

0.1.2 Jun 26, 2024
0.1.1 Jan 24, 2024
0.0.4 Dec 27, 2023

#183 in Filesystem

MIT license

1.5MB
553 lines

Crates.io Crates.io build

📦 FUGA 📦

logo

A CLI tool to operate files or directories in 2 steps.

日本語のREADMEはこちら

📦 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 files or directories to operate on using fuga mark, and then perform copy or move operations after navigating to another directory.

📦 INSTALLATION

Pre-built Binaries

  • Pre-built binaries for the following architectures are available on 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 v0.1.1

📦 USAGE

A CLI tool to operate files or directories in 2 steps.

Usage: fuga <COMMAND>

Commands:
  mark        Set the path of the target file or directory
  copy        Copy the marked file or directory
  move        Move the marked file or directory
  link        Make a symbolic link to the marked file or directory
  completion  Generate the completion script
  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

Setting the Target File

  • Mark the file or directory you want to operate on with fuga mark <TARGET>.
$ fuga mark target_file.txt
 : 📄 target_file.txt has marked.
  • To check the currently marked file or directory, use fuga mark --show.
$ fuga mark --show
ℹ️ : 📄 /home/user/path/to/file/target_file.txt
  • To unmark a file or directory, use fuga mark --reset.
$ fuga mark --reset
 : The marked path has reset.

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 the marked file or directory.
$ cd test_dir_copy

$ fuga copy
ℹ️ : Start copying 📄 target_file.txt from /home/user/path/to/file/target_file.txt
 : 📄 target_file.txt has copied.
  • You can also specify the destination directory or file name.
$ fuga copy test_dir_copy
ℹ️ : Start copying 📄 test_dir_copy/target_file.txt from /home/user/path/to/file/target_file.txt
 : 📄 test_dir_copy/target_file.txt has copied.

$ fuga copy copy.txt
ℹ️ : Start copying 📄 copy.txt from /home/user/path/to/file/target_file.txt
 : 📄 copy.txt has copied.

Move

  • Navigate to the destination directory and use fuga move to move the marked file or directory.
$ cd test_dir_move

$ fuga move
ℹ️ : Start moving 📄 target_file.txt from /home/user/path/to/file/target_file.txt
 : 📄 target_file.txt has moved.
  • Similar to copying, you can specify the destination directory or file name.
$ fuga move test_dir_move
ℹ️ : Start copying 📄 test_dir_move/target_file.txt from /home/user/path/to/file/target_file.txt
 : 📄 test_dir_move/target_file.txt has moved.

$ fuga move move.txt
ℹ️ : Start moving 📄 move.txt from /home/user/path/to/file/target_file.txt
 : 📄 move.txt has moved.
  • 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
ℹ️ : Start making symbolic link 📄 target_file.txt from /home/user/path/to/file/target_file.txt
 : 📄 target_file.txt has made.
  • You can also specify the destination directory or file name for the symbolic link.
$ fuga link test_dir_link
ℹ️ : Start making symbolic link 📄 test_dir_link/target_file.txt from /home/user/path/to/file/target_file.txt
 : 📄 test_dir_link/target_file.txt has made.

$ fuga link link.txt
ℹ️ : Start making symbolic link 📄 link.txt from /home/user/path/to/file/target_file.txt
 : 📄 link.txt has made.

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

Dependencies

~5–16MB
~150K SLoC