Prerequisites
- Node.js 18 or higher
- npm, pnpm, or yarn package manager
- A Dub account (sign up here)
Global Installation
Install the CLI globally to use it from anywhere:Verify Installation
Check that the CLI is installed correctly:0.0.13).
Initial Setup
After installation, authenticate with your Dub account:Login
Run the login command:This will:
- Open your default browser
- Redirect to Dub’s authentication page
- Start a local server on port 4587
- Store credentials securely after authentication
Local Development Setup
For contributing to the CLI or testing unreleased features:Build in Watch Mode
Start the development build:This watches for changes and rebuilds automatically.
Production-like Testing
Test the CLI as it would work after installation:Configuration Storage
The CLI stores configuration usingconfigstore:
- macOS:
~/Library/Preferences/dub-cli-nodejs/ - Linux:
~/.config/dub-cli-nodejs/ - Windows:
%APPDATA%\dub-cli-nodejs\Config\
- Access token
- Refresh token
- Selected domain
- Token expiration time
Troubleshooting
Port Already in Use
If port 4587 is already in use during login:-
Kill the process using the port:
-
Try logging in again:
Command Not Found
Ifdub command is not found after installation:
-
Check npm global bin directory:
-
Add it to your PATH:
- Restart your terminal
Permission Errors
On macOS/Linux, you may need sudo for global installation:Authentication Issues
If authentication fails:-
Clear stored credentials:
-
Try logging in again:
Updating
Update to the latest version:Uninstalling
Remove the CLI:Next Steps
CLI Commands
Learn all available commands
CLI Overview
Back to CLI overview
API Reference
Explore the API
Server SDKs
Use programmatic SDKs