Skip to main content
Version: Next

thresh blueprint generate

Generate custom environment blueprints using AI from natural language descriptions.

New in v1.4.0

This command replaces thresh generate as part of the grouped blueprint command structure.

Migration:

  • Old: thresh generate "..."
  • New: thresh blueprint generate "..."

Synopsis​

thresh blueprint generate <prompt> [options]

Description​

The blueprint generate subcommand uses AI (via GitHub Copilot SDK) to create custom environment blueprints from natural language descriptions. The AI analyzes your requirements and generates a complete blueprint specification.

AI Model Support

Supports 20+ AI models including GPT-4o, Claude 3.5, Gemini 1.5, and more. Set your preferred model with thresh config set default-model gpt-4o.

Arguments​

ArgumentRequiredDescription
<prompt>YesNatural language description of the environment

Options​

OptionDescription
--model <name>, -mUse specific AI model (overrides default)
--output <file>, -oSave blueprint to file
--verbose, -vShow AI reasoning process
--help, -hShow help information

Examples​

Basic Usage​

thresh blueprint generate "Python data science environment with Jupyter and pandas"

Output:

{
"name": "python-datascience",
"description": "Python data science environment with Jupyter and pandas",
"base": "ubuntu-22.04",
"packages": [
"python3",
"python3-pip",
"python3-venv",
"build-essential",
"git"
],
"post_install": [
"pip3 install jupyter pandas numpy matplotlib seaborn scikit-learn",
"jupyter notebook --generate-config"
]
}

Save to File​

# Generate and display
thresh blueprint generate "Node.js 20 with TypeScript and PostgreSQL"

# Use the generated blueprint (automatically saved)
thresh up node-ts

Use Specific Model​

# Use Claude 3.5 Sonnet
thresh blueprint generate "Rust development environment" --model claude-3.5-sonnet

# Use GPT-4o
thresh blueprint generate "Go web server with Redis" --model gpt-4o

Complex Environments​

thresh blueprint generate "Full-stack development environment with:
- Node.js 20 and TypeScript
- PostgreSQL 15
- Redis 7
- nginx as reverse proxy
- Docker for containerization
- Git and common dev tools"

Output includes:

  • Base distribution selection
  • All required packages
  • Service configuration scripts
  • Environment variables
  • Post-install setup

Save with Custom Name​

# Generate and save with specific name
thresh blueprint generate "PHP 8.2 with Laravel" --output laravel

# List to verify
thresh blueprint list | grep laravel

# Provision
thresh up laravel

Blueprint Customization​

Edit Generated Blueprints​

# Generate
thresh blueprint generate "Python environment"

# Find the generated blueprint
thresh blueprint list | grep python

# Edit the JSON file directly
vim ~/.local/bin/blueprints/python-environment.json

# Use modified blueprint
thresh up python-environment

Common Modifications​

Add packages:

{
"packages": [
"python3",
"git",
"neovim" // Added manually
]
}

Add environment variables:

{
"env": {
"EDITOR": "vim",
"PATH": "/usr/local/bin:$PATH"
}
}

Add custom scripts:

{
"post_install": [
"pip install -r requirements.txt",
"git config --global user.name 'Your Name'",
"echo 'source ~/.bashrc' >> ~/.profile"
]
}

AI Models​

Available Models​

# GPT Models (fastest)
thresh blueprint generate "..." --model gpt-4o
thresh blueprint generate "..." --model gpt-4o-mini

# Claude Models (best for complex specs)
thresh blueprint generate "..." --model claude-3.5-sonnet
thresh blueprint generate "..." --model claude-3-opus

# Reasoning Models (for complex requirements)
thresh blueprint generate "..." --model o1-preview

# Gemini Models
thresh blueprint generate "..." --model gemini-1.5-pro

# Open Source Models
thresh blueprint generate "..." --model llama-3.1-405b
thresh blueprint generate "..." --model mistral-large

Set Default Model​

# Set for all future commands
thresh config set default-model claude-3.5-sonnet

# Verify
thresh config get default-model

Prompt Engineering Tips​

Be Specific​

# ❌ Vague
thresh blueprint generate "development environment"

# ✅ Specific
thresh blueprint generate "Node.js 20 development with Express, TypeScript, and MongoDB"

Include Version Numbers​

# ✅ Better
thresh blueprint generate "Python 3.11 with Django 5.0 and PostgreSQL 15"

Specify Tools and Configuration​

# ✅ Comprehensive
thresh blueprint generate "
Go 1.21 development environment with:
- golangci-lint for code quality
- delve for debugging
- PostgreSQL 15 client libraries
- Docker CLI
- git with pre-commit hooks
- vim with go plugin
"

Troubleshooting​

"GitHub CLI not authenticated"​

# Check authentication
gh auth status

# Re-authenticate if needed
gh auth login

# Install GitHub Copilot CLI extension (if not installed)
gh extension install github/gh-copilot

# Verify thresh can access Copilot
thresh config status

Info: https://github.com/features/copilot/cli

"Model not available"​

# List supported models (see documentation)
# Use a different model
thresh blueprint generate "..." --model gpt-4o

Invalid Blueprint Generated​

The AI occasionally generates invalid JSON. You can verify and edit:

# Generate and check
thresh blueprint generate "..." --verbose

# If issues, find and edit the generated file
thresh blueprint list
vim ~/.local/bin/blueprints/generated-blueprint.json

Exit Codes​

CodeMeaning
0Blueprint generated successfully
1AI error or invalid response
2Invalid arguments
5Configuration error (API key missing)

See Also​