Skip to content

A tool designed to efficiently gather and concatenate all code from a project, streamlining the process of gathering data. Built with .NET 8 and enhanced by the Spectre Console library, this cross-platform application offers a rich command-line interface. Users can specify targeted files.

License

Notifications You must be signed in to change notification settings

g-s-c-code/FileConcatenator

Repository files navigation

FileConcatenator

Overview

FileConcatenator is a utility designed to streamline the process of concatenating multiple code or text files into a single output. This tool is meant to help developers to quickly gather code from various files.

Preview

Features

  • Instant File Concatenation: Merge files in a directory into a single output, with filtering by file type (e.g., *.cs, *.txt).
  • Clipboard Integration: Automatically copies the result to the clipboard for easy sharing or pasting.
  • Customizable Settings:
    • Base Directory: Change the source directory shown upon start up.
    • Clipboard Limit: Set the maximum characters for clipboard content.
    • File Type Selection: Choose what file types should be targeted for concatenation.
    • Hidden Files: Toggle inclusion of hidden files.
  • Persistent Configuration: Settings are saved between sessions for a consistent experience.
  • User-Friendly Interface: Command-line interface with Spectre.Console for easy navigation and command execution.

Installation

To install FileConcatenator, ensure .NET 8.0 SDK is installed. Clone the repository, build, and run:

git clone https://github.com/g-s-c-code/FileConcatenator.git
cd FileConcatenator
dotnet build
dotnet run

Creating Executables

To create a self-contained runnable file for different OSes, run the following:

  • Windows:
    dotnet publish -c Release -r win-x64 --self-contained true /p:PublishSingleFile=true /p:PublishTrimmed=true
  • Linux (ARM64):
    dotnet publish -c Release -r linux-arm64 --self-contained true /p:PublishSingleFile=true /p:PublishTrimmed=true
  • Linux (x64):
    dotnet publish -c Release -r linux-x64 --self-contained true /p:PublishSingleFile=true /p:PublishTrimmed=true
  • macOS (ARM64):
    dotnet publish -c Release -r osx-arm64 --self-contained true /p:PublishSingleFile=true /p:PublishTrimmed=true
  • macOS (x64):
    dotnet publish -c Release -r osx-x64 --self-contained true /p:PublishSingleFile=true /p:PublishTrimmed=true

Configuration Management

The application maintains its configuration in a settings.json file (IMPORTANT: the file is created upon first use), automatically created in the base directory. This configuration includes:

  • BaseDirectoryPath: The root directory for file operations.
  • ClipboardCharacterLimit: Maximum characters allowed in the clipboard.
  • FileTypes: Comma-separated list of file extensions to target.
  • ShowHiddenFiles: Boolean value to determine if hidden files are included.

You can manually edit the settings.json file if needed, or adjust settings through the application's interface.

Troubleshooting & Tips

  • Clipboard Issues: If the clipboard limit is too high, some systems may have difficulty handling the data. If you encounter problems, try reducing the limit.
  • File Access: Ensure you have the necessary permissions to access all files and directories within the base path. Unauthorized access will result in skipped files.
  • Directory Structure: Use the cd command to navigate to the correct directory before concatenating files, especially if working in nested directory structures.

If you encounter any issues or have suggestions for improvements, feel free to contribute to the project or open an issue on the GitHub repository.

About

A tool designed to efficiently gather and concatenate all code from a project, streamlining the process of gathering data. Built with .NET 8 and enhanced by the Spectre Console library, this cross-platform application offers a rich command-line interface. Users can specify targeted files.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages