Installing as a Library
For Rust Projects
Add Matchy to your Cargo.toml:
Full Installation (includes CLI dependencies)
[dependencies]
matchy = "2.0"
Library Only (minimal dependencies)
If you’re only using Matchy as a library and don’t need CLI components, save ~40 transitive dependencies:
[dependencies]
matchy = { version = "2.0", default-features = false }
This excludes CLI-only dependencies (clap, notify, ctrlc, csv) while keeping all core functionality.
Then run cargo build:
$ cargo build
Updating crates.io index
Downloading matchy v2.0
Compiling matchy v2.0
Compiling your-project v0.1.0
That’s it! You can now use Matchy in your Rust code.
For C/C++ Projects
Option 1: Using cargo-c (Recommended)
Install the system-wide C library:
$ cargo install cargo-c
$ git clone https://github.com/matchylabs/matchy
$ cd matchy
$ cargo cinstall --release --prefix=/usr/local
This installs:
- Headers to
/usr/local/include/matchy/ - Library to
/usr/local/lib/ - pkg-config file to
/usr/local/lib/pkgconfig/
Compile your project:
$ gcc myapp.c $(pkg-config --cflags --libs matchy) -o myapp
Option 2: Manual Installation
- Build the library:
$ git clone https://github.com/matchylabs/matchy
$ cd matchy
$ cargo build --release
- Copy files:
$ sudo cp target/release/libmatchy.* /usr/local/lib/
$ sudo cp include/matchy.h /usr/local/include/
- Update library cache (Linux):
$ sudo ldconfig
- Compile your project:
$ gcc myapp.c -I/usr/local/include -L/usr/local/lib -lmatchy -o myapp
For Other Languages
Matchy provides a C API that can be called from any language with C FFI support:
- Python: Use
ctypesorcffi - Go: Use
cgo - Node.js: Use
node-ffiornapi - Ruby: Use
fiddleorffi
See the C API Reference for the full API specification.
Next Steps
Choose your language: