Local class lets you customize how the Cloud Code SDK works in your project. Here’s how to set it up for common scenarios, with simple examples.
Quick Start: Minimal Setup
- working_dir: Directory for file operations (usually your project root)
- api_key: Your Cloud Code API key (recommended via environment variable)
Common Configurations
1. Basic Usage (No Git, Default Model)
- Use this for simple projects or scripts.
2. Custom Model
- Enables version control for all changes (must be inside a git repo).
3. Architect Mode (Two-Model Workflow)
- Use for large or complex changes. Planner model makes a plan, editor model applies changes.
4. Custom Session Tracking
- Set a custom session ID for tracking usage.
All Configuration Options
How to List Available Models
Example: Run a Coding Task
Best Practices
- Set API keys via environment variables for security
- Enable git for important projects
- Use architect_mode for big or complex changes
- Pick models based on your task’s complexity
For more examples, see the examples folder.