serverless-plugin-scripts is a utility plugin for the Serverless Framework that extends its capabilities by allowing users to define custom shell commands and attach scripts to existing Serverless lifecycle events directly within their `serverless.yml` configuration files. The latest stable version, 1.0.2, was released in October 2017. As the project has not seen any updates or commits since then, it is considered abandoned and is no longer actively maintained. While it might still function with older Serverless Framework versions (specifically pre-v2, and likely struggling with v3+), it lacks compatibility with recent major Serverless releases and modern JavaScript/TypeScript project setups. There is no active release cadence, and users should be aware of potential security vulnerabilities or runtime issues due to its age. Its key differentiator was offering a simple, declarative way to embed shell commands into the Serverless deployment and development workflow, mitigating the need for external build scripts for simple operations. However, for robust CI/CD or complex build processes, more modern and maintained alternatives are recommended.
npm install serverless-plugin-scriptsVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to install `serverless-plugin-scripts`, configure custom CLI commands and lifecycle hooks in `serverless.yml`, and execute them using the Serverless CLI.
Consider migrating to a more actively maintained plugin or implementing custom script execution directly within your CI/CD pipeline or build scripts. Manually executing `npm run build` as part of your deployment process is often a safer alternative.
Minimize the scope of executed commands, avoid direct user input, and prioritize alternative, more secure methods for complex operations. Regularly review the commands for potential exploits.
Consult the official Serverless Framework documentation for your specific version to verify correct lifecycle event names and plugin API usage. Consider updating to a newer, maintained plugin if available.
Downgrade your Serverless Framework CLI version (e.g., `npm install -g serverless@~1`) or remove this plugin and migrate its functionality to external scripts or a newer, compatible plugin.
Ensure that simple commands are defined as a single string, e.g., `myCommand: 'echo Hello'`. For more complex configurations (like adding a description), use the `handler` property: `myCommand: { handler: 'echo Hello', description: '...' }`.Ensure all necessary executables are installed and accessible in the system's PATH where the Serverless command is executed. For CI/CD, verify the build environment setup.
This issue might indicate a deeper incompatibility with the Serverless Framework version. For simpler cases, ensure the `service` property is defined at the top of your `serverless.yml`. For complex scenarios, it may necessitate migrating away from this abandoned plugin.