Skip to content

AI Completions

Will Fuqua edited this page Jun 14, 2026 · 3 revisions

AI Completions

C# REPL can suggest code completions using OpenAI. You bring your own API key, and usage is billed to your OpenAI account.

Setup

  1. Get an API key from OpenAI.
  2. Make it available to C# REPL, either:
    • set the OPENAI_API_KEY environment variable, or
    • pass --openAIApiKey <key> at startup.

Use

  • Press Ctrl+Alt+Space at the caret to request a completion.

Options

Set these at the command line or in your config file (see Configuring CSharpRepl):

  • --openAIApiKey <key>: your API key.
  • --openAIModel <model>: the model to use. Default: gpt-4o.
  • --openAIPrompt <prompt>: a system prompt prefixed to every submission.
  • --openAIHistoryCount <count>: how many previous REPL entries to send as context. Default: 5.

Clone this wiki locally