Dashpub Logo

Sponsor

Dashpub CLI

A command-line companion for the Dashpub private package registry.

This CLI tool helps you manage authentication, tokens, and package publishing for your self-hosted Dashpub instance.

Installation

You can install dashpub_cli globally from pub.dev:

dart pub global activate dashpub_cli

After installation, you can run the tool using the dashpub command.

Usage

Login

Authenticate with your Dashpub server to start a session. This will store a session token locally in ~/.dashpub.

dashpub login --url https://pub.yourdomain.com
  • -u, --url: The Base URL of your Dashpub registry (default: http://localhost:4000).

You will be prompted to enter your Email and Password interactively.

Token Management

Manage API tokens for use with the standard dart pub client or CI/CD pipelines.

View Current Session Token

dashpub token

Generate New API Token

Generate a persistent API token.

dashpub token --generate --url https://pub.yourdomain.com

Output:

New API Token generated successfully:
<YOUR_NEW_TOKEN>

You can use this token for standard pub client authentication:
  dart pub token add https://pub.yourdomain.com
And then paste the token when prompted.

Publishing Packages

Publish the package in the current directory to the registry.

Requirements:

  1. A valid pubspec.yaml must exist in the current directory.
  2. You must be logged in via dashpub login.
dashpub publish --url https://pub.yourdomain.com
  • The CLI automatically ignores hidden files (starting with .) and the build/ directory.
  • It creates a standard gzip archive and uploads it to the server.

Configuration

The CLI stores your session configuration in a JSON file located at:

  • Linux/macOS: ~/.dashpub
  • Windows: %USERPROFILE%\.dashpub

Please do not edit this file manually.

Libraries

dashpub_cli
The Dashpub CLI library.