> For the complete documentation index, see [llms.txt](https://help.diarkis.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.diarkis.io/en/diarkis-tool/diarkis-cli/how-to-reference-private-repository.md).

# When you want to reference a private repository

## Overview

When building with Diarkis-cli, if the project references a private repository, an authentication error occurs on the build server. This document explains how to circumvent this issue.

## Problem

If you attempt to build as is, the build server of Diarkis-cli will encounter an authentication error with the code in your private repository.

## Solution

You can avoid this issue by following these steps:

1. **Copy the private repository code locally**

   Copy the directory of the private repository into the same repository.
2. **Modify go.mod**

   Change it to reference the local repository as shown below:

   ```go
   require (
   	github.com/Org/privateModule v0.0.0-00010101000000-000000000000
   )

   replace github.com/Org/privateModule => ./private-module // change Org and privateModule
   ```

   (Replace 'Org' and 'privateModule' with the actual names as needed)
3. **Execute the build**

   Proceed with the build as usual, and it should succeed.

## TIPS

By specifying unnecessary files from the local private repository directory in `.buildignore`, you can reduce the amount to be uploaded.


---

# 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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://help.diarkis.io/en/diarkis-tool/diarkis-cli/how-to-reference-private-repository.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
