{
  "slug": "gcloud-compute-metadata-from-file-reads-from-standard-input-ad55f902bd89",
  "title": "gcloud compute --metadata-from-file reads from standard input",
  "tools": [
    "gcloud"
  ],
  "tags": [
    "agent"
  ],
  "introduced_at": "2026-10-06T00:00:00.000Z",
  "announced_at": "2026-10-06T00:00:00.000Z",
  "effective_at": null,
  "date_basis": "source-publication",
  "status": "unknown",
  "how": {
    "incantation": "When metadata comes from standard input, pass `-` as the file path in `--metadata-from-file`. Use `KEY=-` on any of the four listed Compute commands.",
    "examples": [
      "printf '%s' '<metadata-value>' | gcloud compute instances add-metadata <INSTANCE_NAME> --zone=<ZONE> --metadata-from-file=<KEY>=-",
      "printf '%s' '<metadata-value>' | gcloud compute project-info add-metadata --metadata-from-file=<KEY>=-",
      "gcloud compute instances create <INSTANCE_NAME> --metadata-from-file=<KEY>=- < <INPUT_SOURCE>"
    ],
    "gotchas": [
      "--metadata-from-file=KEY=LOCAL_FILE_PATH (required): Sets a metadata value from a local file; use `-` as the path to read the value from standard input. For the add-metadata commands, at least one of `--metadata` or `--metadata-from-file` is required.",
      "KEY (required): Metadata key paired with the input value.",
      "INSTANCE_NAME (required): Instance to create or update.",
      "--zone=ZONE: Instance zone; if omitted, gcloud may prompt or attempt to determine it from the active project.",
      "The `-` file path reads the metadata value from standard input.",
      "This applies to the four listed commands."
    ]
  },
  "why_it_matters": "Set instance or project metadata from data produced on standard input.",
  "sources": [
    "https://docs.cloud.google.com/sdk/docs/release-notes#58800_2026-10-06",
    "https://docs.cloud.google.com/sdk/gcloud/reference/compute/instances/add-metadata",
    "https://docs.cloud.google.com/sdk/gcloud/reference/compute/project-info/add-metadata",
    "https://docs.cloud.google.com/sdk/gcloud/reference/compute/instances/create"
  ],
  "rank": 0.95029,
  "judge": {
    "publish": true,
    "judge_model": "codex-cli/gpt-6-luna+typesafe/jev-1.13.0",
    "prompt_version": "extract-v7+enrich-v1+judge-v2x3+jev-publish-v1"
  },
  "review_state": "approved",
  "provenance": {
    "run_id": "cloud-20261008",
    "verdict_id": "cloud-20261008:cloud-20261008-8318f02d757eb207-6:gate",
    "evidence_hash": "536626311e01c553b22b75810082021e80d5624a0b45d36fefe7f1b808c10702"
  },
  "review": {
    "draft_hash": "2de0296d4371081b1a39bb08a4e5eaabab4b91c6e89a6b7fa2a978b43b9bbc02",
    "reviewer": "publication-gate",
    "reviewed_at": "2026-10-07T00:00:00.000Z",
    "decision": "cloud-20261008:gate",
    "reason": "3 of 3 judge runs approved with p_yes >= 0.9 (mean 0.95 >= 0.9; 2 needed) and Jev gave 0.69 (>= 0.6 needed)."
  }
}
