A Flask extension that converts shell commands into RESTful HTTP endpoints for asynchronous execution.
Flask-Shell2HTTP is a Flask extension that provides a RESTful HTTP interface for executing shell commands asynchronously. It allows developers to convert command-line tools into web services by mapping shell commands to HTTP endpoints, enabling remote execution with dynamic arguments and file uploads. This solves the problem of integrating binary tools into web-based or microservice architectures without extensive rewrites.
Developers building microservices, DevOps tools, or internal APIs that need to expose command-line utilities over HTTP, particularly those working with Dockerized environments or binary-to-binary communication.
Developers choose Flask-Shell2HTTP for its minimal setup, seamless integration with Flask, and ability to handle long-running shell commands asynchronously with security features like callback functions and decorator support, making it ideal for prototyping and production use.
Execute shell commands via HTTP server (via flask's endpoints).
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
With less than 10 lines of code, you can map a shell command to an HTTP endpoint, as shown in the Quick Start example, making prototyping fast.
Uses Flask-Executor to run long-running commands like nmap in the background without blocking HTTP requests, ideal for heavy tools.
Allows passing arguments via JSON payloads in POST requests, enabling flexible command customization, as detailed in the basic example.
Supports processing multiple uploaded files in a single shell command, useful for tools requiring file inputs, demonstrated in the examples.
Enables custom callback functions for post-processing and Flask view decorators for middleware like authentication, enhancing workflow control.
Exposing shell commands over HTTP risks command injection attacks if inputs aren't rigorously sanitized; the README lacks emphasis on security best practices.
Tightly coupled with Flask and Flask-Executor, making it unsuitable for projects using other web frameworks or requiring language-agnostic solutions.
Adds HTTP layer and async management, which may introduce latency for short commands compared to direct subprocess calls, not ideal for high-throughput APIs.