# The hard way

Instead of using the `onepub pub private` command to make a package private you can  achieve the same objective by manually adding the `publish_to` key to your `pubspec.yaml`.

{% hint style="info" %}
There is no advantage to doing it the hard way. We provide these details so you fully understand what the `onepub pub private` command is doing.
{% endhint %}

Find your organisation's publish\_to URL on your OnePub profile page:

![](/files/goj7j0umqk8iKHrtJQ5S)

Edit the pubspec.yaml of the package you wish to publish and add the `publish_to` keyword:

```yaml
name: mypackage
description: A simple command-line application.
version: 1.0.0
publish_to: https://onepub.dev/api/xxxxxxxx
```

To publish the package, login into OnePub (if you haven't already) then run the dart (or flutter) publish command.

```bash
onepub login
cd mypackage
dart pub publish
```


---

# 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/publishing-packages/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.
