assess_command
Split chained shell commands into steps, parse and score each for risk, and return a structured assessment with worst-step severity and recommendation.
Instructions
Assess the blast radius of a shell command.
Splits chained commands on &&, ||, ;, and |, then
parses, resolves, and scores each segment independently. The top-level
fields surface the worst step's score and recommendation; the chain
field contains every step's individual breakdown.
When project_root is provided and no graph database exists yet,
the graph is built automatically on the first call. Use
index_project to force a rebuild.
Args: command: Raw shell command string to analyze. cwd: Working directory for resolving relative paths. Defaults to the server's current working directory. project_root: Root directory of the project for graph-based scoring. If provided, the graph is auto-built when missing.
Returns: Structured risk assessment with worst-step score, severity, recommendation, and per-step chain breakdown.
Example::
assess_command("cd /tmp && rm -rf .", cwd="/home/user", project_root="/project")
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| cwd | No | ||
| command | Yes | ||
| project_root | No |