"openapi": "3.1.0"
"info":
  "title": "GitHub Tool"
  "description": "Retrieve directory and sub-directory structure and content of a file directly from a GitHub repository and create, update, or delete files in a GitHub repository."
  "version": "1.0.0"
"servers":
  -
    "url": "https://api.chat.buxo.ca"
"paths":
  "/api/github/repositories/tree":
    "post":
      "summary": "Retrieve the file and directory structure of a GitHub repository."
      "description": "Input: a directory or path (optional). Output: the structure of the specified directory or the root directory if no input is provided."
      "requestBody":
        "required": true
        "content":
          "application/json":
            "schema":
              "type": "object"
              "properties":
                "repository_url":
                  "type": "string"
                  "format": "uri"
                  "description": "URL of the repository"
                  "example": "https://github.com/username/repo"
                "repository_path":
                  "type":
                    - "string"
                    - "null"
                  "description": "Path within the repository"
                  "example": "src/"
                "repository_branch":
                  "type":
                    - "string"
                    - "null"
                  "description": "Reference to a specific branch or commit"
                  "example": "main"
              "required":
                - "repository_url"
      "responses":
        "200":
          "description": "File structure retrieved successfully."
          "content":
            "application/json":
              "schema":
                "type": "object"
                "properties":
                  "repository_url":
                    "type": "string"
                    "format": "uri"
                    "description": "URL of the repository"
                  "repository_structure":
                    "type": "array"
                    "items":
                      "type": "string"
                    "description": "Array of file and directory paths"
                  "repository_path":
                    "type":
                      - "string"
                      - "null"
                    "description": "Path within the repository"
                  "repository_branch":
                    "type":
                      - "string"
                      - "null"
                    "description": "Branch or commit reference"
                  "system":
                    "type": "object"
                    "description": "System information"
                    "properties": {}
                "required":
                  - "repository_url"
                  - "repository_structure"
  "/api/github/repositories/files/read":
    "post":
      "summary": "Fetch content of a file from a GitHub repository."
      "requestBody":
        "required": true
        "content":
          "application/json":
            "schema":
              "type": "object"
              "properties":
                "repository_url":
                  "type": "string"
                  "format": "uri"
                  "description": "URL of the repository"
                "repository_file_path":
                  "type": "string"
                  "description": "Path to the file within the repository"
                "repository_branch":
                  "type":
                    - "string"
                    - "null"
                  "description": "Branch or commit reference"
              "required":
                - "repository_url"
                - "repository_file_path"
            "examples":
              "fetch_file":
                "summary": "Fetch file content example"
                "value":
                  "repository_url": "https://github.com/username/repo"
                  "repository_file_path": "src/index.js"
                  "repository_branch": "main"
      "responses":
        "200":
          "description": "File content retrieved successfully."
          "content":
            "application/json":
              "schema":
                "type": "object"
                "properties":
                  "repository_url":
                    "type": "string"
                    "format": "uri"
                    "description": "URL of the repository"
                  "repository_file_path":
                    "type": "string"
                    "description": "Path to the file"
                  "repository_branch":
                    "type":
                      - "string"
                      - "null"
                    "description": "Branch or commit reference"
                  "file_content":
                    "type": "string"
                    "description": "Content of the file"
                "required":
                  - "repository_url"
                  - "repository_file_path"
                  - "file_content"
  "/api/github/repositories/files/create":
    "post":
      "summary": "Create a new file in a GitHub repository."
      "requestBody":
        "required": true
        "content":
          "application/json":
            "schema":
              "type": "object"
              "properties":
                "repository_url":
                  "type": "string"
                  "format": "uri"
                  "description": "URL of the repository"
                "repository_file_path":
                  "type": "string"
                  "description": "Path where the file should be created"
                "file_content":
                  "type": "string"
                  "description": "Content of the file to be created"
                "commit_message":
                  "type": "string"
                  "description": "Commit message for the file creation"
                "repository_branch":
                  "type":
                    - "string"
                    - "null"
                  "description": "Branch where the file should be created"
              "required":
                - "repository_url"
                - "repository_file_path"
                - "file_content"
                - "commit_message"
        "responses":
          "200":
            "description": "File created successfully."
            "content":
              "application/json":
                "schema":
                  "type": "object"
                  "properties":
                    "repository_url":
                      "type": "string"
                      "format": "uri"
                      "description": "URL of the repository"
                    "repository_file_path":
                      "type": "string"
                      "description": "Path of the created file"
                    "repository_branch":
                      "type":
                        - "string"
                        - "null"
                      "description": "Branch where the file was created"
                    "message":
                      "type": "string"
                      "description": "Success message"
                    "commit_message":
                      "type": "string"
                      "description": "Commit message used for the creation"
                  "required":
                    - "repository_url"
                    - "repository_file_path"
                    - "message"
                    - "commit_message"
  "/api/github/repositories/files/update":
    "post":
      "summary": "Update an existing file in a GitHub repository."
      "requestBody":
        "required": true
        "content":
          "application/json":
            "schema":
              "type": "object"
              "properties":
                "repository_url":
                  "type": "string"
                  "format": "uri"
                  "description": "URL of the repository"
                "repository_file_path":
                  "type": "string"
                  "description": "Path of the file to be updated"
                "file_content":
                  "type": "string"
                  "description": "New content for the file"
                "commit_message":
                  "type": "string"
                  "description": "Commit message for the update"
                "repository_branch":
                  "type":
                    - "string"
                    - "null"
                  "description": "Branch where the file should be updated"
              "required":
                - "repository_url"
                - "repository_file_path"
                - "file_content"
                - "commit_message"
        "responses":
          "200":
            "description": "File updated successfully."
            "content":
              "application/json":
                "schema":
                  "type": "object"
                  "properties":
                    "repository_url":
                      "type": "string"
                      "format": "uri"
                      "description": "URL of the repository"
                    "repository_file_path":
                      "type": "string"
                      "description": "Path of the updated file"
                    "repository_branch":
                      "type":
                        - "string"
                        - "null"
                      "description": "Branch where the file was updated"
                    "message":
                      "type": "string"
                      "description": "Success message"
                  "required":
                    - "repository_url"
                    - "repository_file_path"
                    - "message"
  "/api/github/repositories/files/delete":
    "post":
      "summary": "Delete a file from a GitHub repository."
      "requestBody":
        "required": true
        "content":
          "application/json":
            "schema":
              "type": "object"
              "properties":
                "repository_url":
                  "type": "string"
                  "format": "uri"
                  "description": "URL of the repository"
                "repository_file_path":
                  "type": "string"
                  "description": "Path of the file to be deleted"
                "commit_message":
                  "type": "string"
                  "description": "Commit message for the deletion"
                "repository_branch":
                  "type":
                    - "string"
                    - "null"
                  "description": "Branch where the file should be deleted"
              "required":
                - "repository_url"
                - "repository_file_path"
                - "commit_message"
        "responses":
          "200":
            "description": "File deleted successfully."
            "content":
              "application/json":
                "schema":
                  "type": "object"
                  "properties":
                    "repository_url":
                      "type": "string"
                      "format": "uri"
                      "description": "URL of the repository"
                    "repository_file_path":
                      "type": "string"
                      "description": "Path of the deleted file"
                    "repository_branch":
                      "type":
                        - "string"
                        - "null"
                      "description": "Branch where the file was deleted"
                    "message":
                      "type": "string"
                      "description": "Success message"
                    "commit_message":
                      "type": "string"
                      "description": "Commit message used for the deletion"
                  "required":
                    - "repository_url"
                    - "repository_file_path"
                    - "message"
                    - "commit_message"
  "/api/github/create":
    "post":
      "summary": "Create a new private GitHub repository."
      "description": "Creates a new private repository with specified settings."
      "requestBody":
        "required": true
        "content":
          "application/json":
            "schema":
              "type": "object"
              "properties":
                "repository_name":
                  "type": "string"
                  "description": "Name of the repository to be created"
                "repository_description":
                  "type": "string"
                  "description": "Description of the repository"
              "required":
                - "repository_name"
                - "repository_description"
      "responses":
        "201":
          "description": "Repository created successfully."
          "content":
            "application/json":
              "schema":
                "type": "object"
                "properties":
                  "message":
                    "type": "string"
                    "description": "Success message"
                  "repository":
                    "type": "object"
                    "properties":
                      "repository_name":
                        "type": "string"
                        "description": "Repository name"
                      "repository_full_name":
                        "type": "string"
                        "description": "Full repository name including owner"
                      "repository_html_url":
                        "type": "string"
                        "format": "uri"
                        "description": "Repository URL"
                      "repository_private":
                        "type": "boolean"
                        "description": "Repository privacy status"
                      "repository_description":
                        "type": "string"
                        "description": "Repository description"
                      "repository_created_at":
                        "type": "string"
                        "format": "date-time"
                        "description": "Repository creation timestamp"
                    "required":
                      - "repository_name"
                      - "repository_full_name"
                      - "repository_html_url"
                      - "repository_private"
                      - "repository_description"
                      - "repository_created_at"
                "required":
                  - "message"
                  - "repository"
"components":
  "securitySchemes":
    "bearerAuth":
      "type": "http"
      "scheme": "bearer"
"security":
  -
    "bearerAuth": []