Python 88.3%
TypeScript 7.6%
Shell 4.1%
1#!/usr/bin/env python32"""Environments API (agent sandboxes): list → create (empty) → get → list files → delete.3STATUS: LIVE_VERIFIED 2026-09-18 (tmp-live/gemini-tools/env*.json): GET /v1beta/environments → 200 {} (empty); POST /v1beta/environments {}4→ 200 {id}; GET /v1beta/environments/{id} → 200 {id, status, storage, created, updated}; GET …/files/ (root listing) → 404 on a fresh5environment; DELETE → 200 {}. The discovery-doc spelling GET /v1beta/environments:list also answered 200.6Run: .venv/bin/python examples/gemini/interactions/environments.py7"""8import json, sys9from pathlib import Path10sys.path.insert(0, str(Path(__file__).resolve().parents[3]))11from scripts.live import gemini_request12st, r, _ = gemini_request("GET", "/v1beta/environments", note="environments.py list")13print("list:", st, json.dumps(r)[:200])14st, r, _ = gemini_request("POST", "/v1beta/environments", {}, note="environments.py create")15eid = r["id"]; print("create:", st, r)16st, g, _ = gemini_request("GET", f"/v1beta/environments/{eid}", note="environments.py get")17print("get:", st, json.dumps(g))18st, f, _ = gemini_request("GET", f"/v1beta/environments/{eid}/files/", note="environments.py files root")19print("files:", st, json.dumps(f)[:200] if not isinstance(f, bytes) else f[:200])20st, d, _ = gemini_request("DELETE", f"/v1beta/environments/{eid}", note="environments.py delete")21print("delete:", st, d)22