# Command Line Interface (CLI)

> Programmatically manage your Dub resources directly from your terminal.

## Install

<Tabs>
  <Tab title="npm">

    ```bash
    npm i -g dub-cli@latest
    ```

  </Tab>
  <Tab title="yarn">
  
    ```bash
    yarn global add dub-cli@latest
    ```
  
  </Tab>
  <Tab title="pnpm">
  
    ```bash 
    pnpm i -g dub-cli@latest
    ```
  
  </Tab>
</Tabs>

<Info>To update an existing installation, run the same command.</Info>

## Version

Check your installed version of Dub CLI:

```bash
dub --version
# => 0.0.12
```

## Commands

Below is a list of available commands in the Dub CLI:

<AccordionGroup>

<Accordion title="dub login">

Log into the Dub platform:

```bash
dub login
```

</Accordion>

<Accordion title="dub config">

View your workspace credentials:

```bash
dub config
```

</Accordion>

<Accordion title="dub domains">

Configure a domain for URL shortening:

```bash
dub domains
```

</Accordion>

<Accordion title="dub shorten">

Create a short link:

```bash
dub shorten
```

You can preemptively pass the URL and the generated short link key, or go through the CLI prompts.

```bash
dub shorten [url] [key]
```

</Accordion>

<Accordion title="dub links">

Search for links in your Dub workspace:

```bash
dub links
```

Here are the available options:

| Option                  | Description                                 |
| ----------------------- | ------------------------------------------- |
| `-s, --search <search>` | Search by name                              |
| `-l, --limit <limit>`   | Limit the number of results (default is 10) |

```bash
dub links [options]
```

</Accordion>

<Accordion title="dub help">

Get help for a specific command:

```bash
dub help [command]
```

</Accordion>

</AccordionGroup>

## Demo

Watch the Dub CLI in action:

<video
  src="https://github.com/user-attachments/assets/2ce9fe51-68ab-4e6d-b08d-4da09c17f90e"
  loop
  autoPlay
  muted
  playsInline
/>
