code_exec
code_exec runs any shell command and returns its output. Use it for one-off commands that do not have a dedicated graph tool — checking Docker status, querying a local service, inspecting environment variables.
code_exec(cmd="docker ps")code_exec(cmd="curl -s localhost:3000/health", timeout=15)code_exec(cmd="echo $PATH", timeout=5)Parameters
Section titled “Parameters”| Parameter | Type | Default | Description |
|---|---|---|---|
cmd | string | required | Shell command to run |
timeout | number | 60 | Timeout in seconds |
When to use
Section titled “When to use”- Check that a service or container is running
- Make a health check request to a local server
- Run a one-off migration or seed command
- Any command that does not fit a dedicated graph tool
What not to use it for
Section titled “What not to use it for”| Task | Use instead |
|---|---|
| Compile the project | code_build |
| Run tests | code_test |
| Lint the code | code_lint |
| Search code content | code_grep |
| List files | code_files |
code_exec is the escape hatch. For any task that a dedicated graph tool covers, use that tool — it returns structured, graph-mapped results rather than raw shell output.