---
title: CLI Command
description: "![](data:image/gif;base64,R0lGODdhAQABAPAAAP///wAAACwAAAAAAQABAEACAkQBADs=) Stream Integration Pro includes a WP-CLI namespace: ``` wp stream-integration-pro ``` Use the CLI when you want direct, scriptable control over uploads, imports, syncs, and local restore workflows. ## When to Use the CLI The CLI is especially useful…"
url: "https://handyplugins.co/docs/stream-integration-pro-cli/"
updated: "2026-04-13"
category: Stream Integration Pro
---

# CLI Command

![](data:image/gif;base64,R0lGODdhAQABAPAAAP///wAAACwAAAAAAQABAEACAkQBADs=)

Stream Integration Pro includes a WP-CLI namespace:

```
wp stream-integration-pro
```

Use the CLI when you want direct, scriptable control over uploads, imports, syncs, and local restore workflows.

## When to Use the CLI

The CLI is especially useful for:

- bulk migrations
- importing existing Stream libraries into WordPress
- restoring local files in batches
- scripted media operations
- operational troubleshooting

## Command Groups

### 1. Upload a local file directly to Stream

This creates:

- a Cloudflare Stream video
- a new WordPress attachment

```
wp stream-integration-pro upload /full/path/to/video.mp4
```

With a custom title:

```
wp stream-integration-pro upload /full/path/to/video.mp4 --title="Homepage hero video"
```

### 2. Offload existing WordPress attachments to Stream

Use `offload` when the file already exists in the WordPress Media Library.

One attachment:

```
wp stream-integration-pro offload 123
```

Several attachments:

```
wp stream-integration-pro offload --ids=123,124,125
```

All matching local videos:

```
wp stream-integration-pro offload --all --limit=20
```

Delete the local file after Stream is ready:

```
wp stream-integration-pro offload 123 --delete-local
```

Queue instead of processing immediately:

```
wp stream-integration-pro offload --all --limit=20 --queued
```

### 3. Download a local copy from Stream

Use `download` when the attachment already exists in WordPress and is linked to Stream.

One attachment:

```
wp stream-integration-pro download 123
```

Several attachments:

```
wp stream-integration-pro download --ids=123,124
```

All matching Stream-linked attachments:

```
wp stream-integration-pro download --all --limit=20
```

Queue the work instead of running it immediately:

```
wp stream-integration-pro download 123 --queued
```

### 4. Sync Stream metadata

Use `sync` when you want WordPress to refresh the latest Stream metadata for existing attachments.

```
wp stream-integration-pro sync 123
```

```
wp stream-integration-pro sync --ids=123,124
```

```
wp stream-integration-pro sync --all --limit=20
```

### 5. Check attachment status

```
wp stream-integration-pro status 123
```

```
wp stream-integration-pro status --ids=123,124
```

```
wp stream-integration-pro status --all --limit=20
```

## Import Existing Stream Videos into WordPress

Use `import-stream` when the video already exists in Cloudflare Stream but WordPress does not yet have an attachment for it.

### Import one Stream video by UID

```
wp stream-integration-pro import-stream b05394e7700fb314818990c4d73ee58e
```

### Import several Stream videos by UID

```
wp stream-integration-pro import-stream --uids=b05394e7700fb314818990c4d73ee58e,ee7024855d6f
```

### Import all Stream videos that WordPress does not know about yet

```
wp stream-integration-pro import-stream --all --limit=20
```

Filter by search term:

```
wp stream-integration-pro import-stream --all --search="foobar" --limit=20
```

### Import and also restore a local file

```
wp stream-integration-pro import-stream b05394e7700fb314818990c4d73ee58e --download-local
```

Bulk version:

```
wp stream-integration-pro import-stream --all --limit=10 --download-local
```

## Common Flags

### `--queued`

Available on:

- `offload`
- `download`
- `sync`

Use this when you want Action Scheduler to handle the work in the background.

### `--timeout=<seconds>`

Use this when a command may need extra time for remote processing.

Example:

```
wp stream-integration-pro download 123 --timeout=600
```

### `--limit=<n>`

Use this on `--all` workflows so you can process large libraries in smaller batches.

Example:

```
wp stream-integration-pro import-stream --all --limit=50
```

## Recommended CLI Workflows

### Bring orphaned Stream videos into WordPress

```
wp stream-integration-pro import-stream --all --limit=50
```

### Bring orphaned Stream videos into WordPress and also restore local files

```
wp stream-integration-pro import-stream --all --limit=20 --download-local
```

### Move local WordPress videos into Stream but keep local files

```
wp stream-integration-pro offload --all --limit=20
```

### Move local WordPress videos into Stream and then remove local files

```
wp stream-integration-pro offload --all --limit=20 --delete-local
```

## Notes

- `download` works on existing WordPress attachments that are already linked to Stream.
- `import-stream` is the command to use when the Stream video exists first and WordPress has no attachment yet.
- Destructive cleanup actions are managed from the WordPress admin UI under `Media > Cloudflare Stream > Tools`.
- Queue-heavy operations may be easier to monitor from the plugin’s `Tools` tab inside wp-admin.
