SkillAgentSearch skills...

Nimgit2

libgit2 wrapper for Nim

Install / Use

/learn @genotrance/Nimgit2
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

Nimgit2 is a Nim wrapper for the libgit2 library.

Nimgit2 is distributed as a Nimble package and depends on nimterop to generate the wrappers. The libgit2 source code is downloaded using Git so having git in the path is ironically required.

Installation

Nimgit2 can be installed via Nimble:

> nimble install nimgit2

This will download and install nimgit2 in the standard Nimble package location, typically ~/.nimble. Once installed, it can be imported into any Nim program.

Usage

Module documentation can be found here

import nimgit2

doAssert git_libgit2_init() > 0, "Failed to init"

Compile with -d:git2Std if libgit2 is already installed by your package manager. Use -d:git2Git or -d:git2DL if building from source or -d:git2Conan or -d:git2JBB if a pre-compiled binary is preferred. Check Conan Center or Bintray for available pre-built versions. Note that Bintray only has shared builds of libgit2 and Conan's static builds on Windows do not work with gcc.

To link a static build of libgit2, set -d:git2Static. The -d:git2SetVer=xxx can be used to set a specific tag or version. These defines can also be set in code using setDefines(). See the nimterop docs for more details.

The libgit2 docs is a good reference guide on how to use the API.

Credits

Nimgit2 wraps the libgit2 source code and all licensing terms of libgit2 apply to the usage of this package.

Feedback

Nimgit2 is a work in progress and any feedback or suggestions are welcome. It is hosted on GitHub with an MIT license so issues, forks and PRs are most appreciated.

View on GitHub
GitHub Stars18
CategoryDevelopment
Updated1mo ago
Forks2

Languages

Nim

Security Score

90/100

Audited on Feb 19, 2026

No findings