> For the complete documentation index, see [llms.txt](https://docs.earthbuild.dev/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.earthbuild.dev/docs/earthbuild-lib.md).

# EarthBuild lib

The EarthBuild [lib](https://github.com/EarthBuild/lib) is a collection of reusable functions for common operations to be used in Earthfiles.

EarthBuild lib is split across multiple packages, each of which can be imported separately. The packages are:

* [billing](https://github.com/EarthBuild/lib/tree/main/billing) - functions for estimating billing
* [rust](https://github.com/EarthBuild/lib/tree/main/rust) - functions for working with Rust
* [utils/dind](https://github.com/EarthBuild/lib/tree/main/utils/dind) - functions for working with Docker-in-Docker
* [utils/git](https://github.com/EarthBuild/lib/tree/main/utils/git) - functions for working with Git
* [utils/ssh](https://github.com/EarthBuild/lib/tree/main/utils/ssh) - functions for working with SSH

See the individual packages for more information.

Additional language-specific functions are currently planned for later in 2024.

## Usage

To use EarthBuild lib, import the package you want to use in your Earthfile:

```dockerfile
IMPORT github.com/EarthBuild/lib/utils/git:3.0.4 AS git
```

Then, call the function you want to use:

```dockerfile
DO git+DEEP_CLONE --GIT_URL=...
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.earthbuild.dev/docs/earthbuild-lib.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
