#file-metadata #metadata #file #git #concatenate #cli

app all-my-circuits

A command-line tool for concatenating and annotating files with Git metadata

3 releases

0.1.6 Oct 28, 2024
0.1.5 Oct 28, 2024
0.1.4 Oct 27, 2024

#160 in Development tools

Download history 328/week @ 2024-10-25 51/week @ 2024-11-01 10/week @ 2024-11-08 8/week @ 2024-11-15 6/week @ 2024-11-22

91 downloads per month

MIT license

19KB
332 lines

File Concatenator with Git Metadata

πŸš€ BLAZINGLY FAST πŸš€ file concatenator built with πŸ¦€ Rust πŸ¦€! ⚑️ Combines your files into a single output while preserving Git history metadata with ZERO-COST ABSTRACTIONS and MEMORY SAFETY guarantees! ⚑️ Designed to create rich, contextual file dumps with Git metadata that serve as perfect context windows for Large Language Models β€” because your AI assistant deserves to know not just WHAT your code is, but WHEN and WHY it was written!

Features

  • πŸšΆβ€β™‚οΈ Recursively walks through directories
  • 🎯 Filters files by extension
  • πŸ“ Adds Git metadata headers (commit hash and timestamp)
  • βš™οΈ Configurable via TOML file
  • πŸ› οΈ Customizable delimiter for file sections

Installation

cargo install all-my-circuits

Quick Start

  1. Create a configuration file .amc.toml (in current directory):
delimiter = "---"
extensions = ["rs", "ts", "py"]
  1. Run the tool:
# Scan current directory with default config
amc

# Scan specific directory with custom config
amc --dir ./src --config custom-config.toml

Output Format

The tool generates output in the following format:

---
File: src/main.rs
Last commit: 623a9e4b9dbdfa9367232ba67e7abe90245c2948
Last update: 1729838996
---
<file contents>

---
File: src/walk.rs
Last commit: 623a9e4b9dbdfa9367232ba67e7abe90245c2948
Last update: 1729838996
---
<file contents>

CLI Options

Usage: amc [OPTIONS]

Options:
  -d, --dir <DIR>      Directory to scan [default: .]
  -c, --config <FILE>  Config file path [default: .amc.toml]
  -h, --help          Print help
  -V, --version       Print version

Configuration

Create a .amc.toml file with the following options:

# String used to separate file sections
delimiter = "---"

# List of file extensions to process (without dots)
extensions = ["rs", "ts", "py", "md"]

Use Cases

  • Generate documentation with context
  • Create annotated source code compilations
  • Prepare code for review with Git history
  • Archive project snapshots with metadata
  • Create meaningful diffs with context

Error Handling

The tool provides friendly error messages for common issues:

  • Missing configuration file
  • Invalid directory paths
  • Git repository access problems
  • File reading permissions

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Dependencies

~15–28MB
~412K SLoC