Full reference for ~/.forge/config.json, environment variables, and CLI options.
A default config file is created automatically on first run if one does not exist. The resolved path depends on your platform:
C:\Users\<username>\.forge\config.json~/.forge/config.jsonThe file has four top-level sections:
{
"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"
}
}
}
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.
Controls the agentic tool-execution loop, trust boundaries, confirmation prompts, context depth, and session management. See the agent properties table below.
Per-platform database connection settings (MSSQL, PostgreSQL, MySQL). Passwords support ${ENV_VAR} substitution to keep secrets out of the file. See Database Connections.
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.
| 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. |
Configuration values are resolved in priority order. When a value is set at multiple levels, the highest-priority source wins.
--platform mssql, --server localhost)
FORGE_* variables (e.g., FORGE_LLM_PROVIDER, FORGE_TRUST_LEVEL)
~/.forge/config.json
assistant)
--platform mssql on the command line always overrides auto-detected context, environment variables, and config file settings.
All supported FORGE_* environment variables are listed below. Each variable overrides the corresponding config file property.
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 |
| 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 |
| 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 |
| Variable | Purpose | Overrides |
|---|---|---|
FORGE_TRUST_LEVEL |
Trust level for MCP server | agent.trustLevel |
ASKFORGE_LICENSE |
License file path or directory | License search location |
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.
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
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:
{
"llm": {
"providers": {
"anthropic": {
"type": "anthropic",
"apiKey": "${ANTHROPIC_API_KEY}",
"model": "claude-sonnet-4-20250514"
}
}
}
}
{
"connections": {
"mssql": {
"server": "localhost",
"database": "MyDB",
"user": "sa",
"password": "${MSSQL_PASSWORD}"
}
}
}
.env file loaded by your shell, or a secrets manager.
The connections section stores per-platform database settings. You can edit the config file directly or use CLI commands to manage connections.
# 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
{
"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}"
}
}
}
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