Skip to main content

Overview

HAI Build Code Generator can be configured through various settings to customize your development experience. Settings can be managed through the VS Code settings interface or by modifying configuration files directly.

Extension Configuration

Workspace Settings

The extension supports workspace-specific configuration through the .hai.config file placed at the root of your workspace.
The .hai.config file is not git-excluded by default. Ensure sensitive keys are not committed to your repository.

Configuration File Format

The .hai.config file uses a simple key-value format:
# Project name
name=my-project

# Langfuse Configuration
langfuse.apiUrl=https://cloud.langfuse.com
langfuse.apiKey=your-api-key
langfuse.publicKey=your-public-key

# PostHog Configuration
posthog.url=https://app.posthog.com
posthog.apiKey=your-api-key

# COR-Matrix Configuration
cormatrix.baseURL=https://cormatrix.example.com
cormatrix.token=your-token
cormatrix.workspaceId=your-workspace-id

Environment Variables

For local development, you can use environment variables to configure the extension. See the .env.example file for available options.
# Development Flags
IS_DEV=true
CLINE_ENVIRONMENT=local

# Langfuse Telemetry
LANGFUSE_SECRET_KEY=your-langfuse-secret-key
LANGFUSE_PUBLIC_KEY=your-langfuse-public-key
LANGFUSE_BASE_URL=https://cloud.langfuse.com

# PostHog Telemetry
TELEMETRY_SERVICE_API_KEY=your-posthog-telemetry-api-key
ERROR_SERVICE_API_KEY=your-posthog-error-tracking-api-key

# OpenTelemetry (Optional)
OTEL_TELEMETRY_ENABLED=1
OTEL_LOGS_EXPORTER=console
OTEL_METRICS_EXPORTER=otlp
OTEL_EXPORTER_OTLP_PROTOCOL=grpc
OTEL_EXPORTER_OTLP_ENDPOINT=localhost:4317

Activation Events

The extension activates automatically in the following scenarios:

On Language Detection

Activates when any programming language file is opened

On Startup

Activates when VS Code finishes starting up

Workspace Contains

Activates when workspace contains evals.env file

Commands and Keybindings

HAI Build provides several commands accessible via the Command Palette and keyboard shortcuts.

Default Keybindings

Cmd/Ctrl + '
keybinding
Jump to HAI chat input or add selected code to chat

Available Commands

CommandDescriptionShortcut
New TaskStart a new HAI task-
MCP ServersManage Model Context Protocol servers-
HistoryView task history-
SettingsOpen HAI settings-
Add to HAIAdd selected code to chatCmd/Ctrl + ‘
Generate Commit MessageGenerate AI-powered commit messages-
Explain with HAIExplain selected code-
Improve with HAIGet improvement suggestions-

Storage Configuration

HAI Build supports object storage backends for syncing data across devices.

S3 Storage

CLINE_STORAGE_ADAPTER="s3"
CLINE_STORAGE_BUCKET="cline"
CLINE_STORAGE_ACCESS_KEY_ID="your-access-key"
CLINE_STORAGE_SECRET_ACCESS_KEY="your-secret-key"
CLINE_STORAGE_REGION="us-west-1"  # Optional, defaults to us-east-1
CLINE_STORAGE_ENDPOINT="http://localhost:8333"  # Optional

Cloudflare R2 Storage

CLINE_STORAGE_ADAPTER="r2"
CLINE_STORAGE_BUCKET="cline"
CLINE_STORAGE_ACCESS_KEY_ID="your-access-key"
CLINE_STORAGE_SECRET_ACCESS_KEY="your-secret-key"
CLINE_STORAGE_ACCOUNT_ID="your-account-id"
CLINE_STORAGE_ENDPOINT="http://localhost:8333"  # Optional

Storage Sync Options

CLINE_STORAGE_SYNC_INTERVAL_MS
number
default:"30000"
Interval for sync worker in milliseconds
CLINE_STORAGE_SYNC_MAX_RETRIES
number
default:"5"
Maximum retries for failed sync operations
CLINE_STORAGE_SYNC_BATCH_SIZE
number
default:"10"
Number of files to sync in each batch
CLINE_STORAGE_SYNC_BACKFILL_ENABLED
boolean
default:"false"
Enable backfill of existing data on startup

Advanced Settings

Multi-Root Workspace Debugging

MULTI_ROOT_TRACE=true

gRPC Recorder

Enable gRPC request/response recording for testing:
GRPC_RECORDER_ENABLED=true
GRPC_RECORDER_FILE_NAME=test-recording

Test Mode

E2E_TEST=true
IS_TEST=true

Next Steps

LLM Providers

Configure AI model providers

Telemetry

Set up telemetry and monitoring

Experts

Create custom domain experts

Build docs developers (and LLMs) love