# Library guide

> Use grit-lib from Rust — the same engine that powers the grit CLI.

These pages walk through every stable domain in `grit-lib`: repository discovery, typed handles on `Repository`, and network or maintenance workflows. Each guide includes a compiled example from `grit-examples` that tests against the system `git` binary.

| Page | Topic |
| --- | --- |
| [Repository](https://grit-scm.com/docs/library/repository/index.md) | Discover, open, init, typed handles overview |
| [Embedding](https://grit-scm.com/docs/library/embedding/index.md) | Environment, sinks, subprocess injection, concurrency |
| [Config](https://grit-scm.com/docs/library/config/index.md) | `Repository::config()` / `Config` get/set |
| [Objects](https://grit-scm.com/docs/library/objects/index.md) | `Objects` read/write |
| [Refs](https://grit-scm.com/docs/library/refs/index.md) | `References`, reflog, backends |
| [Storage backends](https://grit-scm.com/docs/library/storage-backends.md/index.md) | Custom object and ref stores, conformance suites |
| [Index](https://grit-scm.com/docs/library/staging/index.md) | `IndexFile`, stage, write tree |
| [Worktree](https://grit-scm.com/docs/library/worktree/index.md) | Linked worktrees, ignore, attributes |
| [Diff](https://grit-scm.com/docs/library/diff/index.md) | `Diff` tree/index/worktree |
| [Revwalk](https://grit-scm.com/docs/library/revwalk/index.md) | `RevWalk`, merge base |
| [Merge](https://grit-scm.com/docs/library/merge/index.md) | Three-way tree merge, porcelain merge helpers |
| [Network](https://grit-scm.com/docs/library/network/index.md) | `Remotes` |
| [Stash](https://grit-scm.com/docs/library/stash/index.md) | `RepositoryStash` |
| [Notes](https://grit-scm.com/docs/library/notes/index.md) | `RepositoryNotes` |
| [Bundle](https://grit-scm.com/docs/library/bundle/index.md) | `Bundles` |
| [Maintenance](https://grit-scm.com/docs/library/maintenance/index.md) | Fsck object rules, hooks |
| [API layout](https://grit-scm.com/docs/library/api-layout/index.md) | Flat → canonical module map |
| [API map](https://grit-scm.com/docs/library/api-map/index.md) | Generated module and type index |

For exhaustive API detail see [grit-lib on docs.rs](https://docs.rs/grit-lib).
