Skip to main content
Version: 1.3.0

thresh config

Manage thresh configuration settings including AI models, telemetry, and custom distributions.

Synopsis

# View settings
thresh config status
thresh config get <key>

# Modify settings
thresh config set <key> <value>
thresh config reset

Description

The config command manages thresh's configuration file (~/.thresh/config.json). Configuration includes:

  • Default AI model
  • Default base distribution
  • Telemetry preferences
  • Custom distribution definitions
  • MCP server settings

Subcommands

config status

Show all configuration settings.

thresh config status

Output:

thresh Configuration
═══════════════════════════════════════

GitHub Copilot: ✓ Authenticated
Default Model: gpt-4o
Default Base: ubuntu-22.04
Telemetry: Enabled

Custom Distributions: 0
MCP Server: Enabled

config get

Get a specific configuration value.

thresh config get <key>

Examples:

# Get default model
thresh config get default-model
# Output: gpt-4o

# Get default base distribution
thresh config get default-base
# Output: ubuntu-22.04

# Get telemetry setting
thresh config get enable-telemetry
# Output: true

config set

Set a configuration value.

thresh config set <key> <value>

Examples:

# Set default AI model
thresh config set default-model claude-3.5-sonnet

# Set default distribution
thresh config set default-base alpine-3.19

# Disable telemetry
thresh config set enable-telemetry false

config reset

Reset all configuration to defaults.

thresh config reset

Output:

⚠ This will reset all configuration to defaults.
Continue? (y/N): y

✓ Configuration reset to defaults

Configuration Keys

AI Settings

KeyDescriptionDefaultExample Values
default-modelDefault AI model for generate/chatgpt-4oclaude-3.5-sonnet, gemini-1.5-pro, o1-preview

Environment Settings

KeyDescriptionDefaultExample Values
default-baseDefault base distributionubuntu-22.04alpine-3.19, debian-12

System Settings

KeyDescriptionDefaultExample Values
enable-telemetrySend anonymous usage datatruetrue, false

MCP Settings

KeyDescriptionDefaultExample Values
mcp.enabledEnable MCP servertruetrue, false
mcp.portMCP server port (if TCP)30003000-65535

Examples

Set Default AI Model

# Use Claude 3.5 Sonnet by default
thresh config set default-model claude-3.5-sonnet

# Verify
thresh config get default-model
# claude-3.5-sonnet

# Now all generate/chat commands use Claude
thresh generate "Python environment" # Uses Claude

Change Default Distribution

# Use Alpine Linux by default (faster, smaller)
thresh config set default-base alpine-3.19

# Future blueprints will default to Alpine
thresh generate "Node.js environment" # Uses Alpine base

Disable Telemetry

thresh config set enable-telemetry false

# Verify
thresh config get enable-telemetry
# false

View All Settings

thresh config status

Configuration File

Configuration is stored at ~/.thresh/config.json:

{
"defaultModel": "gpt-4o",
"defaultBase": "ubuntu-22.04",
"enableTelemetry": true,
"customDistributions": [],
"mcp": {
"enabled": true,
"port": 3000
}
}

Manual Editing

You can edit the config file directly:

# Edit with VS Code
code ~/.thresh/config.json

# Edit with Notepad
notepad ~/.thresh/config.json
Manual Editing

If you edit manually, ensure valid JSON syntax. Invalid JSON will cause thresh to reset to defaults.

GitHub Copilot Authentication

thresh uses GitHub CLI for authentication:

# Check auth status
gh auth status

# Authenticate if needed
gh auth login

# Verify thresh can access AI
thresh config status

Output:

GitHub Copilot: ✓ Authenticated

Telemetry

When enabled, thresh collects anonymous usage data:

  • Commands executed (names only, no arguments)
  • Blueprint names used (built-in only)
  • Performance metrics (startup time, provision duration)
  • Error types (no personal data)

Not collected:

  • File paths
  • Environment names
  • Custom blueprint content
  • Personal information

To opt out:

thresh config set enable-telemetry false

Troubleshooting

"Configuration file corrupt"

# Reset to defaults
thresh config reset

"GitHub CLI not authenticated"

# Re-authenticate
gh auth login

# Verify
thresh config status

Configuration Not Persisting

Check file permissions:

# View config file
Get-Item ~/.thresh/config.json

# If missing, create directory
New-Item -ItemType Directory -Force -Path ~/.thresh

Exit Codes

CodeMeaning
0Success
1General error
2Invalid key or value
5Configuration error

See Also