Overview
Theinit command creates a new webreel.config.json file with a starter template. The generated config includes a JSON schema reference for IDE autocompletion and inline documentation.
Syntax
Options
| Option | Type | Default | Description |
|---|---|---|---|
--name <name> | string | my-video | Name of the initial video in the config |
--url <url> | string | https://example.com | Starting URL for the video |
-o, --output <file> | string | webreel.config.json | Output file path for the config |
Usage Examples
Create a default config
Generate a config with default values:webreel.config.json with a video named my-video pointing to https://example.com.
Specify video name and URL
Create a config for a login flow:Custom output path
Create a config with a specific filename:Combine all options
Specify all customizations at once:Generated Configuration
The init command creates a file with:Schema reference
Default settings
- outDir:
./videos- where recordings are saved - defaultDelay:
500- milliseconds to wait after each step - viewport:
1920x1080- browser dimensions
Example steps
The template includes three common actions:- pause - initial delay before starting
- click - clicking an element by text
- key - pressing a keyboard shortcut
Inline comments
The generated config includes helpful comments explaining:- What each field does
- How to override defaults
- Links to full documentation
- Common patterns and options
After Initialization
Once you have created your config:- Edit the steps - Replace the example steps with your actual workflow
- Test with preview - Run
webreel previewto verify your steps - Record - Run
webreel recordto generate your video
Error Handling
File already exists
If the output file already exists, you will see:- Use a different output path with
-o - Rename or delete the existing file
- Edit the existing file manually instead
When to Use
Useinit when you:
- Are starting a new webreel project
- Need a template to base your config on
- Want to quickly scaffold multiple config files
- Need IDE autocompletion for editing configs
The init command does not validate that the URL is accessible. Use
webreel validate and webreel preview to test your configuration.Related Commands
webreel validate- Check your config for errorswebreel preview- Test your config in a visible browserwebreel record- Record videos from your config