Command Line Interface in ManimGL
ManimGL uses the manimgl command for rendering scenes. It offers powerful flags for different workflows.
Basic Usage
Running a Scene
# Basic syntax
manimgl scene_file.py SceneName
# Example
manimgl my_animation.py SquareToCircleAuto-Select Scene
# If only one scene in file, it runs automatically
manimgl my_animation.py
# If multiple scenes, presents a menu to choose from
manimgl my_animations.pyCommon Flags
Writing to File
# Write to file (no preview)
manimgl scene.py MyScene -w
# Write and open the file
manimgl scene.py MyScene -o
# Show final frame only
manimgl scene.py MyScene -s
# Save final frame as image and show
manimgl scene.py MyScene -soInteractive Mode
# Skip to line 15 and enter interactive mode
manimgl scene.py MyScene -se 15
# Interactive mode at specific line
manimgl scene.py MyScene --skip_animations --embed 20Display Options
# Fullscreen window
manimgl scene.py MyScene -f
# Custom window size
manimgl scene.py MyScene --resolution 1920,1080
# Hide progress bar
manimgl scene.py MyScene --quietQuality and Resolution
Resolution Presets
# Low quality (for testing)
manimgl scene.py MyScene -l
# Medium quality
manimgl scene.py MyScene -m
# High quality (1080p)
manimgl scene.py MyScene -h
# 4K quality
manimgl scene.py MyScene --uhd
# Custom resolution
manimgl scene.py MyScene --resolution 2560,1440Frame Rate
# Set frame rate (default is 60)
manimgl scene.py MyScene --frame_rate 30
# Lower frame rate for faster renders
manimgl scene.py MyScene --frame_rate 15Advanced Flags
Skip to Specific Animation
# Skip to nth animation
manimgl scene.py MyScene -n 5
# Skip animations (instant mode)
manimgl scene.py MyScene --skip_animationsOutput Options
# Specify output file
manimgl scene.py MyScene -o output.mp4
# Save as GIF
manimgl scene.py MyScene --format gif
# Transparent background
manimgl scene.py MyScene --transparentConfiguration
# Use custom config file
manimgl scene.py MyScene --config_file custom_config.yml
# Set specific config values
manimgl scene.py MyScene --config camera_config.frame_rate=30Interactive Development
The -se Flag
The -se (skip and embed) flag is ManimGL's killer feature:
# Drop into interactive shell at line 15
manimgl scene.py MyScene -se 15In the interactive shell:
# Use abbreviated commands (no self.)
play(circle.animate.shift(RIGHT))
add(Square())
remove(circle)
wait(2)
# Copy code to clipboard, then:
checkpoint_paste() # Run with animations
checkpoint_paste(skip=True) # Run instantly
checkpoint_paste(record=True) # Record while running
# Interactive camera control
touch() # Press 'd' + mouse to rotate, 'z' + scroll to zoom
# Exit
exit()File Organization
Running from Different Directories
# From same directory as manimlib/
manimgl project/scene.py MyScene
# With absolute path
manimgl /full/path/to/scene.py MyScene
# With relative path
manimgl ../other_project/scene.py MySceneCombining Flags
Common Combinations
# High quality, write and open
manimgl scene.py MyScene -h -o
# Low quality, fullscreen, for testing
manimgl scene.py MyScene -l -f
# Skip animations, final frame only
manimgl scene.py MyScene -s --skip_animations
# Interactive at line 20, low quality
manimgl scene.py MyScene -l -se 20
# Save as GIF, high quality
manimgl scene.py MyScene -h --format gif -oWorkflow Examples
Development Workflow
# 1. Initial testing (low quality, fast)
manimgl scene.py MyScene -l
# 2. Interactive debugging at specific point
manimgl scene.py MyScene -l -se 25
# 3. Check final frame
manimgl scene.py MyScene -s
# 4. Final render (high quality, save and open)
manimgl scene.py MyScene -h -oQuick Preview Workflow
# Show final frame immediately
manimgl scene.py MyScene -s
# If it looks good, render full animation
manimgl scene.py MyScene -oBatch Rendering
# Render multiple scenes
for scene in Scene1 Scene2 Scene3; do
manimgl scenes.py $scene -h -w
doneDebugging Flags
Verbose Output
# Show detailed output
manimgl scene.py MyScene --verbose
# Show all debug info
manimgl scene.py MyScene --debugProfiling
# Show performance stats
manimgl scene.py MyScene --profile
# Detailed timing information
manimgl scene.py MyScene --timingConfiguration Override
Temporary Config Changes
# Override window size
manimgl scene.py MyScene --config window_config.size=fullscreen
# Override output directory
manimgl scene.py MyScene --config directories.output=/tmp/manim
# Multiple overrides
manimgl scene.py MyScene \
--config camera_config.frame_rate=30 \
--config camera_config.pixel_width=1280Help and Information
Getting Help
# Show all available flags
manimgl --help
# Show version
manimgl --version
# List scenes in file without running
manimgl scene.py --list_scenesFull CLI Reference
All Major Flags
# Quality/Resolution
-l, --low_quality # 480p, 15fps
-m, --medium_quality # 720p, 30fps
-h, --high_quality # 1080p, 60fps
--uhd # 4K, 60fps
--resolution WIDTHxHEIGHT # Custom resolution
# Output
-w, --write_file # Write to file
-o, --open # Write and open
-s, --show_last_frame # Show final frame
--format FORMAT # Output format (mp4, gif, png)
--transparent # Transparent background
# Playback
-f, --fullscreen # Fullscreen window
-n NUM, --skip_to NUM # Skip to animation number
--skip_animations # Skip all animations
# Interactive
-e, --embed # Drop into IPython shell
--skip_animations --embed # Interactive at end (skip animations)
-se LINE, --skip_and_embed # Interactive at line number
# Configuration
--config_file FILE # Custom config file
--config KEY=VALUE # Override config value
# Debugging
--verbose # Verbose output
--debug # Debug mode
--quiet # Minimize output
--profile # Performance profiling
# Other
--version # Show version
--help # Show help
--list_scenes # List scenes in fileBest Practices
- Use -l for development: Fast iteration with low quality
- Use -se for debugging: Interactive mode at problem points
- Use -s for quick checks: Verify final frame before full render
- Use -h -o for final: High quality output when ready
- Combine flags wisely:
-l -ffor fullscreen testing - Custom configs: Use different configs for different projects
- Script common commands: Create shell aliases for frequent tasks
Common Aliases
Add to .bashrc or .zshrc:
# Quick preview
alias mgl='manimgl -l'
# Final render
alias mgf='manimgl -h -o'
# Interactive debug
alias mgd='manimgl -l -se'
# Show final frame
alias mgs='manimgl -s'Troubleshooting
Common Issues
# Scene not found
manimgl scene.py # Lists all scenes if you don't specify
# Can't find manimlib
# Ensure you're in the directory with manimlib/ or use full paths
# Window not showing
# Check window_config in custom_config.yml
# Poor performance
# Use -l flag, reduce frame_rate, or lower resolutionExample Commands
# Simple preview
manimgl examples/basic_animations.py SquareToCircle
# High quality render
manimgl examples/basic_animations.py SquareToCircle -h -o
# Interactive debugging at line 30
manimgl examples/basic_animations.py SquareToCircle -se 30
# Save as GIF
manimgl examples/basic_animations.py SquareToCircle --format gif -o
# Custom resolution
manimgl examples/basic_animations.py SquareToCircle --resolution 2560,1440
# Skip to 5th animation and show
manimgl examples/basic_animations.py SquareToCircle -n 5
# Fullscreen, low quality for testing
manimgl examples/basic_animations.py SquareToCircle -l -f