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

# Private dependencies

So you have either published a package to OnePub, one of your colleagues has suggested that you use a package they have published on OnePub or you found a private package whilst searching OnePub.

First, make certain your package is a private package hosted on [OnePub](https://onepub.dev).

When you perform a package search in OnePub we show both public and private packages.&#x20;

{% hint style="info" %}
Public packages should be added to your pubspec.yaml using the standard dart tooling.
{% endhint %}

When doing a search, OnePub clearly labels private packages in the search results:

<img src="https://2164893338-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FJazaE7yAHIXZjE9ucSqu%2Fuploads%2Fx64CsjksPkkkU3rNPKr9%2Fimage.png?alt=media&amp;token=b9bdfd73-270f-49b5-9afb-6fc252571d6c" alt="" data-size="original">

In the above screenshot, we have two versions of the cli\_menu package. You can clearly tell which version is the private package from the ![](https://2164893338-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FJazaE7yAHIXZjE9ucSqu%2Fuploads%2F5RLzhUaR61rxJvaLiCNc%2Fimage.png?alt=media\&token=c141d850-60d4-49c1-8db1-342500b068c5)label.

### Configure a OnePub dependency

Once you have published a private package to OnePub you are going to want to update your projects to use the package from OnePub.

The simplest way is to use the `onepub pub add` command.

#### Use the onepub add command

To add or change a package dependency to get the package from OnePub run:

```bash
cd <my project>
onepub pub add [--dev] <package> [version]
```

Use the `--dev` switch to add the package as a dev dependency.

Pass the `version` if you want to control what version to pull, otherwise OnePub selects the latest compatible version. We recommend that in most cases you don't supply the \[version].

If the package already exists as a dependency the onepub will simply update the hosted-url to point to OnePub.

####
