CLI Tools

Integration of Command Line Interface on Onepub.dev with Dart

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

The OnePub CLI tooling makes it easy to publish packages and manage dependencies held by your private repository.

To install the OnePub CLI tooling:

dart pub global activate onepub

or

flutter pub global activate onepub

NOTE: Ensure that the ~/.pub-cache/bin is on your PATH !!!

To see a list of onepub CLI commands run:

onepub --help

When you install the OnePub CLI tooling two applications are added to your PATH.

onepub

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

The onepub app supports a number of commands.

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

onepub --help

To get help on an individual command run:

onepub <command> --help

onepub commands

The onepub app supports the following commands:

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 provides 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.12.

Last updated