# How to publish a private package

Packages are published using command-line tools.

```bash
# install onepub
dart pub global activate onepub

# login to one pub
onepub login

# cd into the directory of the package you want to publish
cd mypackage

# enable private publishing for your package
onepub pub private

# publish the package to onepub using the standard dart publish command.
dart pub publish
```

You can read full details on the [publishing workflow](broken://pages/PbE2uXNQqgvs4v6pk07n).


---

# 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/faq/how-to-publish-a-private-package.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.
