MASTERMIND
MASTERMIND · GPT Actions
codephreak RWX API
A secure API for Read/Write/Execute (RWX) access to local folders.
GET /listList files in the local directoryGET /read-fileRead content from a filePOST /uploadUpload a fileGET /downloadDownload a filePOST /executeExecute a safe command
原始 API 定义
{
"openapi": "3.1.0",
"info": {
"title": "codephreak RWX API",
"version": "1.0.0",
"description": "A secure API for Read/Write/Execute (RWX) access to local folders.\n"
},
"servers": [
{
"url": "https://your-public-api-url.com"
}
],
"paths": {
"/list": {
"get": {
"operationId": "listFiles",
"summary": "List files in the local directory",
"parameters": [
{
"in": "query",
"name": "path",
"required": false,
"schema": {
"type": "string",
"default": ""
}
}
],
"security": [
{
"BearerAuth": []
}
],
"responses": {
"200": {
"description": "A list of files in the specified directory",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/FileListResponse"
}
}
}
}
}
}
},
"/read-file": {
"get": {
"operationId": "readFile",
"summary": "Read content from a file",
"parameters": [
{
"in": "query",
"name": "file_path",
"required": true,
"schema": {
"type": "string"
}
}
],
"security": [
{
"BearerAuth": []
}
],
"responses": {
"200": {
"description": "File content",
"content": {
"text/plain": {
"schema": {
"type": "string"
}
}
}
}
}
}
},
"/upload": {
"post": {
"operationId": "uploadFile",
"summary": "Upload a file",
"requestBody": {
"required": true,
"content": {
"multipart/form-data": {
"schema": {
"$ref": "#/components/schemas/UploadFileRequest"
}
}
}
},
"security": [
{
"BearerAuth": []
}
],
"responses": {
"200": {
"description": "File uploaded successfully",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/SuccessResponse"
}
}
}
}
}
}
},
"/download": {
"get": {
"operationId": "downloadFile",
"summary": "Download a file",
"parameters": [
{
"in": "query",
"name": "file_name",
"required": true,
"schema": {
"type": "string"
}
}
],
"security": [
{
"BearerAuth": []
}
],
"responses": {
"200": {
"description": "File download successful",
"content": {
"application/octet-stream": {
"schema": {
"type": "string",
"format": "binary"
}
}
}
}
}
}
},
"/execute": {
"post": {
"operationId": "executeCommand",
"summary": "Execute a safe command",
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ExecuteCommandRequest"
}
}
}
},
"security": [
{
"BearerAuth": []
}
],
"responses": {
"200": {
"description": "Command executed successfully",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/SuccessResponse"
}
}
}
}
}
}
}
},
"components": {
"securitySchemes": {
"BearerAuth": {
"type": "http",
"scheme": "bearer",
"bearerFormat": "JWT"
}
},
"schemas": {
"FileListResponse": {
"type": "object",
"properties": {
"files": {
"type": "array",
"items": {
"type": "string"
},
"description": "List of file names in the directory"
}
}
},
"UploadFileRequest": {
"type": "object",
"properties": {
"file": {
"type": "string",
"format": "binary"
}
},
"required": [
"file"
]
},
"ExecuteCommandRequest": {
"type": "object",
"properties": {
"command": {
"type": "string"
}
},
"required": [
"command"
]
},
"SuccessResponse": {
"type": "object",
"properties": {
"message": {
"type": "string",
"example": "Operation successful"
}
}
}
}
}
}