---
schema_version: 1
route: /t/sam.md
tool: "sam"
---

# sincecutoff.com /t/sam — AWS SAM CLI

- name: AWS SAM CLI
- kind: cli
- children: none
- homepage: <https://github.com/aws/aws-sam-cli>

Changes to the tools coding agents drive, since a model's training cutoff, each linked to its first-party source. Check installed versions and limitations before acting; a cutoff date does not establish what a model knows.
Original editorial content: [Apache 2.0](https://sincecutoff.com/v1/data-license.txt), by [0xPatrick](https://0xpatrick.dev). Preserve applicable license and [NOTICE](https://sincecutoff.com/notice.txt) attribution when redistributing. Third-party source text and examples retain their own rights. [License scope and attribution](https://sincecutoff.com/v1/license.json).
To stay current, read the changes feed: [`/v1/changes.md?tool=sam`](https://sincecutoff.com/v1/changes.md?tool=sam) (or `.json`), adding `since=YYYY-MM-DD` for your training cutoff. Entries for registered children are included; the registry itself is `/v1/tools.json`. How to page and save your place: [llms.txt](https://sincecutoff.com/llms.txt).

### sam init adds JSON output (2026-09-03)
- slug: sam-init-adds-json-output-62c2f8e58181
- score: 0.90

How to use it:

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
```

- 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>
- 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."

### SAM CLI supports additional Java AL2023 runtimes (2026-07-23)
- slug: sam-cli-supports-additional-java-al2023-runtimes-afffbdafd1b4
- score: 0.94

How to use it:

If a SAM function uses Java 8, 11, or 17 on AL2023, set its `Runtime` property to `java8.al2023`, `java11.al2023`, or `java17.al2023`.

Examples:

```
Resources:
  <FunctionLogicalId>:
    Type: AWS::Serverless::Function
    Properties:
      Runtime: java17.al2023
```

- why_it_matters: Configure a SAM application to use a Java 8, 11, or 17 AL2023 runtime.
- sources: <https://github.com/aws/aws-sam-cli/releases/tag/v1.164.0>, <https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-resource-function.html>
- gotchas: "Version: v1.164.0"; "Runtime (required): Function runtime identifier; required when `PackageType` is `Zip`. Accepted values for this task: `java8.al2023`, `java11.al2023`, or `java17.al2023`."

### sam local disables hot reload with --no-watch (2026-06-10)
- slug: sam-local-disables-hot-reload-with-no-watch-d9e96b7b0422
- score: 0.97

How to use it:

When file changes should not trigger hot reload during a local API workflow, run `sam local start-api --warm-containers eager --no-watch`. With `--no-watch`, code and template changes are not detected automatically; stop and rerun the command to pick them up.

Examples:

```
sam local start-api --warm-containers eager --no-watch
```

- why_it_matters: Run a local SAM workflow without hot reload when file changes should not trigger reloads.
- before: Without `--no-watch`, `sam local start-api` automatically detects changes and reflects them; when using warm containers, detected code changes shut down the function container and it is recreated on the next invocation.
- sources: <https://github.com/aws/aws-sam-cli/releases/tag/v1.162.0>, <https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/using-sam-cli-local-start-api.html>
- gotchas: "Version: v1.162.0"; "--warm-containers eager: Loads containers for all functions at startup and keeps them between invocations."; "--no-watch: Disables file watching; code and template changes are not detected automatically."; "Prerequisite: Install the AWS SAM CLI and complete AWS SAM prerequisites."; "Prerequisite: Run from the project root; local API execution uses Docker containers."

### sam local processing of AWS::LanguageExtensions is opt-in (2026-05-22)
- slug: sam-local-processing-of-aws-languageextensions-is-opt-in-f323bdb71680
- score: 0.92

How to use it:

When a template uses `AWS::LanguageExtensions` and you want SAM to process it locally, pass `--language-extensions` on that command; local processing is off by default and the choice applies per invocation.

Examples:

```
sam local invoke <FunctionLogicalId> --language-extensions
```

- why_it_matters: When locally processing a template that uses AWS::LanguageExtensions, enable local processing if you need it.
- sources: <https://github.com/aws/aws-sam-cli/releases/tag/v1.161.0>, <https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-specification-language-extensions.html>, <https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-cli-command-reference-sam-local-invoke.html>, <https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/using-sam-cli-local-invoke.html>
- gotchas: "Version: v1.161.0"; "--language-extensions: Opts in to local processing of `AWS::LanguageExtensions` for this command invocation."; "<FunctionLogicalId>: Function resource logical ID to invoke; required when the template defines multiple functions."; "Prerequisite: Install the AWS SAM CLI and meet the AWS SAM prerequisites to use `sam local invoke`."; "Prerequisite: The template must list `AWS::LanguageExtensions` in `Transform` before `AWS::Serverless-2016-10-31` for SAM to detect and locally expand it."

### sam --env-vars accepts .env file format (2026-03-19)
- slug: sam-env-vars-accepts-env-file-format-a2f0c8405205
- score: 0.97

How to use it:

When setting local environment variables for SAM, put global `KEY=value` entries in a `.env` file, then pass its path to `sam local invoke` or `sam local start-api` with `--env-vars`.

Examples:

```
sam local invoke --env-vars .env
```

```
sam local start-api --env-vars .env
```

- why_it_matters: Set environment variables for a local SAM workflow using a .env file.
- sources: <https://github.com/aws/aws-sam-cli/releases/tag/v1.156.0>, <https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/serverless-sam-cli-using-invoke.html>, <https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-cli-command-reference-sam-local-invoke.html>
- gotchas: "Version: v1.156.0"; "--env-vars, -n <PATH>: Path to a JSON or `.env` file with Lambda environment variable values; format is detected automatically. `.env` values apply globally; function-specific overrides require JSON."; "Prerequisite: Create a `.env` file with `KEY=value` lines. Comments starting with `#` and quoted values are supported; `.env` files only support global variables."

### sam package supports --resolve-image-repos (2026-01-28)
- slug: sam-package-supports-resolve-image-repos-caf212e0fb83
- score: 0.95

How to use it:

When packaging a SAM template with image-based functions, run `sam package` with `--resolve-image-repos` to enable automatic image repository resolution.

Examples:

```
sam package --template-file <template.yaml> --s3-bucket <bucket> --resolve-image-repos
```

- why_it_matters: Package a SAM application that uses image repositories with the repository resolution option.
- sources: <https://github.com/aws/aws-sam-cli/releases/tag/v1.153.1>, <https://github.com/aws/aws-sam-cli/blob/v1.153.1/samcli/commands/package/command.py>, <https://github.com/aws/aws-sam-cli/blob/v1.153.1/samcli/commands/_utils/options.py>, <https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-cli-command-reference-sam-package.html>
- gotchas: "Version: v1.153.1"; "--resolve-image-repos: Flag that enables automatic ECR repository resolution; it takes no value."; "--s3-bucket <bucket> (required): S3 bucket for package artifacts when `--resolve-s3` is not used. The v1.153.1 source raises an error if image repositories are being resolved and no bucket is set."; "--template-file <template.yaml>: Path to the SAM template; the command otherwise searches the current project directory for a template."; "Prerequisite: The `sam package` command requires AWS credentials."; "Prerequisite: Provide `--s3-bucket <bucket>` or use `--resolve-s3` to supply a bucket when resolving image repositories."; "Docs conflict: The current AWS `sam package` reference page does not list `--resolve-image-repos`; the v1.153.1 official source defines and attaches it to `sam package`. https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-cli-command-reference-sam-package.html"
