SchemaSmith Documentation

Configuration Reference

Full reference for ~/.forge/config.json, environment variables, and CLI options.

Ask Forge Configuration Reference

Config File

A default config file is created automatically on first run if one does not exist. The resolved path depends on your platform:

  • Windows: C:\Users\<username>\.forge\config.json
  • macOS / Linux: ~/.forge/config.json

The file has four top-level sections:

Complete config.json Example
{
  "llm": {
    "active": "anthropic",
    "providers": {
      "ollama-local": {
        "type": "ollama",
        "endpoint": "http://localhost:11434",
        "model": "llama3:8b"
      },
      "anthropic": {
        "type": "anthropic",
        "apiKey": "${ANTHROPIC_API_KEY}",
        "model": "claude-sonnet-4-20250514"
      },
      "openai": {
        "type": "openAI",
        "apiKey": "${OPENAI_API_KEY}",
        "model": "gpt-4o",
        "organization": "org-optional"
      }
    }
  },
  "agent": {
    "trustLevel": "assistant",
    "autoExecute": true,
    "confirmTier3": true,
    "confirmTier4": true,
    "maxToolIterations": 10,
    "contextLevel": "standard",
    "showToolCalls": true,
    "autoSaveSession": false,
    "resumeLastSession": false,
    "sessionDirectory": "~/.forge/sessions",
    "maxConversationTurns": 20
  },
  "connections": {
    "mssql": {
      "server": "localhost",
      "port": 1433,
      "database": "MyDB",
      "user": "sa",
      "password": "${MSSQL_PASSWORD}"
    },
    "postgresql": {
      "server": "localhost",
      "port": 5432,
      "database": "mydb",
      "user": "postgres",
      "password": "${PGSQL_PASSWORD}"
    },
    "mysql": {
      "server": "localhost",
      "port": 3306,
      "database": "mydb",
      "user": "root",
      "password": "${MYSQL_PASSWORD}"
    }
  },
  "tools": {
    "mssql": {
      "schemaTongs": "C:\\Program Files\\SchemaSmith\\SchemaTongs.exe",
      "dataTongs": "C:\\Program Files\\SchemaSmith\\DataTongs.exe",
      "quench": "C:\\Program Files\\SchemaSmith\\SchemaQuench.exe"
    },
    "postgresql": {
      "schemaTongs": "C:\\Program Files\\SchemaSmith\\PostgresTongs.exe",
      "dataTongs": "C:\\Program Files\\SchemaSmith\\PostgresDataTongs.exe",
      "quench": "C:\\Program Files\\SchemaSmith\\PostgresQuench.exe"
    },
    "mysql": {
      "schemaTongs": "C:\\Program Files\\SchemaSmith\\MySQLTongs.exe",
      "dataTongs": "C:\\Program Files\\SchemaSmith\\MySQLDataTongs.exe",
      "quench": "C:\\Program Files\\SchemaSmith\\MySQLQuench.exe"
    }
  }
}
llm

Controls which LLM backend Ask Forge uses. Define multiple named providers and set active to switch between them. Set active to null to disable LLM integration entirely (tools still work).

See LLM Providers for per-provider setup.

agent

Controls the agentic tool-execution loop, trust boundaries, confirmation prompts, context depth, and session management. See the agent properties table below.

connections

Per-platform database connection settings (MSSQL, PostgreSQL, MySQL). Passwords support ${ENV_VAR} substitution to keep secrets out of the file. See Database Connections.

tools

Absolute paths to SchemaSmith tools (SchemaTongs, DataTongs, SchemaQuench) per platform. Only needed when tools are installed in non-standard locations — Ask Forge searches standard directories and PATH automatically.

Agent Properties

Property Type Default Description
trustLevel string "assistant" Permission level: observer (read-only), assistant (read + safe writes), or operator (full access).
autoExecute bool true Allow tools to run without manual approval, within the current trust level.
confirmTier3 bool true Always prompt before Modify (Tier 3) tools, even if autoExecute is true.
confirmTier4 bool true Always prompt before External (Tier 4) tools, even if autoExecute is true.
maxToolIterations int 10 Maximum tool calls per conversation turn. Prevents infinite loops.
contextLevel string "standard" Schema context depth: minimal (table names only), standard (current table full, others summarized), full (all tables in detail). Higher levels consume more tokens.
showToolCalls bool true Display tool invocations and parameters in output.
autoSaveSession bool false Automatically save the conversation to disk on exit.
resumeLastSession bool false Prompt to resume the previous session on startup.
sessionDirectory string "~/.forge/sessions" Directory where saved sessions are stored.
maxConversationTurns int 20 Maximum conversation history kept in memory. Older turns are dropped to stay within LLM context limits.

Precedence

Configuration values are resolved in priority order. When a value is set at multiple levels, the highest-priority source wins.

  1. CLI Parameters
    Explicit command-line flags (e.g., --platform mssql, --server localhost)
    Highest
  2. Environment Variables
    FORGE_* variables (e.g., FORGE_LLM_PROVIDER, FORGE_TRUST_LEVEL)
    High
  3. Config File
    Values in ~/.forge/config.json
    Normal
  4. Built-in Defaults
    Sensible defaults for all settings (e.g., trust level = assistant)
    Lowest
Example: Passing --platform mssql on the command line always overrides auto-detected context, environment variables, and config file settings.

Environment Variables

All supported FORGE_* environment variables are listed below. Each variable overrides the corresponding config file property.

LLM Quick Setup

These four variables work together as a quick-setup mechanism. When FORGE_LLM_PROVIDER is set, Ask Forge creates a synthetic provider named env-override and activates it, bypassing the config file's llm section entirely.

Variable Purpose Overrides
FORGE_LLM_PROVIDER Provider type (e.g., anthropic, openAI, ollama) Creates env-override provider
FORGE_LLM_API_KEY API key for the provider Used with FORGE_LLM_PROVIDER
FORGE_LLM_MODEL Model name Used with FORGE_LLM_PROVIDER
FORGE_LLM_ENDPOINT Endpoint URL Used with FORGE_LLM_PROVIDER

Provider-Specific Overrides

Variable Purpose Overrides
FORGE_LLM_ACTIVE Set active LLM provider llm.active
FORGE_OPENAI_API_KEY OpenAI API key Provider-specific override
FORGE_OPENAI_MODEL OpenAI model (default: gpt-4o) Provider-specific override
FORGE_ANTHROPIC_API_KEY Anthropic API key Provider-specific override
FORGE_ANTHROPIC_MODEL Anthropic model (default: claude-sonnet-4-20250514) Provider-specific override
FORGE_OLLAMA_ENDPOINT Ollama endpoint URL Provider-specific override
FORGE_OLLAMA_MODEL Ollama model name Provider-specific override

Tool Paths

Variable Purpose Overrides
FORGE_MSSQL_SCHEMA_TONGS MSSQL SchemaTongs path tools.mssql.schemaTongs
FORGE_MSSQL_DATA_TONGS MSSQL DataTongs path tools.mssql.dataTongs
FORGE_MSSQL_SCHEMA_QUENCH MSSQL SchemaQuench path tools.mssql.quench
FORGE_PGSQL_SCHEMA_TONGS PostgreSQL SchemaTongs path tools.postgresql.schemaTongs
FORGE_PGSQL_DATA_TONGS PostgreSQL DataTongs path tools.postgresql.dataTongs
FORGE_PGSQL_SCHEMA_QUENCH PostgreSQL SchemaQuench path tools.postgresql.quench
FORGE_MYSQL_SCHEMA_TONGS MySQL SchemaTongs path tools.mysql.schemaTongs
FORGE_MYSQL_DATA_TONGS MySQL DataTongs path tools.mysql.dataTongs
FORGE_MYSQL_SCHEMA_QUENCH MySQL SchemaQuench path tools.mysql.quench

Trust & License

Variable Purpose Overrides
FORGE_TRUST_LEVEL Trust level for MCP server agent.trustLevel
ASKFORGE_LICENSE License file path or directory License search location

File Input

Parameters that accept large JSON payloads or multi-line content can load their values from files using the @ prefix. The file path following @ is resolved relative to the current working directory.

@filename Examples
ask-forge apply-change --table Users --definition @column-def.json
ask-forge save-script --content @migration.sql --folder Migrations \
  --filename update.sql
ask-forge generate-schema --blueprint @blueprint.json
This is useful for scripting and automation where definitions are stored alongside source code.

Secret Substitution

API keys and passwords in config.json support ${ENV_VAR} syntax for environment variable substitution. Instead of storing raw secrets in the config file, reference environment variables:

API Key Example
{
  "llm": {
    "providers": {
      "anthropic": {
        "type": "anthropic",
        "apiKey": "${ANTHROPIC_API_KEY}",
        "model": "claude-sonnet-4-20250514"
      }
    }
  }
}
Database Password Example
{
  "connections": {
    "mssql": {
      "server": "localhost",
      "database": "MyDB",
      "user": "sa",
      "password": "${MSSQL_PASSWORD}"
    }
  }
}
If a referenced environment variable is not set, Ask Forge reports a configuration error at startup. Set values in your shell profile, a .env file loaded by your shell, or a secrets manager.

Database Connections

The connections section stores per-platform database settings. You can edit the config file directly or use CLI commands to manage connections.

CLI Commands

# Set a connection
ask-forge set-connection --platform mssql --server localhost \
  --port 1433 --database MyDB --user sa --password "${MSSQL_PASSWORD}"

ask-forge set-connection --platform postgresql --server localhost \
  --port 5432 --database mydb --user postgres --password "${PGSQL_PASSWORD}"

ask-forge set-connection --platform mysql --server localhost \
  --port 3306 --database mydb --user root --password "${MYSQL_PASSWORD}"

# Remove a connection
ask-forge clear-connection --platform mssql

# View current config (passwords visible — use with care)
ask-forge show-config

Config File Format

{
  "connections": {
    "mssql": {
      "server": "localhost",
      "port": 1433,
      "database": "MyDB",
      "user": "sa",
      "password": "${MSSQL_PASSWORD}"
    }
  }
}
{
  "connections": {
    "postgresql": {
      "server": "localhost",
      "port": 5432,
      "database": "mydb",
      "user": "postgres",
      "password": "${PGSQL_PASSWORD}"
    }
  }
}
{
  "connections": {
    "mysql": {
      "server": "localhost",
      "port": 3306,
      "database": "mydb",
      "user": "root",
      "password": "${MYSQL_PASSWORD}"
    }
  }
}

Tool Path Management

If SchemaSmith tools are installed in non-standard locations, configure explicit paths:

# Set tool paths
ask-forge set-tool-path --platform mssql --tool schemaTongs \
  --path "C:\Program Files\SchemaSmith\SchemaTongs.exe"

ask-forge set-tool-path --platform postgresql --tool schemaTongs \
  --path "/usr/local/bin/PostgresTongs"

# Remove a tool path (reverts to automatic discovery)
ask-forge clear-tool-path --platform mssql --tool schemaTongs