Python 88.3%
TypeScript 7.6%
Shell 4.1%
1#!/usr/bin/env python32"""Shell tool in LOCAL mode: the model proposes commands (shell_call); we execute NOTHING here — we just print the proposal.3STATUS: LIVE_VERIFIED 2026-09-18 (gpt-5.4-nano; shell_call.action.commands == ['echo OK']). Hosted mode (environment container_auto)4is shown in the skills example. Run: .venv/bin/python examples/openai/tools/shell/shell.py5"""6import sys7from pathlib import Path8ROOT = Path(__file__).resolve().parents[4]; sys.path.insert(0, str(ROOT))9from scripts.live import load_env, log_request; load_env()10from openai import OpenAI11client = OpenAI(); MODEL = "gpt-5.4-nano"1213r = client.responses.create(model=MODEL, input="Propose the shell command `echo OK`. Do not explain.",14 tools=[{"type": "shell", "environment": {"type": "local"}}], tool_choice={"type": "shell"},15 max_output_tokens=64, reasoning={"effort": "low"})16log_request("openai", "POST", "/v1/responses", 200, 0.0001, "shell.py local proposal")17call = next(i for i in r.output if i.type == "shell_call")18print("shell_call:", call.call_id, call.action.commands, "timeout_ms=", call.action.timeout_ms, "environment=", call.environment)19# To continue you would run the commands yourself and send:20# {"type":"shell_call_output","call_id":call.call_id,"output":[{"stdout":"OK\n","stderr":"","outcome":{"type":"exit","exit_code":0}}]}21