# CLI integration

OnePub CLI tooling is designed to work alongside your existing Dart CLI tooling.

When you install the OnePub CLI tooling two applications are added to your PATH.&#x20;

* [onepub](#onepub)
* [opub](#opub)

## onepub

The onepub CLI app is the primary tool you use when interacting with OnePub from the CLI.&#x20;

The onepub app supports a number of commands.

You can view a full list of the commands by running:

```bash
onepub --help
```

To get help on an individual command run:

```bash
onepub <command> --help
```

#### onepub commands

The onepub app supports the following commands:

<table><thead><tr><th width="150"></th><th></th><th></th></tr></thead><tbody><tr><td>login</td><td>Login to a OnePub Organisation</td><td>Your email address can be associated with multiple Organisations and you use the login command to switch between them.</td></tr><tr><td>logout</td><td>Logout of OnePub</td><td><code>pub get</code> will fail if you have a private dependency in your project.</td></tr><tr><td>doctor</td><td>Displays your OnePub configuration details.</td><td>Use the output of doctor when you are reporting bugs or want to check the status of OnePub.</td></tr><tr><td>export</td><td>Export a OnePub Token</td><td>Tokens can be used to auth in a <a href="../ci-cd">CI/CD</a> environement or over an <a href="../ssh">SSH</a> session.</td></tr><tr><td>import</td><td>Import a OnePub Token</td><td>Allows you to login when a Web browser and/or user interaction is viable such as in a <a href="../ci-cd">CI/CD</a> or <a href="../ssh">SSH</a> environment.</td></tr><tr><td>pub add [--dev]</td><td>Add a dependency on a private package.</td><td>Works the same as the <code>dart pub add</code> but for your own private packages.</td></tr><tr><td>pub private</td><td>Marks your project as a private package.</td><td>After marking your package as private you can <a href="../publishing-packages">publish</a> it to your OnePub private repo using the standard Dart tooling.</td></tr><tr><td><a href="../cli-integration/globally-activate">pub global activate</a></td><td>Globally activate a private package.</td><td>If you have a private package that contains CLI tools this command installs them and adds them to your PATH.</td></tr><tr><td><a href="../cli-integration/globally-activate">pub global deactivate</a></td><td>Globally deactivate a private package.</td><td>If you have activated a  global package this command will un-install it and remove it from your PATH.</td></tr></tbody></table>

## opub

The opub app is used provided for users that are using versions of Dart prior to 2.15.

The Dart development team made significant changes with respect to how the Dart CLI tools interact with a private repository and older versions of the Dart `pub` command aren't compatible with OnePub.

To circumvent this problem OnePub provide the `opub` app which replaces the `dart pub` and `flutter pub` commands.

When running a command (such as dart pub get) that operates on a private package or a package that depends on a private package then you simply substitute 'dart pub get' or 'flutter pub get' with 'opub get'. The same goes for all of the `pub` commands.

If you are running an even older version of Dart (pre-2.12) then read the section on using [Dart pre-2.1](https://docs.onepub.dev/guides/installing/pre-dart-2.12)2.
