cli-anything-blender
A stateful command-line interface for 3D scene editing, following the same patterns as the GIMP CLI harness. Uses a JSON scene description format with bpy script generation for actual Blender rendering.
Installation
This CLI is installed as part of the cli-anything-blender package:
bash
pip install cli-anything-blender
Prerequisites:
- Python 3.10+
- blender (>= 4.2) must be installed on your system
Usage
Basic Commands
bash
# Show help
cli-anything-blender --help
# Start interactive REPL mode
cli-anything-blender
# Create a new project
cli-anything-blender project new -o project.json
# Run with JSON output (for agent consumption)
cli-anything-blender --json project info -p project.json
REPL Mode
When invoked without a subcommand, the CLI enters an interactive REPL session:
bash
cli-anything-blender
# Enter commands interactively with tab-completion and history
Command Groups
Scene
Scene management commands.
| Command | Description |
|---|
| Create a new scene |
| Open an existing scene |
| Save the current scene |
| Show scene information |
| List available scene profiles |
| Print raw scene JSON |
Object Group
3D object management commands.
| Command | Description |
|---|
| Add a 3D primitive object |
| Remove an object by index |
| Duplicate an object |
| Transform an object (translate, rotate, scale) |
| Set an object property (name, visible, location, rotation, scale, parent) |
| List all objects |
| Get detailed info about an object |
Material
Material management commands.
| Command | Description |
|---|
| Create a new material |
| Assign a material to an object |
| Set a material property (color, metallic, roughness, specular, alpha, etc.) |
| List all materials |
| Get detailed info about a material |
Modifier Group
Modifier management commands.
| Command | Description |
|---|
| List all available modifiers |
| Show details about a modifier |
| Add a modifier to an object |
| Remove a modifier by index |
| Set a modifier parameter |
| List modifiers on an object |
Camera
Camera management commands.
| Command | Description |
|---|
| Add a camera to the scene |
| Set a camera property |
| Set the active camera |
| List all cameras |
Light
Light management commands.
| Command | Description |
|---|
| Add a light to the scene |
| Set a light property |
| List all lights |
Animation
Animation and keyframe commands.
| Command | Description |
|---|
| Set a keyframe on an object |
| Remove a keyframe from an object |
| Set the animation frame range |
| Set the animation FPS |
| List keyframes for an object |
Render Group
Render settings and output commands.
| Command | Description |
|---|
| Configure render settings |
| Show current render settings |
| List available render presets |
| Render the scene (generates bpy script) |
| Generate bpy script without rendering |
Session
Session management commands.
| Command | Description |
|---|
| Show session status |
| Undo the last operation |
| Redo the last undone operation |
| Show undo history |
Examples
Create a New Project
Create a new blender project file.
bash
cli-anything-blender project new -o myproject.json
# Or with JSON output for programmatic use
cli-anything-blender --json project new -o myproject.json
Interactive REPL Session
Start an interactive session with undo/redo support.
bash
cli-anything-blender
# Enter commands interactively
# Use 'help' to see available commands
# Use 'undo' and 'redo' for history navigation
State Management
The CLI maintains session state with:
- Undo/Redo: Up to 50 levels of history
- Project persistence: Save/load project state as JSON
- Session tracking: Track modifications and changes
Output Formats
All commands support dual output modes:
- Human-readable (default): Tables, colors, formatted text
- Machine-readable ( flag): Structured JSON for agent consumption
bash
# Human output
cli-anything-blender project info -p project.json
# JSON output for agents
cli-anything-blender --json project info -p project.json
For AI Agents
When using this CLI programmatically:
- Always use flag for parseable output
- Check return codes - 0 for success, non-zero for errors
- Parse stderr for error messages on failure
- MANDATORY: Use absolute paths for all file operations (rendering, project files). Relative paths are prone to failure in background execution.
- Verify outputs exist after export operations
More Information
- Full documentation: See README.md in the package
- Test coverage: See TEST.md in the package
- Methodology: See HARNESS.md in the cli-anything-plugin
Version
1.0.0