Controlled File System Interaction and Script Execution with Kaguya: A ChatGPT Plugin
Tags: chatgpt, kaguya, opensource
Published: 2023-06-23 19:58:29

---
title: Controlled File System Interaction and Script Execution with Kaguya: A ChatGPT Plugin
published: true
date: 2023-06-23 10:01:47 UTC
tags: chatgpt, kaguya, opensource
canonical_url: 
---

# Kaguya: Empowering Developers with Controlled File System Interaction

![Kaguya](https://images.unsplash.com/photo-1679083216051-aa510a1a2c0e?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=1032&q=80)

Kaguya is a powerful ChatGPT plugin designed to provide developers with enhanced control over their local files. With Kaguya, you can seamlessly load and edit your files in a controlled manner, while also running Python, JavaScript, and bash scripts directly from within ChatGPT. This innovative tool revolutionizes the way developers interact with their file systems, enabling efficient collaboration and development workflows.

## API Endpoints

Kaguya offers a comprehensive set of API endpoints that allow you to interact with your file system seamlessly. The API is documented in the `openapi.yaml` file and provides the following functionality:

- `POST /api/executeCommand`: Execute a shell command.
- `GET /api/listFilesInDirectory`: List files and directories in the specified directory.
- `GET /api/readFile`: Read the content of a file in the user's directory.
- `POST /api/update`: Update a file in the user's directory by performing a search-and-replace operation.
- `POST /api/updateWholeFile`: Replace the entire content of a file in the user's directory.
- `POST /api/createFile`: Create a new file.
- `POST /api/deleteFile`: Delete a file in the user's directory.
- `POST /api/renameFile`: Rename a file in the user's directory.
- `POST /api/appendToFile`: Append content to the end of an existing file.
- `POST /api/createDirectory`: Create a new directory.
- `POST /api/deleteDirectory`: Delete a directory and its contents.
- `POST /api/readMultipleFiles`: Read the content of multiple files.

These API endpoints empower developers with granular control over their files and directories, making it easy to perform a wide range of file system operations.

## Running the Project

Getting started with Kaguya is straightforward. You can run the project using Docker by executing the `docker.sh` script:

```
docker.sh

```

Once the script is executed, you can access Kaguya through ChatGPT by using the appropriate localhost port.

## Discover Kaguya in Action

To get a firsthand look at Kaguya's capabilities, check out the demo videos shared on Twitter:

- [Demo Video](https://twitter.com/ykdojo/status/1645846044843077635)
- [Second Demo Video](https://twitter.com/ykdojo/status/1670848611532562433)

These demos showcase how Kaguya seamlessly integrates with ChatGPT, empowering developers with efficient file system interaction and script execution.

## Join the Kaguya Community on Discord

For further engagement and support, we invite you to join our Discord server. Connect with like-minded developers, share your experiences, and stay up to date with the latest Kaguya developments. Join our Discord community [here](https://discord.com/invite/nNtVfKddDD).

Experience the power and convenience of Kaguya as it transforms the way developers work with their local files. Elevate your development workflow and unlock new possibilities with Kaguya today!