Skip to content

ppt shape add

zmworm edited this page Mar 31, 2026 · 24 revisions

PowerPoint: Shape - Add

Add shapes and text boxes to a slide with text, fill, position, and styling.

Path: /slide[N] (parent)

Properties

Property Default Description
text (empty) Text content (supports \n for line breaks)
name TextBox {N} Shape name
x / left, y / top - Position (EMU or units: cm, in, pt, px)
width, height - Size (EMU or units)
font Calibri Font family
size 11 Font size (pt)
bold false Bold text
italic false Italic text
underline false true/single, double, false/none
strikethrough false true/single, double, false/none
color 000000 Font color (hex RGB or theme: accent1-6, dk1, dk2, lt1, lt2)
shadow - Text shadow color (hex)
glow - Text glow color (hex)
reflection false Text reflection
fill - Shape fill (hex) or none
gradient - Gradient fill (see Gradient Format below)
line / border / border.color - Border color
lineWidth / border.width - Border width
lineDash - solid, sysDot, sysDash, dash, dashDot, lgDash, lgDashDot, lgDashDotDot, dot, sysDashDot, sysDashDotDot
preset rect Shape geometry
align - left, center, right, justify
valign center top, center, bottom
margin - Text margin (single or left,top,right,bottom)
autoFit normal true/normal, shape, false/none
rotation 0 Degrees
opacity - 0-1
list - bullet, dash, arrow, check, star, numbered, alpha, roman, none
link - Hyperlink URL
spacing / charSpacing / letterSpacing - Character spacing (points)
indent - Paragraph first-line indent (EMU or units)
marginLeft / marL - Paragraph left margin (EMU or units)
marginRight / marR - Paragraph right margin (EMU or units)
baseline - super, sub, none, or percentage
superscript false Superscript text
subscript false Subscript text
textFill / textGradient - Gradient fill on text (e.g., C1-C2)
geometry / path / preset - SVG-like custom geometry path or preset shape name
flipH false Flip horizontally
flipV false Flip vertically
softEdge - Soft edge radius (points) or none
rot3d / rotation3d - 3D rotation "rotX,rotY,rotZ" or none
rotX - 3D rotation X-axis (degrees)
rotY - 3D rotation Y-axis (degrees)
rotZ - 3D rotation Z-axis (degrees)
bevel / bevelTop - Bevel preset or "preset-width-height"
bevelBottom - Bottom bevel preset or "preset-width-height"
depth / extrusion - Extrusion depth (points) or none
material - warmMatte, plastic, metal, etc.
lighting / lightRig - threePt, balanced, soft, harsh, etc.
zorder / z-order - front, back, forward, backward, or absolute position
lineSpacing - Line spacing (pt or %)
spaceBefore - Space before paragraph (pt)
spaceAfter - Space after paragraph (pt)
animation - Animation (see Shape-Set for format)
motionPath - Motion path animation (see Shape-Set for format)

Note: When a shape has fill=none, setting shadow, glow, reflection, or softedge applies the effect to text runs instead of shape-level properties.

Note: On morph slides, custom-named shapes automatically get the !! prefix.

Note: The first animation on a morph slide defaults to afterPrevious instead of onClick.

Gradient Format

Format Example Description
Simple C1-C2 Two-color linear gradient
With angle C1-C2-angle Linear gradient with angle
Custom stops C1@30-C2@70 Custom stop positions (percent)
Semicolon linear LINEAR;C1;C2;angle Explicit linear gradient
Semicolon radial RADIAL;C1;C2 Radial gradient
Semicolon path PATH;C1;C2 Path gradient

Animation Format

Format: EFFECT[-DIRECTION][-DURATION][-TRIGGER][-delay=N][-easein=N][-easeout=N] or none

Segments after the effect name are identified by content (not position):

  • Direction: left, right, up, down
  • Duration: milliseconds (default 400)
  • Trigger: click (default for 1st), after (default for subsequent), with
  • delay=N: Delay in ms
  • easein=N: Ease-in percentage
  • easeout=N: Ease-out percentage

Example: animation=flyIn-left-300-after-delay=200-easein=50

Shape Presets

rect, roundRect, ellipse, diamond, triangle, rtTriangle, parallelogram, trapezoid, pentagon, hexagon, octagon, star4, star5, star6, star8, star10, star12, star16, star24, star32, heart, cloud, lightning, sun, moon, rightArrow, leftArrow, upArrow, downArrow, chevron, plus, cross, ribbon

Examples

# Simple text box
officecli add slides.pptx /slide[1] --type shape --prop text="Hello World" --prop x=2cm --prop y=3cm --prop width=10cm --prop height=5cm

# Styled shape with fill
officecli add slides.pptx /slide[1] --type shape --prop text="Important" --prop x=5cm --prop y=5cm --prop width=15cm --prop height=3cm --prop fill=4472C4 --prop color=FFFFFF --prop size=24 --prop bold=true --prop align=center

# Shape with gradient
officecli add slides.pptx /slide[1] --type shape --prop text="Gradient" --prop x=2cm --prop y=10cm --prop width=10cm --prop height=5cm --prop gradient=4472C4-1A1A2E

# Shape with custom gradient stops
officecli add slides.pptx /slide[1] --type shape --prop fill=none --prop "gradient=FF0000@0-00FF00@50-0000FF@100" --prop x=2cm --prop y=2cm --prop width=10cm --prop height=5cm

# Shape with animation (new format)
officecli add slides.pptx /slide[1] --type shape --prop text="Animated" --prop x=5cm --prop y=5cm --prop width=10cm --prop height=5cm --prop animation=flyIn-left-300-after-delay=200-easein=50

# Ellipse shape
officecli add slides.pptx /slide[1] --type shape --prop preset=ellipse --prop fill=FF6600 --prop x=15cm --prop y=5cm --prop width=5cm --prop height=5cm

# Bulleted list
officecli add slides.pptx /slide[1] --type shape --prop "text=Item 1\nItem 2\nItem 3" --prop list=bullet --prop x=2cm --prop y=5cm --prop width=20cm --prop height=8cm

Output

PPT Add and Set for spatial elements return coordinate info and overlap warnings:

Added shape at /slide[1]/shape[3]
  x: 2cm  y: 5cm  width: 20cm  height: 8cm

If a new or repositioned element has the same (x, y) as an existing sibling:

Added shape at /slide[1]/shape[3]
  x: 5cm  y: 5cm  width: 10cm  height: 5cm
  WARNING: Same position as Title 1

This helps AI agents detect layout collisions and use distinct positions.


Based on OfficeCLI v1.0.28

Clone this wiki locally