Skip to main content

Implementing a new option

Adding a new option to a feature is a great way to contribute to Remotion and enable more use cases.

Ways of specifying an option

There are multiple ways to specify an option:

  • APIs that can be called via Node.JS can directly accept a parameter.
  • Options influencing a render can be added to the render dialog in the Remotion Studio.
  • If the action is available as a CLI command, the option should also be added as a CLI flag.
  • The config file can be also be used to specify multiple options.
    note

    The config file should not be read when executing a CLI command, otherwise it's values should be ignored.

Option Resolution

The option should be resolved in the following order:

1
Directly passed to the Node.JS API
2
Specified via the render UI in the Remotion Studio
3
Specified via CLI flag
4
Specified via config file
5
Fallback to a default value

Naming

The option should be named in camelCase for options in Node.JS and in hyphen-case for options accepted by the CLI.

Options accepting numerical values should include the unit in the name. For example durationInFrames instead of duration or timeoutInMilliseconds instead of timeout.

Documentation

The option should be documented in the API reference and the CLI reference.

Note from which version the option is available.

Testing changes to the CLI

Check out the Running the CLI section in the contributing docs.

Add CLI autocompletion

In the cli-autocomplete package under src/source.ts, you can add new options. People who use Fig will then be able to get accurate autocompletion for your feature.

See also