Fuse is a flexible file combining tool for developers, designed to streamline the process of merging multiple files from a project directory into a single output file. It offers a wide range of customization options to suit various project types and developer preferences.
- Download the
install_fuse_win64.bat
script. - Run the script with administrator privileges.
- The script will install Fuse to
C:\Program Files\FuseTool
and add it to your system PATH. - Restart your command prompt to use the
fuse
command.
For other platforms, you can build the project from source:
- Ensure you have .NET SDK 8.0 or later installed.
- Clone the repository:
git clone https://github.com/your-repo/Fuse.git
- Navigate to the project directory:
cd Fuse/src/Fuse.Cli
- Build the project:
dotnet build -c Release
- Run the tool:
dotnet run -- [options]
fuse [options]
--directory, -d <path>
: Path to the directory to process (required).--output, -o <path>
: Path to the output directory where the combined file will be saved (required).--template, -t <template>
: Project template to use (optional).--extensions, -e <list>
: Comma-separated list of file extensions to include in the processing (optional).--exclude, -x <list>
: Comma-separated list of directories to exclude from processing (optional).--name, -n <filename>
: Name of the output file without extension (optional).--overwrite, -w
: Whether to overwrite the output file if it already exists (default: true).--recursive, -r
: Whether to search recursively through subdirectories (default: true).--trim
: Whether to trim leading and trailing whitespace from each line in the file contents (default: true).--max-file-size <size>
: Maximum file size in KB to process. Files larger than this will be skipped. Set to 0 for unlimited size (default: 10240).--ignore-binary
: Whether to ignore binary files (default: true).--aggressive-minify
: Whether to aggressively minify .cs and .razor files, removing most whitespace including newlines (default: false).--include-metadata
: Whether to include file metadata in the output file (default: false).--condense
: Whether to apply line condensing to the output file (default: true).
Fuse supports various project templates to automatically set appropriate file extensions and exclusions:
- Generic
- DotNet
- Java
- Python
- JavaScript
- TypeScript
- Ruby
- Go
- Rust
- Php
- CppCSharp
- Swift
- Kotlin
- Scala
- Dart
- Lua
- Perl
- R
- VbNet
- Fsharp
- Clojure
- Haskell
- Erlang
- Elixir
Use the --template
option to specify a template.
-
Basic usage:
fuse --directory C:\MyProject --output C:\Output
-
Using a project template:
fuse -d C:\MyProject -o C:\Output -t DotNet
-
Custom file extensions:
fuse -d C:\MyProject -o C:\Output -e .cs,.js,.html
-
Exclude specific directories:
fuse -d C:\MyProject -o C:\Output -x bin,obj,node_modules
-
Aggressive minification:
fuse -d C:\MyProject -o C:\Output --aggressive-minify
-
Include metadata:
fuse -d C:\MyProject -o C:\Output --include-metadata