npx skills add remotion-dev/remotion --skill add-cli-option
dexhunter/remotion · Archived
add-cli-option
Add a new Remotion CLI or config option by creating an AnyRemotionOption, registering CLI parsing, wiring config setters, and updating documentation. Use when adding or converting command-line flags or Remotion options.
Installation
npx skills add dexhunter/remotion --skill add-cli-option
Stronger alternatives
This repository is archived — consider an actively maintained alternative.
Add a new Remotion bug entry to packages/bugs/api/[v].ts. Use when the user describes a bug and…
1 installsAdd a test case to the web renderer
1 installsAdd a new package to the Remotion monorepo, including package scaffolding, monorepo registratio…
1 installsBest practices for writing Remotion animations that stay intuitive for agents and editable in R…
1 installsSimilar popular skills
Related neighbors and high-traction skills in the same topics — useful to compare before installing.
Use for Azure AI: Search, Speech, OpenAI, Document Intelligence. Helps with search, vector/hybr…
568.2K installsUse this skill any time a .pptx or .potx file is involved in any way — as input, output, or bot…
216.8K installsUse this skill whenever the user wants to do anything with PDF files. This includes reading or …
192.4K installsUse this skill whenever the user wants to create, read, edit, or manipulate Word documents (.do…
184.5K installsUse this skill any time a spreadsheet file is the primary input or output. This means any task …
165K installsAlso in this package
Other skills from dexhunter/remotion · top by installs.
npx skills add dexhunter/remotion
More details
Agent compatibility
Declared targets from SKILL.md / docs. Unmarked agents are not listed — the skill may still install via the CLI.
Also listed on
Alternate registries and mirrors of this skill.
Repository health
main
Package contents
Files included with this skill beyond the listing page.
-
skill md
SKILL.md4,477 B -
docs
SUMMARY.md241 B
History
- First seen on skills.sh
- First recorded snapshot · 1 installs
SKILL.md
Add a new CLI option
How to convert a hardcoded CLI flag into a proper AnyRemotionOption, or add a brand new one.
1. Create the option definition
Create packages/renderer/src/options/<name>.tsx:
import type {AnyRemotionOption} from './option';
let myValue = false; // module-level default state
const cliFlag = 'my-flag' as const;
export const myFlagOption = {
name: 'Human-readable Name',
cliFlag,
description: () => <>Description shown in docs.</>,
ssrName: null, // or 'myFlag' if used in SSR APIs
docLink: 'https://www.remotion.dev/docs/config#setmyflagenabled',
type: false as boolean, // default value, also sets the TypeScript type
getValue: ({commandLine}) => {
if (commandLine[cliFlag] !== undefined) {
return {value: commandLine[cliFlag] as boolean, source: 'cli'};
}
return {value: myValue, source: 'config'};
},
setConfig(value) {
myValue = value;
},
} satisfies AnyRemotionOption<boolean>;
The type in AnyRemotionOption<T> and type: <default> as T determines the option's value type. Use boolean, string | null, number | null, etc.
For negating flags (like --disable-ask-ai → askAIEnabled = false), handle the inversion in getValue.
2. Register in options index
packages/renderer/src/options/index.tsx:
- Add the import (keep alphabetical within the import block)
- Add the option to the
allOptionsobject
This makes it available as BrowserSafeApis.options.myFlagOption throughout the codebase.
3. Update CLI parsed flags
packages/cli/src/parsed-cli.ts:
- For boolean flags, add
BrowserSafeApis.options.myFlagOption.cliFlagto theBooleanFlagsarray - For non-boolean flags, no entry needed here (minimist handles them as strings/numbers automatically)
packages/cli/src/parse-command-line.ts:
- Add to the destructured
BrowserSafeApis.options - In the
CommandLineOptionstype, add:[myFlagOption.cliFlag]: TypeOfOption<typeof myFlagOption>;
4. Use the option where needed
Instead of reading parsedCli['my-flag'] directly, resolve via:
const myFlag = myFlagOption.getValue({commandLine: parsedCli}).value;
For Studio options, this is typically in packages/cli/src/studio.ts. For render options, in the relevant render command file.
5. Add to Config
packages/cli/src/config/index.ts:
- Add to the destructured
BrowserSafeApis.options - Add the setter signature to the
FlatConfigtype (either in theRemotionConfigObjectglobal interface or theFlatConfigintersection) - Add the implementation to the
Configobject:setMyFlagEnabled: myFlagOption.setConfig
6. Update docs — IMPORTANT, do not skip this step
This step is mandatory. Every new option must have its docs updated to use <Options id="..." /> so the description is pulled from the option definition automatically (single source of truth). If converting an existing hardcoded flag, replace any hand-written description with the <Options> component.
CLI command pages (check all that apply — cli/render.mdx, lambda/cli/render.mdx, cloudrun/cli/render.mdx, cli/benchmark.mdx):
- Add or update the
### \--my-flag\`` section - Use
<Options id="my-flag" />as the description body (no import needed — it's globally available) - The
idmust match the option'scliFlag/idvalue
packages/docs/docs/config.mdx:
- Add or update the
## \setMyFlagEnabled()\`` section with:
- <Options id="my-flag" /> for the description - A twoslash config example - A note that the CLI flag takes precedence
Follow the pattern of nearby entries (e.g., setAskAIEnabled, setEnableCrossSiteIsolation).
7. Build and verify
cd packages/renderer && bun run make
cd packages/cli && bun run make
Reference files
- Option type definition:
packages/renderer/src/options/option.ts - Good example to copy:
packages/renderer/src/options/ask-ai.tsx(boolean, studio-only) - Options index:
packages/renderer/src/options/index.tsx - CLI flag registration:
packages/cli/src/parsed-cli.ts - CLI type definitions:
packages/cli/src/parse-command-line.ts - Config registration:
packages/cli/src/config/index.ts