Basics
Configuration
Configure the Local SDK to match your needs
The 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
Parameter | Type | Default | Description |
---|---|---|---|
working_dir | str | Required | Directory for file operations |
model | str | ”gpt-4.1-nano” | Main AI model |
editor_model | str | None | Separate model for editing (used in architect mode) |
use_git | bool | False | Use git for version control |
api_key | str | Required | Cloud Code API key |
architect_mode | bool | False | Enable planner + editor workflow |
weak_model | str | None | Weak model in architect mode |
session_id | str | None | Custom session identifier |
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.