# Dub on boxd

> Short link management platform with analytics and API for creating, managing, and tracking branded short links.

- Page: https://boxd.sh/integrations/dub/
- CLI: `run dub` (17 commands, 10 marked common)
- SDK: `import { dub } from "@boxd/run"`; every parameter and response type is at `@boxd/run/dub`
- Triggers: none
- Connect: `run auth dub` (Sign in with Dub), or https://app.boxd.sh/integrations/detail/dub
- All integrations: https://boxd.sh/integrations/ (Markdown: https://boxd.sh/integrations/index.md)

## From the shell

```sh
run auth dub      # once: prints a link to connect your account
run dub           # list its commands
run dub get-tags
```

Parameters are flags (`--flag value`); object and array parameters take a JSON string. Output is YAML, or JSON with `--json`. Calls use your own connection; `--scope <name>` uses a connection shared with your team.

## From a script

```ts
import { every, dub } from "@boxd/run";

every("1 hour", async () => {
  const result = await dub.getTags({});
  console.log(result);
});
```

Run it with `run dub.run.ts`. Dub has no triggers; `every()` polls on a schedule, keeps the script running as a job, and wakes the machine when it is due.

## Commands

Required flags are listed; `run dub <command> --help` lists the optional ones. "common" marks what `run dub` shows without `--all`.

| Command | SDK method | Required flags | Optional | Description |
|---|---|---|---|---|
| `bulk-delete-links` | `dub.bulkDeleteLinks()` | `--link-ids` | 0 | Delete multiple short links in bulk from Dub |
| `bulk-update-links` ·common | `dub.bulkUpdateLinks()` | `--data` | 2 | Update multiple short links in bulk |
| `create-domain` ·common | `dub.createDomain()` | `--slug` | 7 | Add a domain to a Dub workspace |
| `create-tag` ·common | `dub.createTag()` | `--name` | 1 | Create a new tag in Dub |
| `delete-domain` | `dub.deleteDomain()` | `--slug` | 0 | Delete a domain from your Dub workspace |
| `delete-tag` | `dub.deleteTag()` | `--id` | 0 | Delete a tag from Dub |
| `get-link-info` ·common | `dub.getLinkInfo()` | — | 4 | Retrieve details of a specific short link from Dub |
| `get-links` ·common | `dub.getLinks()` | — | 15 | Retrieve a paginated list of links for the authenticated workspace |
| `get-links-count` | `dub.getLinksCount()` | — | 11 | Retrieve the count of links in workspace with optional filters |
| `get-tags` ·common | `dub.getTags()` | — | 6 | Retrieve a list of tags from Dub |
| `get-workspace` ·common | `dub.getWorkspace()` | `--id-or-slug` | 0 | Retrieve detailed information for a specific workspace |
| `list-domains` ·common | `dub.listDomains()` | — | 4 | Retrieve a list of domains for the authenticated workspace |
| `track-open` | `dub.trackOpen()` | — | 2 | Track a deep link open event in Dub |
| `update-domain` ·common | `dub.updateDomain()` | `--slug` | 8 | Update a domain configuration in Dub |
| `update-tag` | `dub.updateTag()` | `--id` | 2 | Update an existing tag by ID |
| `update-workspace` | `dub.updateWorkspace()` | `--id-or-slug` | 4 | Update workspace settings in Dub |
| `upsert-link` ·common | `dub.upsertLink()` | `--url` | 39 | Create or update a short link in Dub |

## Docs

- [run CLI](https://docs.boxd.sh/cli/run): Call connected integrations from the shell, connect new ones, and run automations.
- [Quickstart](https://docs.boxd.sh/guides/integrations/quickstart): Connect an integration, call it from the shell, and turn a script into an automation.
- [Connections](https://docs.boxd.sh/guides/integrations/connections): Connect an account once, for yourself or for your whole organization.
- [Scripts](https://docs.boxd.sh/guides/automations/scripts): Typed integrations, triggers, schedules and state in a .run.ts file.
- [Jobs](https://docs.boxd.sh/guides/automations/jobs): How a script becomes a background job: states, retries, sleep and wake.
- [Beyond the catalog](https://docs.boxd.sh/guides/automations/beyond-the-catalog): Reach your own APIs, databases and cloud accounts from a script.
