{"id":20263835,"url":"https://github.com/teddy-gustiaux/serverless-confirm-command","last_synced_at":"2025-07-09T20:36:18.761Z","repository":{"id":33100206,"uuid":"149365668","full_name":"teddy-gustiaux/serverless-confirm-command","owner":"teddy-gustiaux","description":"Serverless plugin to make commands (and provider-specific options) requiring confirmation before execution.","archived":false,"fork":false,"pushed_at":"2022-12-30T17:21:31.000Z","size":2735,"stargazers_count":11,"open_issues_count":35,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-06-28T19:14:47.346Z","etag":null,"topics":["command","confirm","serverless","stage"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/teddy-gustiaux.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-09-18T23:49:55.000Z","updated_at":"2025-05-09T04:44:49.000Z","dependencies_parsed_at":"2023-01-14T23:21:41.456Z","dependency_job_id":null,"html_url":"https://github.com/teddy-gustiaux/serverless-confirm-command","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/teddy-gustiaux/serverless-confirm-command","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/teddy-gustiaux%2Fserverless-confirm-command","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/teddy-gustiaux%2Fserverless-confirm-command/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/teddy-gustiaux%2Fserverless-confirm-command/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/teddy-gustiaux%2Fserverless-confirm-command/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/teddy-gustiaux","download_url":"https://codeload.github.com/teddy-gustiaux/serverless-confirm-command/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/teddy-gustiaux%2Fserverless-confirm-command/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264502992,"owners_count":23618674,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["command","confirm","serverless","stage"],"created_at":"2024-11-14T11:36:26.721Z","updated_at":"2025-07-09T20:36:18.733Z","avatar_url":"https://github.com/teddy-gustiaux.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Serverless Confirm Command\n\n[![serverless](http://public.serverless.com/badges/v3.svg)](https://www.serverless.com)\n[![npm package](https://badge.fury.io/js/serverless-confirm-command.svg)](https://badge.fury.io/js/serverless-confirm-command)\n[![Build Status](https://travis-ci.com/teddy-gustiaux/serverless-confirm-command.svg?branch=master)](https://travis-ci.com/teddy-gustiaux/serverless-confirm-command)\n[![Code Coverage](https://img.shields.io/codecov/c/github/teddy-gustiaux/serverless-confirm-command.svg)](https://codecov.io/gh/teddy-gustiaux/serverless-confirm-command)\n[![Language grade: JavaScript](https://img.shields.io/lgtm/grade/javascript/g/teddy-gustiaux/serverless-confirm-command.svg?logo=lgtm\u0026logoWidth=18)](https://lgtm.com/projects/g/teddy-gustiaux/serverless-confirm-command/context:javascript)\n[![Known Vulnerabilities](https://snyk.io//test/github/teddy-gustiaux/serverless-confirm-command/badge.svg?targetFile=package.json)](https://snyk.io//test/github/teddy-gustiaux/serverless-confirm-command?targetFile=package.json)\n[![License](https://img.shields.io/badge/License-MIT-lightrey.svg)](https://opensource.org/licenses/MIT)\n\nThis [Serverless Framework](https://github.com/serverless/serverless) plugin allows you to define commands (as well as provider-specific options) that will require confirmation before being executed.\n\n## Features\n\n- Works with all cloud providers (and all runtimes)\n- Supports all CLI commands\n- Supports AWS stages and command/stage pairs\n\nYou can find a list of all serverless infrastructure providers (as well as their associated documentation) [here](https://serverless.com/framework/docs/providers/).\n\n## Changelog\n\nYou can find the changelog [here](https://github.com/teddy-gustiaux/serverless-confirm-command/blob/master/CHANGELOG.md) or in the [releases](https://github.com/teddy-gustiaux/serverless-confirm-command/releases) section.\n\n## Disclaimer\n\nOne of the intentions of this plugin is to make it more difficult to accidentally deploy or remove a serverless application when it should not.\nAlthough it provides another layer of protection, it does *not* replace deployment and security policies for your applications.\nPlease do not forget to set up and protect your deployments appropriately (especially your production environment).\n\n## Demonstration\n\n[![GIF demo](https://raw.githubusercontent.com/teddy-gustiaux/serverless-confirm-command/master/demo/demo.gif)](https://raw.githubusercontent.com/teddy-gustiaux/serverless-confirm-command/master/demo/demo.gif)\n\n## Documentation\n\n- [Serverless Confirm Command](#serverless-confirm-command)\n  - [Features](#features)\n  - [Changelog](#changelog)\n  - [Disclaimer](#disclaimer)\n  - [Demonstration](#demonstration)\n  - [Documentation](#documentation)\n  - [Prerequistes](#prerequistes)\n  - [Installation](#installation)\n  - [Configuration](#configuration)\n    - [Commands (provider-agnostic)](#commands-provider-agnostic)\n      - [List of commands](#list-of-commands)\n    - [AWS options](#aws-options)\n  - [Usage](#usage)\n  - [Example](#example)\n  - [License](#license)\n\n## Prerequistes\n\n- Serverless Framework `1.0.0` or more recent\n- Node.js `6.4.0` or more recent\n\n## Installation\n\nInstall the plugin by running:\n\n`npm install serverless-confirm-command --save-dev`\n\nAlternatively, if you are using Yarn:\n\n`yarn add serverless-confirm-command --dev`\n\nThen add the plugin to your `serverless.yml` file plugin section:\n\n```YAML\nplugins:\n  - serverless-confirm-command\n```\n\n## Configuration\n\nYou must configure the plugin in the custom section of your `serverless.yml` file, in a dedicated `confirm` section.\nAll options (provider-agnostic or not) can be used at the same time.\n\n### Commands (provider-agnostic)\n\nList the commands you want to confirm in a sub-section of the same name.\n\n```YAML\ncustom:\n  confirm:\n    commands:\n      - 'deploy'\n      - 'remove'\n```\n\nFor instance, the configuration above will require both the `deploy` and `remove` commands to be confirmed.\n\n#### List of commands\n\nPlease refer to the CLI reference of each provider for a complete list of available commands.\n\nAdditionally, it is important to note that each command possessing its own section in the documentation is considered a separate command.\nFor instance, if you are using AWS as your cloud provider, `deploy` and `deploy function` are considered to be [two different commands](https://serverless.com/framework/docs/providers/aws/cli-reference/).\n\n### AWS options\n\nIn you are using AWS as your cloud provider, you can set up any stage and/or command/stage pair to require confirmation.\n\n```YAML\ncustom:\n  confirm:\n    aws:\n      stages:\n        - 'release'\n      commandsForStages: # Must be listed as 'command:stage'\n        - 'remove:prod'\n```\n\nFor instance, the configuration above will require the following cases to be confirmed:\n\n- Any command using the stage `release`\n- The `remove` command used in combination with the `prod` stage\n\nYou can list as many stages and command/stage pairs as you want (as long as the command is supported by the plugin).\n\n## Usage\n\nOnce you have configured the plugin, you can continue to use the Serverless Framework exactly as you were before.\nThe commands (and potentially the other options) you have configured will now need to be confirmed.\n\nTo confirm a command (or any option), you must provide the CLI option `--confirm` when using Serverless.\n\n## Example\n\nLet us assume you want to configure the `remove` command to require confirmation to prevent accidental deletion of your application.\n\nConfiguration of the plugin:\n\n```YAML\ncustom:\n  confirm:\n    commands:\n      - 'remove'\n```\n\nUsing the command `serverless remove` will produce an error:\n\n```YAML\n  Serverless Confirm Command Error ---------------------------------------\n\n  Command not confirmed. Use [--confirm] or change the configuration of the plugin.\n```\n\nUsing the command `serverless remove --confirm` will succeed!\n\n## License\n\nDistributed under the [MIT license](http://opensource.org/licenses/MIT).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fteddy-gustiaux%2Fserverless-confirm-command","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fteddy-gustiaux%2Fserverless-confirm-command","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fteddy-gustiaux%2Fserverless-confirm-command/lists"}