Skip to content

Configuration

Intend uses a configuration file intend.config.json at the root of your project to manage settings, AI providers, and compiler behavior.

Example Config

json
{
  "sourceDir": "./src/intents",
  "outDir": "./out",
  "provider": "ollama",
  "ollama": {
    "model": "llama3",
    "baseUrl": "http://localhost:11434"
  },
  "gemini": {
    "apiKey": "${GEMINI_API_KEY}",
    "model": "gemini-2.5-flash-lite"
  },
  "debug": false
}

Options Reference

Core Settings

OptionTypeDefaultDescription
sourceDirstring"./src/intents"Directory to scan for .intent files.
outDirstring"./out"Directory where generated TypeScript files will be placed.
provider"gemini" | "ollama""gemini"Required. The AI provider backend to use.
includestring[]["**/*.intent"]Glob patterns to include.
excludestring[]["**/*.test.intent"]Glob patterns to exclude.
debugbooleanfalseEnable verbose logging of AI prompts and reasoning.

Ollama Configuration

Used when provider is set to "ollama".

OptionTypeDefaultDescription
ollama.modelstring"llama3"The model name to pull/run.
ollama.baseUrlstring"http://localhost:11434"URL of the Ollama server.
ollama.temperaturenumber0.2Creativity level (0.0 - 1.0).
ollama.num_threadnumberundefinedNumber of threads to use for generation.

Gemini Configuration

Used when provider is set to "gemini".

OptionTypeDefaultDescription
gemini.apiKeystring"${GEMINI_API_KEY}"Your Google AI Studio API Key.
gemini.modelstring"gemini-2.5-flash-lite"The Gemini model version.
gemini.temperaturenumber0.2Creativity level (0.0 - 1.0).

Environment Variables

You can use environment variables in your config file by using the ${VAR_NAME} syntax. This is highly recommended for secrets like API keys.

  1. Create a .env file (ensure it is git-ignored):
    env
    GEMINI_API_KEY=your_actual_key_here
  2. Reference it in intend.config.json:
    json
    "apiKey": "${GEMINI_API_KEY}"

Released under the MIT License.