Skip to content

🎥 Make videos programmatically with React

npx remotion lambda compositions command

Jonny Burgerc2e539a92e51
diff --git a/packages/cli/src/compositions.ts b/packages/cli/src/compositions.ts
index 097a79b71d..7fdcf9b958 100644
--- a/packages/cli/src/compositions.ts
+++ b/packages/cli/src/compositions.ts
@@ -4,7 +4,6 @@ import {findEntryPoint} from './entry-point';
import {getCliOptions} from './get-cli-options';
import {loadConfig} from './get-config-file-name';
import {Log} from './log';
-import {quietFlagProvided} from './parse-command-line';
import {printCompositions} from './print-compositions';
import {bundleOnCliOrTakeServeUrl} from './setup-cache';
@@ -68,16 +67,6 @@ export const listCompositionsCommand = async (
port,
downloadMap,
});
- if (!quietFlagProvided()) {
- Log.info();
- Log.info('The following compositions are available:');
- Log.info();
- }
-
- if (quietFlagProvided()) {
- Log.info(compositions.map((c) => c.id).join(' '));
- return;
- }
printCompositions(compositions);
diff --git a/packages/cli/src/print-compositions.ts b/packages/cli/src/print-compositions.ts
index de79ff97cd..3cf3ab70b0 100644
--- a/packages/cli/src/print-compositions.ts
+++ b/packages/cli/src/print-compositions.ts
@@ -1,6 +1,7 @@
// eslint-disable-next-line no-restricted-imports
import type {TCompMetadata} from 'remotion';
import {Log} from './log';
+import {quietFlagProvided} from './parse-command-line';
const max = (arr: number[]) => {
if (arr.length === 0) {
@@ -19,6 +20,17 @@ const max = (arr: number[]) => {
};
export const printCompositions = (compositions: TCompMetadata[]) => {
+ if (!quietFlagProvided()) {
+ Log.info();
+ Log.info('The following compositions are available:');
+ Log.info();
+ }
+
+ if (quietFlagProvided()) {
+ Log.info(compositions.map((c) => c.id).join(' '));
+ return;
+ }
+
const firstColumnLength = max(compositions.map(({id}) => id.length)) + 4;
const secondColumnLength = 8;
const thirdColumnLength = 15;
diff --git a/packages/docs/docs/cli/compositions.md b/packages/docs/docs/cli/compositions.md
index bfb5633189..050fc3a04e 100644
--- a/packages/docs/docs/cli/compositions.md
+++ b/packages/docs/docs/cli/compositions.md
@@ -88,3 +88,10 @@ Opens an actual browser to observe the composition fetching.
### `--quiet`, `--q`
Only prints the composition IDs, separated by a space.
+
+## See also
+
+- [`getCompositions()`](/docs/cli/compositions)
+- [`npx remotion compositions`](/docs/cli/compositions)
+- [`getCompositionsOnLambda()`](/docs/lambda/getcompositionsonlambda)
+- [`npx remotion lambda compositions`](/docs/lambda/cli/compositions)
diff --git a/packages/docs/docs/lambda/cli.md b/packages/docs/docs/lambda/cli.md
index 5f73492ea0..f2a84f2ab2 100644
--- a/packages/docs/docs/lambda/cli.md
+++ b/packages/docs/docs/lambda/cli.md
@@ -13,6 +13,7 @@ To use the Remotion Lambda CLI, you first need to [install it](/docs/lambda/setu
- [functions](/docs/lambda/cli/functions)
- [render](/docs/lambda/cli/render)
- [still](/docs/lambda/cli/still)
+- [compositions](/docs/lambda/cli/compositions)
- [policies](/docs/lambda/cli/policies)
- [quotas](/docs/lambda/cli/quotas)
diff --git a/packages/docs/docs/lambda/cli/compositions.md b/packages/docs/docs/lambda/cli/compositions.md
new file mode 100644
index 0000000000..7766ef6ea2
--- /dev/null
+++ b/packages/docs/docs/lambda/cli/compositions.md
@@ -0,0 +1,81 @@
+---
+title: npx remotion lambda compositions
+sidebar_label: compositions
+---
+
+_Available from v3.3.2._
+
+Print list of composition IDs from a serve URL, fetched from inside a Lambda function.
+
+```bash
+npx remotion lambda compositions <serve-url>
+```
+
+- The serve URL is obtained by deploying a project to Remotion using the [`sites create`](/docs/lambda/cli/sites#create) command or calling [`deploySite()`](/docs/lambda/deploysite).
+
+Note that you can also get the compositions of a site that is hosted on Lambda using [`npx remotion compositions`](/docs/cli/compositions). Vice versa, you can also get the compositions from a serve URL that is not hosted on AWS Lambda using `npx remotion lambda compositions`.
+
+You should use `npx remotion lambda compositions` if you cannot use [`npx remotion compositions`](/docs/cli/compositions) because the machine cannot run Chrome.
+
+## Example commands
+
+Rendering a still:
+
+```
+npx remotion lambda compositions https://remotionlambda-abcdef.s3.eu-central-1.amazonaws.com/sites/testbed/index.html
+```
+
+## Flags
+
+### `--props`
+
+[React Props that can be retrieved using `getInputProps()`.](/docs/get-input-props) Must be a serialized JSON string (`--props='{"hello": "world"}'`) or a path to a JSON file (`./path/to/props.json`).
+
+:::info
+Inline JSON string isn't supported on Windows because it removes the `"` character, use a temporary file instead.
+:::
+
+### `--config`
+
+Specify a location for the Remotion config file.
+
+### `--env-file`
+
+Specify a location for a dotenv file. Default `.env`.
+
+### `--log`
+
+[Set the log level](/docs/config#setlevel). Increase or decrease the amount of output. Acceptable values: `error`, `warn`, `info` (_default_), `verbose`
+
+:::info
+If you don't feel like passing command line flags every time, consider creating a `remotion.config.ts` [config file](/docs/config).
+:::
+
+### `--timeout`
+
+Define how long it may take to resolve all [`delayRender()`](/docs/delay-render) calls before the composition fetching times out in milliseconds. Default: `30000`.
+
+:::info
+Not to be confused with the [`--timeout` flag when deploying a Lambda function](/docs/lambda/cli/functions#--timeout).
+:::
+
+### `--ignore-certificate-errors`
+
+Results in invalid SSL certificates in Chrome, such as self-signed ones, being ignored.
+
+### `--disable-web-security`
+
+This will most notably disable CORS in Chrome among other security features.
+
+### `--disable-headless`
+
+Opens an actual browser to observe the composition fetching.
+
+### `--quiet`, `--q`
+
+Only prints the composition IDs, separated by a space.
+
+## See also
+
+- [`getCompositionsOnLambda()`](/docs/lambda/getcompositionsonlambda)
+- [`npx remotion compositions`](/docs/cli/compositions)
diff --git a/packages/docs/sidebars.js b/packages/docs/sidebars.js
index 9655992d11..540510aed1 100644
--- a/packages/docs/sidebars.js
+++ b/packages/docs/sidebars.js
@@ -27,6 +27,7 @@ module.exports = {
"lambda/cli/render",
"lambda/cli/still",
"lambda/cli/policies",
+ "lambda/cli/compositions",
"lambda/cli/regions",
"lambda/cli/quotas",
],