Render Shell Blocks • AI Agent SDK

render_shell_blocks: Render “!`cmd` “ and ““ “`! “ blocks inside a skill body.

render_shell_blocks

Function

</div>

This function is defined in the shell_render module.

Render `!cmd and “ `! ` blocks inside a skill body.

Signature

python
def render_shell_blocks(body: str, enabled: bool, shell: str, timeout: int, cwd: Optional[str]) -> str

Parameters

ParamField str

SKILL.md body (post-substitution).

ParamField bool

Master switch. When False, every block is replaced with `[shell execution disabled]`. Defaults to False.

ParamField str

`bash (default) or powershell`.

ParamField int

Per-command timeout in seconds.

ParamField Optional[str]

Working directory for commands (typically the skill dir).

Returns

ResponseField str

Body with shell placeholders resolved.

Uses

  • _INLINE_RE.sub
  • _FENCED_RE.sub
  • m.group

Used By

Source

View on GitHub

praisonaiagents/skills/shell_render.py at line 49