# Pub/Sub CLI reference

Source: `@socra/pubsub-cli@0.0.2`.

This reference includes every command, argument, and option declared by this released package. Defaults and accepted values are included where the package declares them. Command-specific validation and permissions also apply; see the [API reference](/docs/pubsub/reference/api) for resource contracts.

Use `socra pubsub --help`, or append `--help` to any command, to inspect the locally installed version.

## socra pubsub

Publish and consume durable project-scoped messages

| Command | Purpose |
| --- | --- |
| `socra pubsub topic` | Manage project-owned topics |
| `socra pubsub subscription` | Manage independent topic delivery streams |
| `socra pubsub publish` | Publish a UTF-8 message to a topic |
| `socra pubsub pull` | Pull messages from a subscription |
| `socra pubsub acknowledge` | Acknowledge a pulled message |

## socra pubsub topic

Manage project-owned topics

| Command | Purpose |
| --- | --- |
| `socra pubsub topic create` | Create a topic |
| `socra pubsub topic get` | Get a topic |
| `socra pubsub topic list` | List topics |
| `socra pubsub topic update` | Update a topic |
| `socra pubsub topic delete` | Delete a topic |
| `socra pubsub topic binding` | Grant projects access to a topic |

## socra pubsub topic create

Create a topic

```text
socra pubsub topic create <name> [options]
```

### Arguments

| Argument | Required | Description |
| --- | --- | --- |
| `name` | Yes | Topic name |

### Options

| Option | Input | Description |
| --- | --- | --- |
| `--project` | Value | Target project id |
| `--retention` | Value | Retention seconds |

## socra pubsub topic get

Get a topic

```text
socra pubsub topic get <name> [options]
```

### Arguments

| Argument | Required | Description |
| --- | --- | --- |
| `name` | Yes | Topic name |

### Options

| Option | Input | Description |
| --- | --- | --- |
| `--project` | Value | Target project id |

## socra pubsub topic list

List topics

```text
socra pubsub topic list [options]
```

### Options

| Option | Input | Description |
| --- | --- | --- |
| `--project` | Value | Target project id |
| `--limit` | Value | Maximum rows to return |
| `--after` | Value | Cursor from a previous page |

## socra pubsub topic update

Update a topic

```text
socra pubsub topic update <name> [options]
```

### Arguments

| Argument | Required | Description |
| --- | --- | --- |
| `name` | Yes | Topic name |

### Options

| Option | Input | Description |
| --- | --- | --- |
| `--project` | Value | Target project id |
| `--retention` | Value | Retention seconds |

## socra pubsub topic delete

Delete a topic

```text
socra pubsub topic delete <name> [options]
```

### Arguments

| Argument | Required | Description |
| --- | --- | --- |
| `name` | Yes | Topic name |

### Options

| Option | Input | Description |
| --- | --- | --- |
| `--project` | Value | Target project id |

## socra pubsub topic binding

Grant projects access to a topic

| Command | Purpose |
| --- | --- |
| `socra pubsub topic binding create` | Create a topic project binding |
| `socra pubsub topic binding list` | List bindings on a topic |
| `socra pubsub topic binding delete` | Delete a topic binding |

## socra pubsub topic binding create

Create a topic project binding

```text
socra pubsub topic binding create <topic> [options]
```

### Arguments

| Argument | Required | Description |
| --- | --- | --- |
| `topic` | Yes | Topic name |

### Options

| Option | Input | Description |
| --- | --- | --- |
| `--project` | Value | Target project id |
| `--target-project` | Value | Project receiving access |
| `--role` | Value | publisher or subscriber |

## socra pubsub topic binding list

List bindings on a topic

```text
socra pubsub topic binding list <topic> [options]
```

### Arguments

| Argument | Required | Description |
| --- | --- | --- |
| `topic` | Yes | Topic name |

### Options

| Option | Input | Description |
| --- | --- | --- |
| `--project` | Value | Target project id |
| `--limit` | Value | Maximum rows to return |
| `--after` | Value | Cursor from a previous page |

## socra pubsub topic binding delete

Delete a topic binding

```text
socra pubsub topic binding delete <topic> [options]
```

### Arguments

| Argument | Required | Description |
| --- | --- | --- |
| `topic` | Yes | Topic name |

### Options

| Option | Input | Description |
| --- | --- | --- |
| `--project` | Value | Target project id |
| `--binding` | Value | Topic binding id |

## socra pubsub subscription

Manage independent topic delivery streams

| Command | Purpose |
| --- | --- |
| `socra pubsub subscription create` | Create a subscription |
| `socra pubsub subscription get` | Get a subscription |
| `socra pubsub subscription list` | List subscriptions |
| `socra pubsub subscription update` | Update a subscription |
| `socra pubsub subscription delete` | Delete a subscription |

## socra pubsub subscription create

Create a subscription

```text
socra pubsub subscription create <name> [options]
```

### Arguments

| Argument | Required | Description |
| --- | --- | --- |
| `name` | Yes | Subscription name |

### Options

| Option | Input | Description |
| --- | --- | --- |
| `--project` | Value | Target project id |
| `--topic` | Value | Canonical topic resource name |
| `--ack-deadline` | Value | Acknowledgment deadline seconds |
| `--retention` | Value | Retention seconds |

## socra pubsub subscription get

Get a subscription

```text
socra pubsub subscription get <name> [options]
```

### Arguments

| Argument | Required | Description |
| --- | --- | --- |
| `name` | Yes | Subscription name |

### Options

| Option | Input | Description |
| --- | --- | --- |
| `--project` | Value | Target project id |

## socra pubsub subscription list

List subscriptions

```text
socra pubsub subscription list [options]
```

### Options

| Option | Input | Description |
| --- | --- | --- |
| `--project` | Value | Target project id |
| `--limit` | Value | Maximum rows to return |
| `--after` | Value | Cursor from a previous page |

## socra pubsub subscription update

Update a subscription

```text
socra pubsub subscription update <name> [options]
```

### Arguments

| Argument | Required | Description |
| --- | --- | --- |
| `name` | Yes | Subscription name |

### Options

| Option | Input | Description |
| --- | --- | --- |
| `--project` | Value | Target project id |
| `--status` | Value | active or paused |
| `--ack-deadline` | Value | Acknowledgment deadline seconds |
| `--retention` | Value | Retention seconds |

## socra pubsub subscription delete

Delete a subscription

```text
socra pubsub subscription delete <name> [options]
```

### Arguments

| Argument | Required | Description |
| --- | --- | --- |
| `name` | Yes | Subscription name |

### Options

| Option | Input | Description |
| --- | --- | --- |
| `--project` | Value | Target project id |

## socra pubsub publish

Publish a UTF-8 message to a topic

```text
socra pubsub publish <topic> [options]
```

### Arguments

| Argument | Required | Description |
| --- | --- | --- |
| `topic` | Yes | Topic name |

### Options

| Option | Input | Description |
| --- | --- | --- |
| `--project` | Value | Target project id |
| `--as-project` | Value | Publishing project id |
| `--data` | Value | UTF-8 message body |

## socra pubsub pull

Pull messages from a subscription

```text
socra pubsub pull <subscription> [options]
```

### Arguments

| Argument | Required | Description |
| --- | --- | --- |
| `subscription` | Yes | Subscription name |

### Options

| Option | Input | Description |
| --- | --- | --- |
| `--project` | Value | Target project id |
| `--max` | Value | Maximum messages |

## socra pubsub acknowledge

Acknowledge a pulled message

```text
socra pubsub acknowledge <subscription> [options]
```

### Arguments

| Argument | Required | Description |
| --- | --- | --- |
| `subscription` | Yes | Subscription name |

### Options

| Option | Input | Description |
| --- | --- | --- |
| `--project` | Value | Target project id |
| `--ack-token` | Value | Acknowledgment token |

## Next step

Return to the [Pub/Sub overview](/docs/pubsub).

---

Company: Socra — Multiply Your Judgment
Canonical URL: https://cloud.socra.com/docs/pubsub/reference/cli
