BashSeek logo
Table of Contents

DeepSeek API Bash

This repository contains a simple Flask server, an Terminal UI for Bash to Bash communication, that connects to a Docker container to execute Bash commands. The API is designed to b

DeepSeek API Bash

This repository contains a simple Flask server, an Terminal UI for Bash to Bash communication, that connects to a Docker container to execute Bash commands. The API is designed to be lightweight and easy to use, allowing you to run prompts to return Bash commands to your Linux host (preferably and strongly recommended Container or VM).

Table of Contents


Features

  • Execute Bash commands inside a Docker container via HTTP requests.
  • Lightweight and easy to set up.
  • Supports custom Docker images.
  • Returns the output of the executed command.

Prerequisites

Before you begin, ensure you have the following installed:


Installation

  1. Clone the repository:

    Terminal window
    git clone https://github.com/lucaspereirasouza/DeepSeek-API-Bash.git
  2. Run Docker Compose to start the virtual machine:

    Terminal window
    docker compose up

Usage

Once the container is running, you can send HTTP requests to the API to execute Bash commands inside the Docker container.


API Endpoints

  • POST /execute

    Execute a Bash command inside the Docker container.

    Request Body:

    {
    "command": "your-bash-command-here"
    }

    Response:

    {
    "output": "command-output-here",
    "error": "error-message-if-any"
    }

Examples

  1. Using curl to execute a command:

    Terminal window
    curl -X POST http://localhost:3000/execute \
    -H "Content-Type: application/json" \
    -d '{"command": "echo Hello, World!"}'

    Response:

    {
    "output": "Hello, World!\n",
    "error": ""
    }
  2. Using curl to execute a command that fails:

    Terminal window
    curl -X POST http://localhost:3000/execute \
    -H "Content-Type: application/json" \
    -d '{"command": "ls /nonexistent"}'

    Response:

    {
    "output": "",
    "error": "ls: cannot access '/nonexistent': No such file or directory\n"
    }

Contributing

Contributions are welcome! Please feel free to submit a Pull Request or open an issue if you have any suggestions or find any bugs. :D

  1. Fork the repository.
  2. Create a new branch (git checkout -b feature/YourFeatureName).
  3. Commit your changes (git commit -m 'Add some feature').
  4. Push to the branch (git push origin feature/YourFeatureName).
  5. Open a Pull Request.

License

This project is licensed under the MIT License. See the LICENSE file for details. e lightweight and easy to use, allowing you to run prompts to return Bash commands to your Linux host (preferably and strongly recommended Container or VM).

Table of Contents


Features

  • Execute Bash commands inside a Docker container via HTTP requests.
  • Lightweight and easy to set up.
  • Supports custom Docker images.
  • Returns the output of the executed command.

Prerequisites

Before you begin, ensure you have the following installed:


Installation

  1. Clone the repository:

    Terminal window
    git clone https://github.com/lucaspereirasouza/DeepSeek-API-Bash.git
  2. Run Docker Compose to start the virtual machine:

    Terminal window
    docker compose up

Usage

Once the container is running, you can send HTTP requests to the API to execute Bash commands inside the Docker container.


API Endpoints

  • POST /execute

    Execute a Bash command inside the Docker container.

    Request Body:

    {
    "command": "your-bash-command-here"
    }

    Response:

    {
    "output": "command-output-here",
    "error": "error-message-if-any"
    }

Examples

  1. Using curl to execute a command:

    Terminal window
    curl -X POST http://localhost:3000/execute \
    -H "Content-Type: application/json" \
    -d '{"command": "echo Hello, World!"}'

    Response:

    {
    "output": "Hello, World!\n",
    "error": ""
    }
  2. Using curl to execute a command that fails:

    Terminal window
    curl -X POST http://localhost:3000/execute \
    -H "Content-Type: application/json" \
    -d '{"command": "ls /nonexistent"}'

    Response:

    {
    "output": "",
    "error": "ls: cannot access '/nonexistent': No such file or directory\n"
    }

Contributing

Contributions are welcome! Please feel free to submit a Pull Request or open an issue if you have any suggestions or find any bugs. :D

  1. Fork the repository.
  2. Create a new branch (git checkout -b feature/YourFeatureName).
  3. Commit your changes (git commit -m 'Add some feature').
  4. Push to the branch (git push origin feature/YourFeatureName).
  5. Open a Pull Request.

License

This project is licensed under the MIT License. See the LICENSE file for details.

My avatar

Thanks for reading my blog post! Feel free to check out my other posts or contact me via the social links in the footer.


More Posts

Comments