Getting Started

Getting started with Foyle

Installation

Prerequisites: VSCode & RunMe

Foyle relies on VSCode and RunMe.dev to provide the frontend.

  1. If you don’t have VSCode visit the downloads page and install it
  2. Follow RunMe.dev instructions to install the RunMe.dev extension in vscode

Install Foyle

  1. Download the latest release from the releases page

  2. On Mac you may need to remove the quarantine attribute from the binary

    xattr -d com.apple.quarantine /path/to/foyle
    

Setup

  1. Configure your OpenAPI key

    foyle config set openai.apiKeyFile=/path/to/openai/apikey
    
    • If you don’t have a key, go to OpenAI to obtain one
  2. Start the server

    foyle serve
    
    • By default foyle uses port 8877 for the http server

    • If you need to use a different port you can configure this as follows

    foyle config set server.httpPort=<YOUR HTTP PORT>
    
  3. Inside VSCode configure RunMe to use Foyle

    1. Open the VSCode setting palette
    2. Search for Runme: Ai Base URL
    3. Set the address to http://localhost:${HTTP_PORT}/api
      • The default port is 8877
      • If you set a non default value then it will be the value of server.httpPort

Try it out!

Now that foyle is running you can open markdown documents in VSCode and start interacting with foyle.

  1. Inside VSCode Open a markdown file or create a notebook; this will open the notebook inside RunMe

    • Refer to RunMe’s documentation for a walk through of RunMe’s UI
    • If the notebook doesn’t open in RunMe
      1. right click on the file and select “Open With”
      2. Select the option “Run your markdown” to open it with RunMe
  2. You can now add code and notebook cells like you normally would in vscode

  3. To ask Foyle for help do one of the following

    • Open the command pallet and search for Foyle generate a completion
    • Use the shortcut key:
      • “win;” - on windows
      • “cmd;” - on mac

Customizing Foyle VSCode Extension Settings

Customizing the Foyle Server Address

  1. Open the settings panel; you can click the gear icon in the lower left window and then select settings
  2. Search for `Runme: Ai base URL
  3. Set Runme: Ai base URL to the address of the Foyle server to use as the Agent
    • The Agent handles requests to generate completions

Customizing the keybindings

If you are unhappy with the default key binding to generate a completion you can change it as follows

  1. Click the gear icon in the lower left window and then select “Keyboard shortcuts”
  2. Search for “Foyle”
  3. Change the keybinding for Foyle: generate a completion to the keybinding you want to use

Where to go next


Last modified September 2, 2024: Remove gRPC and gRPC gateway (#225) (affb5ee)