# 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: 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:

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

The question should be specific, self-contained, and written in natural language.
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.
