> 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/cli-integration/pub-add.md).

# pub add

The `onepub pub add` command serves the same purpose as the `dart pub add` command in that it adds a named dependency to your `pubspec.yaml` file.&#x20;

The difference is that the dependency includes a hosted URL which indicates that the dependency is hosted on OnePub.

### pub add \<dependency>

To add a dependency, hosted within your OnePub private repository, called `mypackage` run:

```bash
onepub pub add mypackage
```

### pub add -dev \<dependency>

To add a dev dependency, hosted within your OnePub private repository, called `mytestpackage` run:

```bash
onepub pub add --dev mytestpackage
```
