> 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). Agents can also search and read this documentation through its [MCP server](https://help.diarkis.io/~gitbook/mcp).

# When you want to reference a private repository

How to build a repository using Diarkis-cli when it involves 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 by asking a question.

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

```
GET https://help.diarkis.io/en/diarkis-tool/diarkis-cli/how-to-reference-private-repository.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.
