Skip to main content
The Dub CLI is a command-line tool for creating and managing short links with the Dub API directly from your terminal.

Installation

Install the Dub CLI globally using npm:
npm install -g dub-cli
Verify the installation:
dub --version

Quick Start

1

Authenticate

Log into your Dub account:
dub login
This will open your browser for OAuth authentication.
2

Configure Domain

Select your workspace domain:
dub domains
3

Create a Short Link

Create your first short link:
dub shorten https://example.com/long-url

Available Commands

The CLI provides the following commands:
CommandDescription
dub loginLog into the Dub platform
dub configView your configured credentials
dub domainsConfigure your workspace domain
dub shorten [url] [key]Create a short link
dub links [options]Search for links in your workspace
dub help [command]Display help for a command

Features

  • OAuth Authentication - Secure login with your Dub account
  • Domain Management - Select and configure workspace domains
  • Link Creation - Create short links with custom keys
  • Link Search - Search and filter your existing links
  • Interactive Prompts - User-friendly prompts for missing parameters
  • Colored Output - Clear, readable terminal output

Authentication

The CLI uses OAuth 2.0 for secure authentication:
dub login
This command:
  1. Opens your browser for authentication
  2. Starts a local callback server
  3. Stores credentials securely
  4. Grants access with the following scopes:
    • links.read - Read links
    • links.write - Create and update links
    • domains.read - Read domains

Next Steps

CLI Installation

Detailed installation instructions

CLI Commands

Complete command reference

API Reference

Explore the API

Server SDKs

Use programmatic SDKs

Build docs developers (and LLMs) love