The AgentBay SDK provides a comprehensive suite of tools for efficient interaction with AgentBay cloud environments, enabling you to create and manage cloud sessions, execute commands, operate files, and interact with user interfaces.
| Language | Install Command | Documentation |
|---|---|---|
| Python | pip install wuying-agentbay-sdk |
Python Docs |
| TypeScript | npm install wuying-agentbay-sdk |
TypeScript Docs |
| Golang | go get github.com/aliyun/wuying-agentbay-sdk/golang/pkg/agentbay |
Golang Docs |
Before using the SDK, you need to:
- Register an Alibaba Cloud account: https://aliyun.com
- Get APIKEY credentials: AgentBay Console
- Set environment variable:
- For Linux/MacOS:
export AGENTBAY_API_KEY=your_api_key_here- For Windows:
setx AGENTBAY_API_KEY your_api_key_herefrom agentbay import AgentBay
# Create session and execute command
agent_bay = AgentBay()
session_result = agent_bay.create()
session = session_result.session
result = session.command.execute_command("echo 'Hello AgentBay'")
print(result.output) # Hello AgentBay
# Clean up
agent_bay.delete(session)import { AgentBay } from 'wuying-agentbay-sdk';
// Create session and execute command
const agentBay = new AgentBay();
const sessionResult = await agentBay.create();
const session = sessionResult.session;
const result = await session.command.executeCommand("echo 'Hello AgentBay'");
console.log(result.output); // Hello AgentBay
// Clean up
await agentBay.delete(session);import "github.com/aliyun/wuying-agentbay-sdk/golang/pkg/agentbay"
// Create session and execute command
client, err := agentbay.NewAgentBay("", nil)
if err != nil {
fmt.Printf("Failed to initialize AgentBay client: %v\n", err)
return
}
sessionResult, err := client.Create(nil)
if err != nil {
fmt.Printf("Failed to create session: %v\n", err)
return
}
session := sessionResult.Session
result, err := session.Command.ExecuteCommand("echo 'Hello AgentBay'")
if err != nil {
fmt.Printf("Failed to execute command: %v\n", err)
return
}
fmt.Println(result.Output) // Hello AgentBay
// Clean up
_, err = client.Delete(session, false)
if err != nil {
fmt.Printf("Failed to delete session: %v\n", err)
return
}Complete Documentation - Full guides, tutorials, and API references
π New Users - If you're new to AgentBay or cloud development:
- Quick Start Tutorial - Get started in 5 minutes
- Core Concepts - Understand cloud environments and sessions
π Experienced Users - Already familiar with browser automation, computer use, mobile testing, or cloud development environments:
- Choose your environment:
- π Browser Automation - Web scraping, testing, form filling with stealth capabilities
- π₯οΈ Computer/Windows Automation - Desktop UI automation and window management
- π± Mobile Automation - Android UI testing and gesture automation
- π» CodeSpace - Cloud-based code execution environments
- Feature Guides - Complete feature introduction
- API Reference - Core API quick lookup
- Cookbook - Real-world examples and recipes
- Session Creation & Lifecycle - Create, manage, and delete cloud environments
- Environment Configuration - Configure SDK settings, regions, and endpoints
- Session Monitoring - Monitor session status and health validation
- Command Execution - Execute Shell commands in cloud environments
- File Operations - Upload, download, and manage cloud files
- Data Persistence - Save and retrieve data across sessions
- Context Management - Synchronize data and maintain state
- Computer Use - General automation and desktop operations
- Browser Use - Web automation, scraping, and browser control
- CodeSpace - Code execution and development environment
- Mobile Use - Mobile device simulation and control
This project is licensed under the Apache License 2.0 - see the LICENSE file for details.