# The hard way

We recommend you use the [`onepub pub add`](/guides/package-dependencies.md) command to add a dependency. However, you can also add the dependency by hand.

#### Manually configure a OnePub dependency

The onepub pub add command simply adds a hosted dependency to your pubspec.yaml which of course you can also do manually (but why would you?).

For each private package that your project depends on, you can add a hosted key.

Copy the 'publish\_to' URL from your OnePub profile page:

![](/files/G00Rljutk8j2fxBYP7cx)

Now paste it into the 'hosted' key for the package.

```yaml
dependencies: 
  my_private_package:
    version: 1.0.2
    hosted: https://onepub.dev/api/xxxxxxxx
```

{% hint style="danger" %}
If your dart version is older than 2.15, then you must use the older hosted format.
{% endhint %}

```yaml
dependencies: 
  my_private_package:
    version: 1.0.2
    hosted: 
      name: my_private_package
      url: https://onepub.dev/api/xxxxx
```


---

# 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://docs.onepub.dev/guides/package-dependencies/the-hard-way.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.
