# Publishing a Substreams Package

In this guide, you'll learn how to publish a Substreams package to the [Substreams Registry](https://substreams.dev).

### Prerequisites

* You must have the Substreams CLI installed.
* You must have a Substreams package (`.spkg`) that you want to publish.

### Step 1: Run the `substreams publish` Command

1. In a command-line terminal, run `substreams publish <YOUR-PACKAGE>.spkg`.
2. If you do not have a token set in your computer, navigate to `https://substreams.dev/me`.

<figure><img src="https://2510971185-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FerQrzMtqELZRGAdugCR2%2Fuploads%2Fgit-blob-f2c5a7a7fd753c17cad0f0db96e2fbb43911798c%2F1_get-token.png?alt=media" alt="" width="100%"><figcaption></figcaption></figure>

### Step 2: Get a Token in the Substreams Registry

1. In the Substreams Registry, log in with your GitHub account.
2. Create a new token and copy it in a safe location.

<figure><img src="https://2510971185-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FerQrzMtqELZRGAdugCR2%2Fuploads%2Fgit-blob-f5249565940a3ed4165eef785b165c85e84b56e1%2F2_new_token.png?alt=media" alt="" width="100%"><figcaption></figcaption></figure>

### Step 3: Authenticate in the Substreams CLI

1. Back in the Substreams CLI, paste the previously generated token.

<figure><img src="https://2510971185-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FerQrzMtqELZRGAdugCR2%2Fuploads%2Fgit-blob-f54ef5f352395ce652de0bccb2b14d07de9600af%2F3_paste_token.png?alt=media" alt="" width="100%"><figcaption></figcaption></figure>

2. Lastly, confirm that you want to publish the package.

<figure><img src="https://2510971185-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FerQrzMtqELZRGAdugCR2%2Fuploads%2Fgit-blob-b32e56fae04916f8fb405d68c4722bd9bfdb6043%2F4_confirm.png?alt=media" alt="" width="100%"><figcaption></figcaption></figure>

That's it! You have successfully published a package in the Substreams registry.
