# OnePub

OnePub - [onepub.dev](https://onepub.dev/drive/a50d4f6f-e0fb-40bd-af7b-2dcc295b0332) - is the one-stop solution that allows you to create your own private Dart/Flutter package repository.

Your private OnePub repository can be securely shared amongst internal team members for the development of Flutter/Dart projects.

It is safe, fast, and easy to use.

{% hint style="info" %}
**OnePub** is a private SAAS repository that is modelled on pub.dev for a team's internal Dart/Flutter projects.
{% endhint %}

OnePub allows you to utilize your existing dart command line tools (pub get/publish/upgrade) providing a seamless experience across both public and private packages. To publish a package to your own private OnePub repository:

**For flutter users use the 'flutter' CLI tools.**

```
flutter pub global activate onepub
onepub login
cd <my package>
onepub pub private
flutter pub publish
```

**For Dart users use the 'dart' CLI tools**

```
dart pub global activate onepub
onepub login
cd <my package>
onepub pub private
dart pub publish
```

Once you have published a package to OnePub, you and your Teammates can add dependencies to your pubspec.yaml.

Watch the video play-through on how to publish a package.

To add a dependency to a private package hosted on OnePub, simply run the following commands:

```
onepub pub add <myprivatepackage>
flutter pub get
```

Note: if you are running a dart version prior to 2.12 see the [alternate install](https://docs.onepub.dev/guides/installing/pre-dart-2.12) guide.

{% embed url="<https://onepub.dev/static/video-blogs/OnePub%20Videw%20Blog%20Episode%201%20-%20v3.mp4>" %}

## Why OnePub?

The aim of OnePub is to turn code into a long-term asset by allowing you to create a library of ready-to-use packages.

Useful code is often left buried in larger projects. The result is next time you need the feature it's more likely that the code will be rewritten rather than re-used.

Instead, you can use OnePub to build up a library of reusable packages shared by your team.

OnePub aims to make it quick and easier to publish internal packages by:

* allowing you to publish Dart/Flutter packages to a private repository
* share private packages with colleagues
* easily add dependencies to a private package
* publishes dart doc for each of your packages
* simplifying version management
* provide a single interface to search for public and private packages
* email team notifications for new package versions
* seamless integration with Pub tooling

## Need a little help to publish your first package?

If you are new to publishing dart/flutter packages read one of our how-to blogs to get started:

* [Publish your first package](https://onepub.dev/Blog?id=zuhnoflygz)
* [Share code between your own projects](https://onepub.dev/Blog?id=yvuhnoflyg)
* [Private copies of public packages](https://onepub.dev/Blog?id=favuhnofly)

### Quick Guides: Let's Get Down To It!

Follow our handy guides to get started on the basics:

{% content-ref url="guides/installing/invite-a-member" %}
[invite-a-member](https://docs.onepub.dev/guides/installing/invite-a-member)
{% endcontent-ref %}

{% content-ref url="guides/installing/ide-integration" %}
[ide-integration](https://docs.onepub.dev/guides/installing/ide-integration)
{% endcontent-ref %}

{% content-ref url="guides/installing/cli-integration" %}
[cli-integration](https://docs.onepub.dev/guides/installing/cli-integration)
{% endcontent-ref %}

{% hint style="info" %}
**Online Documentation**: OnePub generates api documentation for your private packages which is available to your team online at: <https://onepub.dev/packages/\\><your package name>
{% endhint %}

### Fundamentals: Dive a little deeper

Learn the fundamentals of OnePub to develop a deeper understanding of its core features:

{% content-ref url="fundamentals/members" %}
[members](https://docs.onepub.dev/fundamentals/members)
{% endcontent-ref %}

{% content-ref url="fundamentals/roles" %}
[roles](https://docs.onepub.dev/fundamentals/roles)
{% endcontent-ref %}

{% content-ref url="guides/publishing-packages" %}
[publishing-packages](https://docs.onepub.dev/guides/publishing-packages)
{% endcontent-ref %}

***


---

# 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/readme.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.
