Skip to main content

npx remotion cloudrun sites

EXPERIMENTAL

Cloud Run is in Alpha, which means APIs may change in any version and documentation is not yet finished. See the changelog to stay up to date with breaking changes.

The npx remotion cloudrun sites command allows to create, view and delete Remotion projects in your Cloud Storage bucket.

create

bash
npx remotion cloudrun sites create <entry-point>?
bash
npx remotion cloudrun sites create <entry-point>?

You may pass an entry point as the first argument, otherwise the entry point will be determined.

Bundle and upload a Remotion video to a Cloud Storage bucket.

The result will be a URL such as https://storage.googleapis.com/remotioncloudrun-12345/sites/mySite123/index.html.

note

If you make changes locally, you need to redeploy the site. Use --site-name to overwrite an existing site.

You can use this "Serve URL" to render a video on Remotion Cloud Run using:

If you are rendering on Cloud Run, you can also pass the site Name (in this case mySite123) as an abbreviation.

Example output
(1/3) [====================] Bundled video 3975ms
(2/3) [====================] Created bucket 457ms
(3/3) [====================] Uploaded to GCP Storage Bucket 25118ms

Deployed to GCP Cloud Storage!

Site: mySite123
Bucket: remotioncloudrun-12345
Region: us-east1
Serve Url: https://storage.googleapis.com/remotioncloudrun-12345/sites/mySite123/index.html

--region

The GCP region to select. The service accessing the site should also be in this same region to minimise latency.

--site-name

Uploads the project to a specific directory and returns a deterministic URL. If a site already existed under this name, in the same region, it will be overwritten. Can only contain the following characters: 0-9, a-z, A-Z, -, !, _, ., *, ', (, )

npx remotion cloudrun sites create src/index.ts --site-name=another-site
npx remotion cloudrun sites create src/index.ts --site-name=another-site
Example output
(1/3) [====================] Bundled video 3975ms
(2/3) [====================] Created bucket 457ms
(3/3) [====================] Uploaded to Cloud Storage 25118ms

Deployed to GCP Cloud Storage!

Site: another-site
Bucket: remotioncloudrun-12345
Region: us-east1
Serve Url: https://storage.googleapis.com/remotioncloudrun-12345/sites/another-site/index.html

ls

npx remotion cloudrun sites ls
npx remotion cloudrun sites ls

Get a list of sites. The URL that is printed can be passed to the render command to render a video.

Example output
2 sites in us-east1, in the remotion-example project.

Site: another-site
Bucket: remotioncloudrun-12345
Region: us-east1
Serve Url: https://storage.googleapis.com/remotioncloudrun-12345/sites/another-site/index.html

Site: test-site
Bucket: remotioncloudrun-12345
Region: us-east1
Serve Url: https://storage.googleapis.com/remotioncloudrun-12345/sites/test-site/index.html

--region

The GCP region to list sites from.

--all-regions,

Ignores region, returning sites across all regions for the project.

npx remotion cloudrun sites ls --all-regions
npx remotion cloudrun sites ls --all-regions
Example output
3 sites in all regions, in the remotion-example project.

Site: another-site
Bucket: remotioncloudrun-12345
Region: us-east1
Serve Url: https://storage.googleapis.com/remotioncloudrun-12345/sites/another-site/index.html

Site: test-site
Bucket: remotioncloudrun-12345
Region: us-east1
Serve Url: https://storage.googleapis.com/remotioncloudrun-12345/sites/test-site/index.html

Site: central-site
Bucket: remotioncloudrun-abcdefgh
Region: us-central1
Serve Url: https://storage.googleapis.com/remotioncloudrun-abcdefgh/sites/central-site/index.html

--quiet, -q

Returns only a list of space-separated sites.

npx remotion cloudrun sites ls -q
npx remotion cloudrun sites ls -q
Example output
another-site test-site central-site

rm

Removes a site (or multiple) from Cloud Storage by it's ID.

bash
npx remotion cloudrun sites rm central-site
npx remotion cloudrun sites rm central-site another-site # multiple at once
bash
npx remotion cloudrun sites rm central-site
npx remotion cloudrun sites rm central-site another-site # multiple at once
Example output
Site:            central-site
Bucket: remotioncloudrun-abcdefgh
Region: us-central1
Serve Url: https://storage.googleapis.com/remotioncloudrun-abcdefgh/sites/central-site/index.html

Delete? (Y/n) Y
Deleted site central-site from bucket remotioncloudrun-abcdefgh.

--region

The GCP region to remove sites from.

note

The rm command does not support the --all-regions flag, as it is possible to have the same site name in multiple regions. This makes it difficult to remove multiple site-names from multiple regions.

--yes, -y

Removes a site (or multiple) without asking for confirmation.

npx remotion cloudrun sites rm central-site -y
npx remotion cloudrun sites rm central-site -y

rmall

Remove all sites in the selected GCP project.

bash
npx remotion cloudrun sites rmall
bash
npx remotion cloudrun sites rmall
Example output
Retrieving sites in us-east1.

Site: another-site
Bucket: remotioncloudrun-12345
Region: us-east1
Serve Url: https://storage.googleapis.com/remotioncloudrun-12345/sites/another-site/index.html

Delete? (Y/n) n
Skipping site - another-site.


Site: test-site
Bucket: remotioncloudrun-12345
Region: us-east1
Serve Url: https://storage.googleapis.com/remotioncloudrun-12345/sites/test-site/index.html

Delete? (Y/n) n
Skipping site - test-site.

--region

The GCP region to remove all sites from.

--all-regions,

Ignores region, removing sites across all regions for the project.

npx remotion cloudrun sites rmall --all-regions
npx remotion cloudrun sites rmall --all-regions
Example output
Retrieving sites in all regions.

Site: another-site
Bucket: remotioncloudrun-12345
Region: us-east1
Serve Url: https://storage.googleapis.com/remotioncloudrun-12345/sites/another-site/index.html

Delete? (Y/n) n
Skipping site - another-site.


Site: test-site
Bucket: remotioncloudrun-12345
Region: us-east1
Serve Url: https://storage.googleapis.com/remotioncloudrun-12345/sites/test-site/index.html

Delete? (Y/n) n
Skipping site - test-site.


Site: central-site
Bucket: remotioncloudrun-abcdefgh
Region: us-central1
Serve Url: https://storage.googleapis.com/remotioncloudrun-abcdefgh/sites/central-site/index.html

Delete? (Y/n) n
Skipping site - central-site.

--yes, -y

Removes all sites without asking for confirmation.

npx remotion cloudrun sites rmall -y
npx remotion cloudrun sites rmall -y