{
  "slug": "sam-init-adds-json-output-62c2f8e58181",
  "title": "sam init adds JSON output",
  "tools": [
    "sam"
  ],
  "tags": [
    "agent"
  ],
  "introduced_at": "2026-09-03T20:19:09.000Z",
  "announced_at": "2026-09-03T20:19:09.000Z",
  "effective_at": null,
  "date_basis": "source-publication",
  "status": "unknown",
  "how": {
    "incantation": "When a script needs machine-readable output while creating a SAM project, run `sam init` with `--output json` and all required initialization options; it prints one JSON object after completion.",
    "examples": [
      "sam init --no-interactive --runtime python3.13 --name <project-name> --app-template hello-world --output json"
    ],
    "gotchas": [
      "Version: v1.166.0",
      "--no-interactive (required): Disables interactive prompts; required for JSON output.",
      "--output json (required): Prints one structured JSON object after completion; success includes fields such as project directory and template file, failure includes an `error` object.",
      "--runtime python3.13 (required): Selects the Lambda runtime; required for non-interactive ZIP initialization when `--location` is not provided.",
      "--name <project-name> (required): Sets the project directory name; required for non-interactive initialization when `--location` is not provided.",
      "--app-template hello-world (required): Selects the managed application template; required for non-interactive initialization when `--location` is not provided.",
      "Prerequisite: Supply all required values for a fully non-interactive run; `--output json` does not work with the interactive workflow."
    ]
  },
  "why_it_matters": "Create a SAM project in a script that needs machine-readable initialization output.",
  "sources": [
    "https://github.com/aws/aws-sam-cli/releases/tag/v1.166.0",
    "https://docs.aws.amazon.com/en_en/serverless-application-model/latest/developerguide/sam-cli-command-reference-sam-init.html"
  ],
  "rank": 0.90024,
  "judge": {
    "publish": true,
    "judge_model": "codex-cli/gpt-6-luna+typesafe/jev-1.13.0",
    "prompt_version": "extract-v7+enrich-v2+judge-v2x3-rejudge+jev-publish-v1"
  },
  "review_state": "approved",
  "provenance": {
    "run_id": "wave2a-20261017",
    "verdict_id": "wave2a-20261017:wave2a-20261017-297559105c0b6e51-0:rescue",
    "evidence_hash": "a38269491e60227743a67464e69615d876039f46c67555a6c8c1855a6aa5766f"
  },
  "review": {
    "draft_hash": "64cfded19fea0ce259aede347215fc7ec26d5e0adfd20716651b687a3a902e46",
    "reviewer": "publication-gate",
    "reviewed_at": "2026-10-07T00:00:00.000Z",
    "decision": "wave2a-20261017:rescue",
    "reason": "Rescue path: first rejected only because the extracted card lacked usage; judged again on the enriched card, 2 of 3 judge runs approved with p_yes >= 0.9 (mean 0.90 >= 0.9; 2 needed) and Jev gave 0.71 (>= 0.6 needed)."
  }
}
