Skip to content

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)
ParameterTypeDefaultDescription
cmdstringrequiredShell command to run
timeoutnumber60Timeout in seconds
  • 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
TaskUse instead
Compile the projectcode_build
Run testscode_test
Lint the codecode_lint
Search code contentcode_grep
List filescode_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.