The AWS SAM CLI is a command-line interface that supports building SAM-based applications. With the AWS SAM CLI, you can invoke Lambda functions locally, create a deployment package for your serverless application, and deploy your serverless application to the AWS Cloud.
SAM CLI supports a growing number of commands. The sam init command generates pre-configured AWS SAM templates along with example application code in the language of your choice. The sam local command supports local invocation and testing of your Lambda functions and SAM-based serverless applications by executing your function code locally in a Lambda-like execution environment. You can also use the sam local command to generate sample payloads locally, start a local endpoint to test your APIs, or automate testing of your Lambda functions. The sam package and sam deploy commands let you bundle your application code and dependencies into a “deployment package" and then deploy your serverless application to the AWS Cloud. Finally, the sam logs command enables you to fetch, tail, and filter logs for Lambda functions.