Development Setup¶
Guide for setting up a development environment for Cloud Agent.
Prerequisites¶
- Rust (latest stable)
- Google Cloud SDK
- Terraform
- Git
Getting Started¶
Clone Repository¶
Build¶
Run Tests¶
# All tests
cargo test
# With output
cargo test -- --nocapture
# Specific test
cargo test test_help_command
Code Quality¶
Development Workflow¶
1. Create Branch¶
2. Make Changes¶
Edit code in src/.
3. Test¶
4. Run Locally¶
5. Commit¶
6. Push and PR¶
Project Structure¶
src/
├── main.rs # Entry point
├── cli.rs # CLI argument parsing (clap)
├── config.rs # Configuration management
├── error.rs # Custom error types
├── gcp.rs # GCP/Terraform operations
├── ssh.rs # SSH client wrapper
├── git.rs # Git operations
├── utils.rs # Utility functions
└── agents/ # Agent implementations
├── mod.rs # Agent trait
├── auggie.rs # Auggie agent
├── claude.rs # Claude agent
└── codex.rs # Codex agent
Key Concepts¶
Error Handling¶
We use anyhow for error handling:
use anyhow::{Result, Context};
fn my_function() -> Result<()> {
do_something().context("Failed to do something")?;
Ok(())
}
Agent Trait¶
All agents implement the Agent trait. See Adding Agents.
Async¶
We use Tokio for async operations:
Useful Commands¶
# Watch for changes and rebuild
cargo watch -x build
# Generate docs
cargo doc --open
# Check without building
cargo check
# Update dependencies
cargo update
IDE Setup¶
VS Code¶
Install extensions: - rust-analyzer - Even Better TOML - CodeLLDB (for debugging)
IntelliJ/RustRover¶
Install Rust plugin.
Getting Help¶
- Open an issue on GitHub
- Check existing issues for similar problems
- Read the Rust documentation