#!/usr/bin/env bash # Shell tool, LOCAL environment: prints the model's shell_call proposal; nothing is executed. STATUS: LIVE_VERIFIED 2026-09-18 (gpt-5.4-nano). # Run: bash examples/openai/tools/shell/shell.sh set -eo pipefail # no -u: oai() runs in $(...) subshells, so OAI_STATUS may be unset in the parent source "$(dirname "$0")/../../../../scripts/lib.sh" R=$(oai POST /v1/responses -d '{"model":"gpt-5.4-nano","input":"Propose the shell command `echo OK`. Do not explain.", "tools":[{"type":"shell","environment":{"type":"local"}}],"tool_choice":{"type":"shell"},"max_output_tokens":64,"reasoning":{"effort":"low"}}') log_request openai POST /v1/responses "${OAI_STATUS:-200}" 0.0001 "shell.sh local" echo "$R" | jq -c '.output[] | select(.type=="shell_call") | {call_id, action, environment, status}'