Co-Developer GPT Engine: server that provides read/write file access to a local directory from ChatGPT as OpenAI GPT actions, incl. execution of configured actions on your own machine
url: https://maxenergyluo.loca.lt/**
paths:
/executeAction:
post:
operationId: executeAction
x-openai-isConsequential: false
summary: Execute an action with given content as standard input. Only on explicit user request.
parameters:
- name: actionName
in: query
required: true
schema:
type: string
requestBody:
required: true
content:
application/json:
schema:
type: object
properties:
actionInput:
type: string
responses:
'200':
description: Action executed successfully, output returned
content:
text/plain:
schema:
type: string
/fetchUrlTextContent:
get:
operationId: fetchUrlTextContent
x-openai-isConsequential: false
summary: Fetch text content from a given URL.
parameters:
- name: url
in: query
required: true
schema:
type: string
- name: raw
description: return raw html or pdf content without converting to markdown
in: query
required: false
schema:
type: boolean
responses:
'200':
description: fetch successful; content returned
content:
text/plain:
schema:
type: string
/grepFiles:
get:
operationId: grepAction
x-openai-isConsequential: false
summary: Search for lines in text files matching the given regex.
parameters:
- name: path
in: query
description: relative path to the directory to search in or the file to search. root directory = '.'
required: true
schema:
type: string
- name: fileRegex
in: query
description: optional regex to filter file names
required: false
schema:
type: string
- name: grepRegex
in: query
description: regex to filter lines in the files
required: true
schema:
type: string
- name: contextLines
in: query
description: number of context lines to include with each match (not yet used)
required: false
schema:
type: integer
responses:
'200':
description: Lines matching the regex
content:
text/plain:
schema:
type: string
/listFiles:
get:
operationId: listFiles
x-openai-isConsequential: false
summary: Recursively lists files in a directory. Optionally filters by filename and content.
parameters:
- name: path
in: query
description: relative path to directory to list. root directory = '.'
required: true
schema:
type: string
- name: filePathRegex
in: query
description: regex to filter file paths - use for search by file name
required: false
schema:
type: string
- name: grepRegex
in: query
description: an optional regex that lists only files that contain a line matching this pattern
required: false
schema:
type: string
- name: listDirectories
in: query
description: if true, lists directories instead of files
required: false
schema:
type: boolean
responses:
'200':
description: List of relative paths of the files
content:
text/plain:
schema:
type: string
/readFile:
get:
operationId: readFile
x-openai-isConsequential: false
summary: Read a files content.
parameters:
- name: path
in: query
description: relative path to file
required: true
schema:
type: string
- name: maxLines
in: query
description: maximum number of lines to read from the file
required: false
schema:
type: integer
- name: startLine
in: query
description: line number to start reading from
required: false
schema:
type: integer
responses:
'200':
description: Content of the file
content:
text/plain:
schema:
type: string
/replaceInFile:
post:
operationId: replaceInFile
x-openai-isConsequential: false
summary: Replaces the single occurrence of one or more literal strings in a file. The whole file content is matched, not line by line.
parameters:
- name: path
in: query
description: relative path to file
required: true
schema:
type: string
requestBody:
required: true
content:
application/json:
schema:
type: object
properties:
replacements:
type: array
items:
type: object
properties:
search:
type: string
description: The literal string to be replaced - can contain many lines, but please take care to find a small number of lines to replace. Everything that is replaced must be here. Prefer to match the whole line / several whole lines.
replace:
type: string
description: Literal replacement, can contain several lines. Please observe the correct indentation.
responses:
'200':
description: File updated successfully
/writeFile:
post:
operationId: writeFile
x-openai-isConsequential: false
summary: Overwrite a small file with the complete content given in one step. You cannot append to a file or write parts or write parts - use replaceInFile for inserting parts.
parameters:
- name: path
in: query
description: relative path to file
required: true
schema:
type: string
requestBody:
required: true
content:
application/json:
schema:
type: object
properties:
content:
type: string
responses:
'200':
description: File overwritten
Since OpenAI doesn't seem to want ChatGPT plugins anymore but GPTs, I'll focus on GPTs but leave in the plugin functionality, though put it into the background. It works as a co-developer for a GPT, but it isn't a GPT in itself - it provides the actions for the GPT, so I'll name it Co-Developer GPT Engine.