Skip to content

Conversation

themmyloluwaa
Copy link

🎯 What this PR does

Adds support for custom deployment configuration files via the --config/-C flag in the pcc deploy command.

🚀 Usage

# Use custom config file
pcc deploy --config /path/to/custom-config.toml

# Short flag version  
pcc deploy -C ./staging-config.toml

# Override config values with CLI args
pcc deploy --config base-config.toml my-agent custom-image:v2

🔧 Technical Changes

  • CLI: Added --config/-C parameter to deploy command
  • Config Loading: Enhanced load_deploy_config_file() to accept custom paths
  • Decorator: Updated @with_deploy_config to handle custom config paths
  • Backward Compatibility: Existing pcc deploy commands continue working unchanged

✅ Testing

  • Added comprehensive test suite (7 tests) covering:
    • Custom config file loading
    • Error handling for invalid/missing files
    • Decorator integration
    • Backward compatibility
    • Default fallback behavior

🎯 Why this change?

Users previously could only use pcc-deploy.toml in the current directory. This enhancement enables:

  • Environment-specific configs: Different configs for dev/staging/prod
  • Shared configs: Reusable configuration files across projects
  • Organized workflows: Keep configs in dedicated directories

🔒 Backward Compatibility

No breaking changes - existing workflows continue working exactly as before.

📝 Additional Notes

  • Flag conflicts resolved: Used -C (capital) to avoid conflicts with existing -c (credentials) and -f (force) flags
  • Error handling: Graceful handling of missing files, invalid TOML, etc.
  • CLI precedence: CLI arguments still override config file values as expected

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants