Skip to content

APIfy your local workspaces, allowing AI to interact with it.

License

Notifications You must be signed in to change notification settings

ivangabriele/firept

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

FirePT Logo

FirePT

APIfy your project workspace, allowing AI to interact with it.

NPM Version AGPL-3.0 license CI Unit Workflow CI E2E Workflow


Note

This is a work in progress and is still under heavy testing.
This doesn't work out of the box yet.


Introduction

FirePT is designed to enhance the capabilities of AI LLMs that accepts API actions (like custom GPTs) by providing an API to interact with the current working directory. It allows for performing various tasks like reading or editing files, running shell commands, and more to come.

You'll need to publicly expose the local FirePT via a domain and a secure HTTPS. FirePT already integrates PublicHost which does just that by tunneling your local server to a public domain with HTTPS. PublicHost is fully open-source and can be self-hosted. You can also use other similar services like Ngrok or LocalTunnel.

Features

Features

All features can only be run within the declared project directory.

  • OpenAPI documentation
  • List files
  • Read files
  • Create files and directories
  • Edit files
  • Delete files and directories
  • Move (rename) files and directories
  • Run shell commands
  • Local, per-project config file
  • Actions tracking (to help AI keep track of previous actions when starting new chat sessions)
  • Run shell commands in background pods (to avoid blocking the server response on long-running and forever-running commands) with logs, exit and kill endpoints
  • Read Github issues
  • Comment Github issues
  • Read Github pull requests
  • Comment Github pull requests
  • Partially read files (from line to line)
  • Partially edit files (from line to line)
  • Fine-grained feature control (to enable/disable features)

Important

I'm not among AI-Will-Take-Over-The-World believers. However, the file created as well as the shell commands could definitely do whatever they want to your system. Carefully watch FirePT logs and generated source code.

A good practice is to run FirePT in a sandboxed environment (container, VM, etc.) and to never run it as root.

Getting Started

Prerequisites

Before installing FirePT, ensure you have the following:

  • Node.js (version 20 or later)
  • npm (usually comes with Node.js)

Installation

Install FirePT globally using npm:

npm i -g firept

Setting up PublicHost

To be updated.

Preparing the workspace

Add a firept.yml (or firept.yaml) file to the root of your project directory.

server:
  apiKey: '****'
  port: 9999

publichost:
  apiKey: '****'
  host: publichost.org
  subdomain: your-subdomain

# If you don't use PublicHost but your own localhost public tunneling service (like ngrok or localtunnel):
# customPublicUrl: 'https://example.org'

# https://docs.github.com/en/rest/authentication/authenticating-to-the-rest-api?apiVersion=2022-11-28#authenticating-with-a-personal-access-token
# https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens
repository:
  provider: github
  personalAccessToken: '****'
  owner: your-github-username
  name: your-repo-name

# The following properties and sub-properties are all optional:
workspace:
  # `.gitignore` files and `.git` directories are already ignored by FirePT,
  # these are additional files and directories to ignore:
  ignoredFiles:
    - ./.yarn/**
    - ...

Important

!!! DO NOT COMMIT THE firept.yml FILE TO YOUR REPOSITORY.
ADD IT TO YOUR .gitignore FILE !!!

You can also add it you global .gitignore file to avoid polluting your team repo with your local settings.

Running FirePT

To start the FirePT server, run (within your project directory):

fire start

Using FirePT

With OpenAI Custom GPT

To be updated.

Contributing

We welcome contributions to FirePT! Please read our CONTRIBUTING.md for details on our code of conduct and the process for submitting pull requests.