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