This is the multi-page printable view of this section. Click here to print.

Return to the regular view of this page.

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 and port 9080 for gRPC

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

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

      1. Open the VSCode setting palette
      2. Search for Runme: Foyle Address
      3. Set the address to localhost:${GRPC_PORT}
        • The default port is 9080
        • If you set a non default value then it will be the value of server.grpcPort

    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 Foyle
    3. Set Runme: Foyle Address 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